forked from inferno-os/inferno-os
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mkfile
183 lines (150 loc) · 3.51 KB
/
mkfile
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# Directories common to all architectures.
# Build in order:
# - critical libraries used by the limbo compiler
# - the limbo compiler (used to build some subsequent libraries)
# - the remaining libraries
# - commands
# - utilities
EMUDIRS=\
lib9\
libbio\
libmp\
libsec\
libmath\
utils/iyacc\
limbo\
libinterp\
libkeyring\
libdraw\
libprefab\
libtk\
libfreetype\
libmemdraw\
libmemlayer\
libdynld\
utils/data2c\
utils/ndate\
emu\
KERNEL_DIRS=\
os\
os/boot/pc\
# mkconfig is included at this point to allow it to override
#the preceding declarations (particularly KERNEL_DIRS) if need be
<mkconfig
DIRS=\
$EMUDIRS\
# appl\
foo:QV:
echo mk all, clean, install, installall or nuke
all:V: all-$HOSTMODEL
clean:V: clean-$HOSTMODEL
install:V: install-$HOSTMODEL
installall:V: installall-$HOSTMODEL
emu:V: emu/all-$HOSTMODEL
emuinstall:V: emu/install-$HOSTMODEL
emuclean:V: emu/clean-$HOSTMODEL
emunuke:V: emu/nuke-$HOSTMODEL
kernel:V: kernel/all-$HOSTMODEL
kernelall:V: kernel/all-$HOSTMODEL
kernelclean:V: kernel/clean-$HOSTMODEL
kernelinstall:V: kernel/install-$HOSTMODEL
kernelinstallall:V: kernel/installall-$HOSTMODEL
kernelnuke:V: kernel/nuke-$HOSTMODEL
nuke:V: nuke-$HOSTMODEL
cleandist:V: clean
rm -f $ROOT/$OBJDIR/lib/lib*.a
nukedist:V: nuke
rm -f $ROOT/$OBJDIR/bin/*.exe
rm -f $ROOT/$OBJDIR/lib/lib*.a
&-Posix:QV:
for j in $DIRS utils tools
do
echo "(cd $j; mk $MKFLAGS $stem)"
(cd $j; mk $MKFLAGS $stem) || exit 1
done
&-Nt:QV:
for (j in $DIRS utils tools)
{
echo '@{builtin cd' $j '; mk $MKFLAGS $stem}'
@{builtin cd $j; mk.exe $MKFLAGS $stem }
}
&-Inferno:QV:
for (j in $DIRS utils)
{
echo '@{builtin cd' $j '; mk $MKFLAGS $stem}'
@{builtin cd $j; mk $MKFLAGS $stem }
}
&-Plan9:QV:
for (j in $DIRS utils)
{
echo '@{builtin cd' $j '; mk $MKFLAGS $stem}'
@{builtin cd $j; mk $MKFLAGS $stem }
}
emu/&-Posix:QV:
for j in $EMUDIRS
do
echo "(cd $j; mk $MKFLAGS $stem)"
(cd $j; mk $MKFLAGS $stem) || exit 1
done
emu/&-Nt:QV:
for (j in $EMUDIRS)
{
echo '@{builtin cd' $j '; mk $MKFLAGS $stem}'
@{builtin cd $j; mk $MKFLAGS $stem }
}
emu/&-Plan9:QV:
for (j in $EMUDIRS)
{
echo '@{builtin cd' $j '; mk $MKFLAGS $stem}'
@{builtin cd $j; mk $MKFLAGS $stem }
}
kernel/&-Posix:QV:
for j in $KERNEL_DIRS
do
echo "(cd $j; mk $MKFLAGS $stem)"
(cd $j; mk $MKFLAGS $stem) || exit 1
done
kernel/&-Nt:QV:
for (j in $KERNEL_DIRS)
{
echo '@{builtin cd' $j '; mk $MKFLAGS $stem}'
@{builtin cd $j; mk $MKFLAGS $stem }
}
kernel/&-Inferno:QV:
for (j in $KERNEL_DIRS)
{
echo '@{builtin cd' $j '; mk $MKFLAGS $stem}'
@{builtin cd $j; mk $MKFLAGS $stem }
}
kernel/&-Plan9:QV:
for (j in $KERNEL_DIRS)
{
echo '@{builtin cd' $j '; mk $MKFLAGS $stem}'
@{builtin cd $j; mk $MKFLAGS $stem }
}
# Convenience targets
Inferno-% inferno-% Inferno-386-% inferno-386-%:V:
mk 'SYSHOST=Inferno' 'OBJTYPE=386' $stem
Inferno-arm-% inferno-arm-%:V:
mk 'SYSHOST=Inferno' 'OBJTYPE=arm' $stem
Plan9-% plan9-%:V:
mk 'SYSHOST=Plan9' 'OBJTYPE=386' $stem
Irix-% irix-%:V:
mk 'SYSHOST=Irix' 'OBJTYPE=mips' $stem
Linux-% linux-%:V:
mk 'SYSHOST=Linux' 'OBJTYPE=386' $stem
NetBSD-% netbsd-%:V:
mk 'SYSHOST=NetBSD' 'OBJTYPE=386' $stem
Nt-% nt-% Win95-% win95-%:V:
mk 'SYSHOST=Nt' 'OBJTYPE=386' $stem
Solaris-% solaris-%:V:
mk 'SYSHOST=Solaris' 'OBJTYPE=sparc' $stem
mkdirs:V: mkdirs-$SHELLTYPE
mkdirs-rc:V:
mkdir -p `{cat lib/emptydirs}
chmod 555 mnt/* n/client/* n/*
mkdirs-sh:V:
mkdir -p `cat lib/emptydirs`
chmod 555 mnt/* n/client/* n/*
mkdirs-nt:V:
mkdir -p `{cmd /c type lib\emptydirs}