aboutsummaryrefslogtreecommitdiff
path: root/mpw-build.in
blob: a581e626a1439b47a041a9344c06a6ff09b60f45 (plain)
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
126
127
128
129
130
# Top-level script fragment to build everything for MPW.

Set savedir "`Directory`"

#Set Echo 1

Set thisscript "{0}"

Set topsrcdir ":"

Set srcdir ":"

Set objdir ":"

Set verify 0
Set verifystr ""

Set BuildTarget "none"

Set prefix "{Boot}"Cygnus:latest:

# Parse arguments.

Loop
	Break If {#} == 0
	If "{1}" =~ /--srcdir/
		Set srcdir "{2}"
		Shift 1
	Else If "{1}" =~ /--topdir/
		Set topsrcdir "{2}"
		Shift 1
	Else If "{1}" =~ /--prefix/
		Set prefix "{2}"
		Shift 1
	Else If "{1}" =~ /-v/
		Set verify 1
		Set verifystr "-v"
		Shift 1
	Else
		If "{BuildTarget}" =~ /none/
			Set BuildTarget "{1}"
		Else
			Echo Only one build target allowed, ignoring "{1}"
		End If
	End If
	Shift 1
End Loop

If "{BuildTarget}" =~ /all/
	"{thisscript}" all-ld
	"{thisscript}" all-gcc
	"{thisscript}" all-gdb
Else If "{BuildTarget}" =~ /all-binutils/
	"{thisscript}" do-libiberty
	"{thisscript}" do-bfd
	"{thisscript}" do-opcodes
	"{thisscript}" do-binutils
Else If "{BuildTarget}" =~ /all-gas/
	"{thisscript}" do-libiberty
	"{thisscript}" do-bfd
	"{thisscript}" do-opcodes
	"{thisscript}" do-gas
Else If "{BuildTarget}" =~ /all-gcc/
	"{thisscript}" all-gas
	"{thisscript}" do-gcc
Else If "{BuildTarget}" =~ /all-gdb/
	"{thisscript}" do-libiberty
	"{thisscript}" do-bfd
	"{thisscript}" do-opcodes
	"{thisscript}" do-gdb
Else If "{BuildTarget}" =~ /all-ld/
	"{thisscript}" do-libiberty
	"{thisscript}" do-bfd
	"{thisscript}" do-opcodes
	"{thisscript}" do-ld
Else If "{BuildTarget}" =~ /do-bfd/
	SetDirectory :bfd:
	BuildProgram all
Else If "{BuildTarget}" =~ /do-libiberty/
	SetDirectory :libiberty:
	BuildProgram all
Else If "{BuildTarget}" =~ /do-mmalloc/
	SetDirectory :mmalloc:
	BuildProgram all
Else If "{BuildTarget}" =~ /do-opcodes/
	SetDirectory :opcodes:
	BuildProgram all
Else If "{BuildTarget}" =~ /do-readline/
	SetDirectory :readline:
	BuildProgram all
Else If "{BuildTarget}" =~ /do-binutils/
	SetDirectory :binutils:
	BuildProgram all
Else If "{BuildTarget}" =~ /do-gas/
	SetDirectory :gas:
	:mpw-build all --prefix "{prefix}"
Else If "{BuildTarget}" =~ /do-gcc/
	SetDirectory :gcc:
	:mpw-build all --prefix "{prefix}"
Else If "{BuildTarget}" =~ /do-gdb/
	SetDirectory :gdb:
	BuildProgram all
Else If "{BuildTarget}" =~ /do-ld/
	SetDirectory :ld:
	BuildProgram all
Else If "{BuildTarget}" =~ /install/
	"{thisscript}" install-binutils
	"{thisscript}" install-gas
	"{thisscript}" install-gcc
	"{thisscript}" install-gdb
	"{thisscript}" install-ld
Else If "{BuildTarget}" =~ /install-binutils/
	SetDirectory :binutils:
	:mpw-build install --prefix "{prefix}"
Else If "{BuildTarget}" =~ /install-gas/
	SetDirectory :gas:
	:mpw-build install --prefix "{prefix}"
Else If "{BuildTarget}" =~ /install-gcc/
	SetDirectory :gcc:
	:mpw-build install --prefix "{prefix}"
Else If "{BuildTarget}" =~ /install-gdb/
	SetDirectory :gdb:
	:mpw-build install --prefix "{prefix}"
Else If "{BuildTarget}" =~ /install-ld/
	SetDirectory :ld:
	:mpw-build install --prefix "{prefix}"
Else
End If

SetDirectory "{savedir}"