-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmkfile
205 lines (176 loc) · 3.89 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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<mkconfig
###############################################################################
# Libs
###############################################################################
LIBS=\
lib_core\
lib_math\
lib_strings\
lib_graphics\
lib_gui\
lib_networking\
# used by plumb, iostats, snapfs, screenlock, etc\
lib_security\
lib_misc\
\
generators/lex/liblex\
debuggers/libmach\
# used by networking/ip, aux/vga/db, etc.\
database/libndb\
# used by compilers/cpp (which is used by pcc), languages/s9\
MISC/APE/libstdio\
#TODO:
# lib_audio (empty)
###############################################################################
# Programs
###############################################################################
PROGRAMS=\
assemblers\
linkers\
compilers\
generators\
machine\
MISC/APE/pcc\
\
shells\
windows\
\
builders\
debuggers\
profilers\
editors\
\
networking\
browsers\
\
utilities\
\
applications\
games\
#missing:
# interpreters/s9
# security/auth/
# typesetting (requires (slow) pcc, too slow so skipped for now)
#missing in subdirs:
# networking/http
# graphics/libimg
# ...
# used by mk clean
TESTS=\
ROOT/tests\
lib_graphics/libdraw/tests\
lib_graphics/libmemdraw/tests\
assemblers/5a/tests\
# need a arm/lib/libc.a\
compilers/5c/tests\
compilers/8c/tests\
linkers/8l/tests\
lib_gui/libpanel/tests\
###############################################################################
# Kernel
###############################################################################
# the programs in the directories below (e.g., bind, mount) are used as
# an initial /bin/ and mentioned in boot.rc
BOOTCMDS=\
# those programs are part of the root image (thx to data2s)\
kernel/files/user\
kernel/devices/storage/user/386/libdisk\
kernel/devices/storage/user/386/prep\
kernel/filesystems/user/dossrv\
# those programs are not part of the root image because they are called\
# after the call to dossrv\
kernel/devices/mouse/user\
kernel/devices/screen/user/386\
kernel/filesystems/user/ramfs\
# mntgen and ns\
kernel/devices/sys/user\
# for pi\
kernel/buses/user/usb
#TODO:
# kernel/memory/user
# kernel/syscalls/user
#This is set in mkfile-target-xxx
#KERNELDIR=kernel/COMPILE/9/pc
###############################################################################
# Targets
###############################################################################
CMDS=$PROGRAMS $BOOTCMDS
DIRS=$LIBS $CMDS
all:QV:
for (i in $DIRS) @{
echo $i
cd $i
mk $MKFLAGS $target
}
install uninstall:QV:
for (i in $DIRS) @{
echo $i
cd $i
mk $MKFLAGS $target
}
clean nuke:QV:
for (i in $DIRS $TESTS) @{
echo $i
cd $i
mk $MKFLAGS $target
}
help:VQ:
echo mk all, install, uninstall, clean, nuke, cmds, libs, or kernel
libs:QV:
for (i in $LIBS) @{
echo $i
cd $i
mk $MKFLAGS install
}
cmds:QV:
for (i in $CMDS) @{
echo $i
cd $i
mk $MKFLAGS install
}
kernel:QV:
# required to get the binaries for mkboot
mk $MKFLAGS install
for (i in $KERNELDIR) @{
echo $i
cd $i
mk $MKFLAGS install
}
disk:V: disk-$TARGET
doall:V:
mk all
mk kernel
mk disk
mk disksrc
mk run
# this defines the disk-xxx targets
<mkfile-host-$HOST
# this defines the run target
<mkfile-target-$TARGET
###############################################################################
# Literate programming
###############################################################################
LPDIRS=\
docs/principia \
kernel shells lib_core\
assemblers linkers compilers machine generators languages \
editors builders debuggers profilers version_control \
lib_graphics windows lib_gui \
networking browsers
#TODO
# utilities
#LESS
# s9, tiger, soldat
pdf lpclean pdfinstall:QV:
for (i in $LPDIRS) @{
echo $i
cd $i
mk $MKFLAGS $target
}
# need special :I: supported currently only by mk-in-ocaml
#sync:QVI:
# for (i in $LPDIRS) @{
# echo $i
# cd $i
# mk $MKFLAGS $target
# }