File: MPWMake

package info (click to toggle)
fpc 2.6.4%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 178,760 kB
  • ctags: 83,946
  • sloc: pascal: 2,000,374; xml: 138,807; ansic: 9,617; asm: 7,843; yacc: 3,747; php: 3,271; sh: 2,626; makefile: 2,610; lex: 2,537; sql: 267; cpp: 145; sed: 132; perl: 126; csh: 34; tcl: 7
file content (125 lines) | stat: -rw-r--r-- 4,282 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Make file for MPW make.
# To run it, use:
#   Make <target> -f MPWMake > Makeout ; Makeout
# where <target> should be replaced with actual make target.

#############################################
# TIPS (TODO move to Wiki or something
#
# Defined variables: No quoting
# Command lines: quote paths, dont quote option strings, since 
#   they might contain several options, which must be separated.
# Recursive call to Make: 
#   - give options as -d XXX="{XXX}"
#   - in same dir, remember to ensure to have different Makeout files,
#     e g Makeout2.
# 

# NOTE Currently cycle is stopped after three rounds, no diff is checked.

FPC = {FPCDIR}bin:ppcppc

# Default language for the compiler (english):
FPCLANG = e

MSGFILE = :msg:error{FPCLANG}.msg

msg2inc  :utils:msg2inc.pp
	{FPC} -FE: -WT :utils:msg2inc.pp

# The msgtxt.inc only depends on the error?.msg file, not on msg2inc,
# because that one will be new almost everytime
msgtxt.inc  {MSGFILE}
	Make msg2inc -f MPWMake > Makeout3 ; Makeout3
	msg2inc {MSGFILE} msg msg

msg  msgtxt.inc

compiler  msg
	Set Exit 0
  NewFolder :powerpc:units:  Dev:Null
  NewFolder :powerpc:units:powerpc-macos:  Dev:Null
  Set Exit 1
	"{FPC}" {OPT} "-Fu{RTLDIR}" -Fu:systems: -Fu:powerpc: -Fu:ppcgen -dGDB -dBROWSERLOG -dNOOPT 
   -dpowerpc -WT -FE: -FU:powerpc:units:powerpc-macos: pp.pas
	Rename -y pp ppcppc

clean  utils_clean
	Set Exit 0
	Delete -y :powerpc:units:powerpc-macos
	Delete -y ppcppc oldfpc msg2inc
	Delete -y .xcoff
	Set Exit 1

cycleclean 
	Set Exit 0
	Delete -y :powerpc:units:powerpc-macos
	Set Exit 1

install 
  If {FPCDIR} == ''
    Set -e FPCDIR `GetFileName -wd -m 'Select where to install the FreePascal folder'`FreePascal:
    Set -e Commands "{Commands},{FPCDIR}bin:"
    Echo "Set -e FPCDIR '{FPCDIR}'" > "{MPW}Startup Items:FPC Startup"
    Echo 'Set -e Commands "{Commands},{FPCDIR}bin:"' >> "{MPW}Startup Items:FPC Startup"
  End
  Set Exit 0
  NewFolder "{FPCDIR}"  Dev:Null
  NewFolder "{FPCDIR}bin:"  Dev:Null
  Set Exit 1
  Duplicate -y :ppcppc :utils:ppudump :utils:ppufiles :utils:ppumove 
               :utils:fpc "{FPCDIR}bin:"
  Echo "# Configuration file for Free Pascal for MPW" > "{FPCDIR}bin:fpc.cfg"
  Echo "-Fu'{FPCDIR}units:rtl:'" >> "{FPCDIR}bin:fpc.cfg"
  Echo "-l" >> "{FPCDIR}bin:fpc.cfg"
  Echo "-vi" >> "{FPCDIR}bin:fpc.cfg"

cycle 
	Directory ::rtl:macos
	Make clean -f MPWMake > Makeout ; Makeout
	Make all -d FPC="{FPC}" -d OPT="{OPT}" -f MPWMake > Makeout ; Makeout
	Directory :::compiler
	Make clean -f MPWMake > Makeout2 ; Makeout2
	Make compiler -d FPC="{FPC}" -d OPT="{OPT}" -d RTLDIR=::rtl:units:powerpc-macos -f MPWMake > Makeout2 ; Makeout2
	#
  Echo '******************** SECOND ROUND *********************'
	Rename -y ppcppc oldfpc
	Directory ::rtl:macos
	Make clean -f MPWMake > Makeout ; Makeout
	Make all -d FPC=:::compiler:oldfpc -d OPT="{OPT}" -f MPWMake > Makeout ; Makeout
	Directory :::compiler
	Make cycleclean -f MPWMake > Makeout2 ; Makeout2
	Make compiler -d FPC=oldfpc -d OPT="{OPT}" -d RTLDIR=::rtl:units:powerpc-macos -f MPWMake > Makeout2 ; Makeout2
  #
  Echo '********************* THIRD ROUND *********************'
	Rename -y ppcppc oldfpc
	Directory ::rtl:macos
	Make clean -f MPWMake > Makeout ; Makeout
	Make all -d FPC=:::compiler:oldfpc -d OPT="{OPT}" -f MPWMake > Makeout ; Makeout
	Directory :::compiler
	Make cycleclean -f MPWMake > Makeout2 ; Makeout2
	Make compiler -d FPC=oldfpc -d OPT="{OPT}" -d RTLDIR=::rtl:units:powerpc-macos -f MPWMake > Makeout2 ; Makeout2
  #
	Make utils_clean -f MPWMake > Makeout2 ; Makeout2
	Make utils_all -d FPC=::oldfpc -d OPT="{OPT}" -d RTLDIR=:::rtl:units:powerpc-macos -f MPWMake > Makeout2 ; Makeout2

utils_all 
	Directory :utils
	Set Exit 0
  NewFolder :units:  Dev:Null
  NewFolder :units:powerpc-macos:  Dev:Null
  Set Exit 1
	"{FPC}" {OPT} "-Fu{RTLDIR}" -FE: -FU:units:powerpc-macos -Fu:: -WT ppudump.pp
	"{FPC}" {OPT} "-Fu{RTLDIR}" -FE: -FU:units:powerpc-macos -Fu:: -WT ppufiles.pp
	"{FPC}" {OPT} "-Fu{RTLDIR}" -FE: -FU:units:powerpc-macos -Fu:: -WT ppumove.pp
  Duplicate -y fpc.mpw fpc
	Directory ::

utils_clean 
	Directory :utils
	Set Exit 0
	Delete -y :units:powerpc-macos
	Delete -y fpc ppudump ppufiles ppumove msg2inc
	Delete -y .xcoff
	Set Exit 1
	Directory ::