-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
470 lines (368 loc) · 14.2 KB
/
Makefile
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
# auto generated - do not edit
default: all
all:\
local UNIT_TESTS/except1 UNIT_TESTS/except1.ali UNIT_TESTS/except1.o \
UNIT_TESTS/execfile UNIT_TESTS/execfile.ali UNIT_TESTS/execfile.o \
UNIT_TESTS/execstring UNIT_TESTS/execstring.ali UNIT_TESTS/execstring.o \
UNIT_TESTS/loadbase UNIT_TESTS/loadbase.ali UNIT_TESTS/loadbase.o \
UNIT_TESTS/loadfile1 UNIT_TESTS/loadfile1.ali UNIT_TESTS/loadfile1.o \
UNIT_TESTS/loadfile2 UNIT_TESTS/loadfile2.ali UNIT_TESTS/loadfile2.o \
UNIT_TESTS/loadstring1 UNIT_TESTS/loadstring1.ali UNIT_TESTS/loadstring1.o \
UNIT_TESTS/loadstring2 UNIT_TESTS/loadstring2.ali UNIT_TESTS/loadstring2.o \
UNIT_TESTS/open UNIT_TESTS/open.ali UNIT_TESTS/open.o UNIT_TESTS/raiser.ali \
UNIT_TESTS/raiser.o UNIT_TESTS/utest.ali UNIT_TESTS/utest.o ctxt/bindir.o \
ctxt/ctxt.a ctxt/dlibdir.o ctxt/fakeroot.o ctxt/incdir.o ctxt/repos.o \
ctxt/slibdir.o ctxt/version.o deinstaller deinstaller.o install-core.o \
install-posix.o install-win32.o install.a installer installer.o instchk \
instchk.o insthier.o lua-ada-conf lua-ada-conf.o lua-ada.a lua-check-exception \
lua-check_raise.ali lua-check_raise.o lua-config.ali lua-config.o lua-ext.o \
lua-lib.ali lua-lib.o lua-user_data.ali lua-user_data.o lua.ali lua.o \
lua_check_exception.ali lua_check_exception.o
# Mkf-deinstall
deinstall: deinstaller conf-sosuffix
./deinstaller
deinstall-dryrun: deinstaller conf-sosuffix
./deinstaller dryrun
# Mkf-install
install: installer postinstall conf-sosuffix
./installer
./postinstall
install-dryrun: installer conf-sosuffix
./installer dryrun
# Mkf-instchk
install-check: instchk conf-sosuffix
./instchk
# Mkf-local
local: flags-lua libs-lua-S
./check-deps
local_pre:
local_clean:
# Mkf-test
tests:
(cd UNIT_TESTS && make)
tests_clean:
(cd UNIT_TESTS && make clean)
#----------------------------------------------------------------------
# SYSDEPS start
flags-lua:
@echo SYSDEPS lua-flags run create flags-lua
@(cd SYSDEPS && ./sd-run modules/lua-flags)
libs-lua-S:
@echo SYSDEPS lua-libs-S run create libs-lua-S
@(cd SYSDEPS && ./sd-run modules/lua-libs-S)
_sd_dlopen.h:
@echo SYSDEPS sd-dlopen run create libs-dlopen _sd_dlopen.h
@(cd SYSDEPS && ./sd-run modules/sd-dlopen)
libs-dlopen: _sd_dlopen.h
_sd_sysinfo.h:
@echo SYSDEPS sd-sysinfo run create _sd_sysinfo.h
@(cd SYSDEPS && ./sd-run modules/sd-sysinfo)
lua-flags_clean:
@echo SYSDEPS lua-flags clean flags-lua
@(cd SYSDEPS && ./sd-clean modules/lua-flags)
lua-libs-S_clean:
@echo SYSDEPS lua-libs-S clean libs-lua-S
@(cd SYSDEPS && ./sd-clean modules/lua-libs-S)
sd-dlopen_clean:
@echo SYSDEPS sd-dlopen clean libs-dlopen _sd_dlopen.h
@(cd SYSDEPS && ./sd-clean modules/sd-dlopen)
sd-sysinfo_clean:
@echo SYSDEPS sd-sysinfo clean _sd_sysinfo.h
@(cd SYSDEPS && ./sd-clean modules/sd-sysinfo)
sysdeps_clean:\
lua-flags_clean \
lua-libs-S_clean \
sd-dlopen_clean \
sd-sysinfo_clean \
# SYSDEPS end
#----------------------------------------------------------------------
UNIT_TESTS/except1:\
ada-bind ada-link UNIT_TESTS/except1.ald UNIT_TESTS/except1.ali \
UNIT_TESTS/utest.ali UNIT_TESTS/raiser.ali lua.ali lua-lib.ali lua-config.ali \
lua-ext.o
./ada-bind UNIT_TESTS/except1.ali
./ada-link UNIT_TESTS/except1 UNIT_TESTS/except1.ali lua-ext.o
UNIT_TESTS/except1.o UNIT_TESTS/except1.ali:\
ada-compile UNIT_TESTS/except1.adb lua.ali lua-config.ali UNIT_TESTS/raiser.ali \
UNIT_TESTS/utest.ali
./ada-compile UNIT_TESTS/except1.adb
UNIT_TESTS/execfile:\
ada-bind ada-link UNIT_TESTS/execfile.ald UNIT_TESTS/execfile.ali \
UNIT_TESTS/utest.ali lua.ali lua-lib.ali lua-ext.o
./ada-bind UNIT_TESTS/execfile.ali
./ada-link UNIT_TESTS/execfile UNIT_TESTS/execfile.ali lua-ext.o
UNIT_TESTS/execfile.o UNIT_TESTS/execfile.ali:\
ada-compile UNIT_TESTS/execfile.adb UNIT_TESTS/utest.ali lua.ali lua-lib.ali
./ada-compile UNIT_TESTS/execfile.adb
UNIT_TESTS/execstring:\
ada-bind ada-link UNIT_TESTS/execstring.ald UNIT_TESTS/execstring.ali \
UNIT_TESTS/utest.ali lua.ali lua-lib.ali lua-ext.o
./ada-bind UNIT_TESTS/execstring.ali
./ada-link UNIT_TESTS/execstring UNIT_TESTS/execstring.ali lua-ext.o
UNIT_TESTS/execstring.o UNIT_TESTS/execstring.ali:\
ada-compile UNIT_TESTS/execstring.adb UNIT_TESTS/utest.ali lua.ali lua-lib.ali
./ada-compile UNIT_TESTS/execstring.adb
UNIT_TESTS/loadbase:\
ada-bind ada-link UNIT_TESTS/loadbase.ald UNIT_TESTS/loadbase.ali \
UNIT_TESTS/utest.ali lua.ali lua-lib.ali lua-ext.o
./ada-bind UNIT_TESTS/loadbase.ali
./ada-link UNIT_TESTS/loadbase UNIT_TESTS/loadbase.ali lua-ext.o
UNIT_TESTS/loadbase.o UNIT_TESTS/loadbase.ali:\
ada-compile UNIT_TESTS/loadbase.adb UNIT_TESTS/utest.ali lua.ali lua-lib.ali
./ada-compile UNIT_TESTS/loadbase.adb
UNIT_TESTS/loadfile1:\
ada-bind ada-link UNIT_TESTS/loadfile1.ald UNIT_TESTS/loadfile1.ali \
UNIT_TESTS/utest.ali lua.ali lua-lib.ali lua-ext.o
./ada-bind UNIT_TESTS/loadfile1.ali
./ada-link UNIT_TESTS/loadfile1 UNIT_TESTS/loadfile1.ali lua-ext.o
UNIT_TESTS/loadfile1.o UNIT_TESTS/loadfile1.ali:\
ada-compile UNIT_TESTS/loadfile1.adb UNIT_TESTS/utest.ali lua.ali lua-lib.ali
./ada-compile UNIT_TESTS/loadfile1.adb
UNIT_TESTS/loadfile2:\
ada-bind ada-link UNIT_TESTS/loadfile2.ald UNIT_TESTS/loadfile2.ali \
UNIT_TESTS/utest.ali lua.ali lua-lib.ali lua-ext.o
./ada-bind UNIT_TESTS/loadfile2.ali
./ada-link UNIT_TESTS/loadfile2 UNIT_TESTS/loadfile2.ali lua-ext.o
UNIT_TESTS/loadfile2.o UNIT_TESTS/loadfile2.ali:\
ada-compile UNIT_TESTS/loadfile2.adb UNIT_TESTS/utest.ali lua.ali lua-lib.ali
./ada-compile UNIT_TESTS/loadfile2.adb
UNIT_TESTS/loadstring1:\
ada-bind ada-link UNIT_TESTS/loadstring1.ald UNIT_TESTS/loadstring1.ali \
UNIT_TESTS/utest.ali lua.ali lua-lib.ali lua-ext.o
./ada-bind UNIT_TESTS/loadstring1.ali
./ada-link UNIT_TESTS/loadstring1 UNIT_TESTS/loadstring1.ali lua-ext.o
UNIT_TESTS/loadstring1.o UNIT_TESTS/loadstring1.ali:\
ada-compile UNIT_TESTS/loadstring1.adb UNIT_TESTS/utest.ali lua.ali lua-lib.ali
./ada-compile UNIT_TESTS/loadstring1.adb
UNIT_TESTS/loadstring2:\
ada-bind ada-link UNIT_TESTS/loadstring2.ald UNIT_TESTS/loadstring2.ali \
UNIT_TESTS/utest.ali lua.ali lua-lib.ali lua-ext.o
./ada-bind UNIT_TESTS/loadstring2.ali
./ada-link UNIT_TESTS/loadstring2 UNIT_TESTS/loadstring2.ali lua-ext.o
UNIT_TESTS/loadstring2.o UNIT_TESTS/loadstring2.ali:\
ada-compile UNIT_TESTS/loadstring2.adb UNIT_TESTS/utest.ali lua.ali lua-lib.ali
./ada-compile UNIT_TESTS/loadstring2.adb
UNIT_TESTS/open:\
ada-bind ada-link UNIT_TESTS/open.ald UNIT_TESTS/open.ali UNIT_TESTS/utest.ali \
lua.ali lua-lib.ali lua-ext.o
./ada-bind UNIT_TESTS/open.ali
./ada-link UNIT_TESTS/open UNIT_TESTS/open.ali lua-ext.o
UNIT_TESTS/open.o UNIT_TESTS/open.ali:\
ada-compile UNIT_TESTS/open.adb UNIT_TESTS/utest.ali lua.ali
./ada-compile UNIT_TESTS/open.adb
UNIT_TESTS/raiser.ads:\
lua.ali
UNIT_TESTS/raiser.o UNIT_TESTS/raiser.ali:\
ada-compile UNIT_TESTS/raiser.adb UNIT_TESTS/raiser.ads
./ada-compile UNIT_TESTS/raiser.adb
UNIT_TESTS/utest.o UNIT_TESTS/utest.ali:\
ada-compile UNIT_TESTS/utest.adb UNIT_TESTS/utest.ads
./ada-compile UNIT_TESTS/utest.adb
ada-bind:\
conf-adabind conf-systype conf-adatype conf-adafflist flags-cwd
ada-compile:\
conf-adacomp conf-adatype conf-systype conf-adacflags conf-adafflist flags-cwd
ada-link:\
conf-adalink conf-adatype conf-systype conf-aldfflist libs-lua-S libs-math \
libs-dlopen libs-cwd
ada-srcmap:\
conf-adacomp conf-adatype conf-systype
ada-srcmap-all:\
ada-srcmap conf-adacomp conf-adatype conf-systype
cc-compile:\
conf-cc conf-cctype conf-systype conf-cflags conf-ccfflist flags-lua
cc-link:\
conf-ld conf-ldtype conf-systype conf-ldfflist libs-lua-S libs-math libs-dlopen
cc-slib:\
conf-systype
conf-adatype:\
mk-adatype
./mk-adatype > conf-adatype.tmp && mv conf-adatype.tmp conf-adatype
conf-cctype:\
conf-cc mk-cctype
./mk-cctype > conf-cctype.tmp && mv conf-cctype.tmp conf-cctype
conf-ldtype:\
conf-ld mk-ldtype
./mk-ldtype > conf-ldtype.tmp && mv conf-ldtype.tmp conf-ldtype
conf-sosuffix:\
mk-sosuffix
./mk-sosuffix > conf-sosuffix.tmp && mv conf-sosuffix.tmp conf-sosuffix
conf-systype:\
mk-systype
./mk-systype > conf-systype.tmp && mv conf-systype.tmp conf-systype
# ctxt/bindir.c.mff
ctxt/bindir.c: mk-ctxt conf-bindir
rm -f ctxt/bindir.c
./mk-ctxt ctxt_bindir < conf-bindir > ctxt/bindir.c
ctxt/bindir.o:\
cc-compile ctxt/bindir.c
./cc-compile ctxt/bindir.c
ctxt/ctxt.a:\
cc-slib ctxt/ctxt.sld ctxt/bindir.o ctxt/dlibdir.o ctxt/fakeroot.o \
ctxt/incdir.o ctxt/repos.o ctxt/slibdir.o ctxt/version.o
./cc-slib ctxt/ctxt ctxt/bindir.o ctxt/dlibdir.o ctxt/fakeroot.o ctxt/incdir.o \
ctxt/repos.o ctxt/slibdir.o ctxt/version.o
# ctxt/dlibdir.c.mff
ctxt/dlibdir.c: mk-ctxt conf-dlibdir
rm -f ctxt/dlibdir.c
./mk-ctxt ctxt_dlibdir < conf-dlibdir > ctxt/dlibdir.c
ctxt/dlibdir.o:\
cc-compile ctxt/dlibdir.c
./cc-compile ctxt/dlibdir.c
# ctxt/fakeroot.c.mff
ctxt/fakeroot.c: mk-ctxt conf-fakeroot
rm -f ctxt/fakeroot.c
./mk-ctxt ctxt_fakeroot < conf-fakeroot > ctxt/fakeroot.c
ctxt/fakeroot.o:\
cc-compile ctxt/fakeroot.c
./cc-compile ctxt/fakeroot.c
# ctxt/incdir.c.mff
ctxt/incdir.c: mk-ctxt conf-incdir
rm -f ctxt/incdir.c
./mk-ctxt ctxt_incdir < conf-incdir > ctxt/incdir.c
ctxt/incdir.o:\
cc-compile ctxt/incdir.c
./cc-compile ctxt/incdir.c
# ctxt/repos.c.mff
ctxt/repos.c: mk-ctxt conf-repos
rm -f ctxt/repos.c
./mk-ctxt ctxt_repos < conf-repos > ctxt/repos.c
ctxt/repos.o:\
cc-compile ctxt/repos.c
./cc-compile ctxt/repos.c
# ctxt/slibdir.c.mff
ctxt/slibdir.c: mk-ctxt conf-slibdir
rm -f ctxt/slibdir.c
./mk-ctxt ctxt_slibdir < conf-slibdir > ctxt/slibdir.c
ctxt/slibdir.o:\
cc-compile ctxt/slibdir.c
./cc-compile ctxt/slibdir.c
# ctxt/version.c.mff
ctxt/version.c: mk-ctxt VERSION
rm -f ctxt/version.c
./mk-ctxt ctxt_version < VERSION > ctxt/version.c
ctxt/version.o:\
cc-compile ctxt/version.c
./cc-compile ctxt/version.c
deinstaller:\
cc-link deinstaller.ld deinstaller.o insthier.o install.a ctxt/ctxt.a
./cc-link deinstaller deinstaller.o insthier.o install.a ctxt/ctxt.a
deinstaller.o:\
cc-compile deinstaller.c install.h ctxt.h
./cc-compile deinstaller.c
install-core.o:\
cc-compile install-core.c install.h
./cc-compile install-core.c
install-posix.o:\
cc-compile install-posix.c install.h
./cc-compile install-posix.c
install-win32.o:\
cc-compile install-win32.c install.h
./cc-compile install-win32.c
install.a:\
cc-slib install.sld install-core.o install-posix.o install-win32.o
./cc-slib install install-core.o install-posix.o install-win32.o
install.h:\
install_os.h
installer:\
cc-link installer.ld installer.o insthier.o install.a ctxt/ctxt.a
./cc-link installer installer.o insthier.o install.a ctxt/ctxt.a
installer.o:\
cc-compile installer.c ctxt.h install.h
./cc-compile installer.c
instchk:\
cc-link instchk.ld instchk.o insthier.o install.a ctxt/ctxt.a
./cc-link instchk instchk.o insthier.o install.a ctxt/ctxt.a
instchk.o:\
cc-compile instchk.c ctxt.h install.h
./cc-compile instchk.c
insthier.o:\
cc-compile insthier.c ctxt.h install.h
./cc-compile insthier.c
lua-ada-conf:\
cc-link lua-ada-conf.ld lua-ada-conf.o ctxt/ctxt.a
./cc-link lua-ada-conf lua-ada-conf.o ctxt/ctxt.a
lua-ada-conf.o:\
cc-compile lua-ada-conf.c ctxt.h _sd_sysinfo.h
./cc-compile lua-ada-conf.c
lua-ada.a:\
cc-slib lua-ada.sld lua-check_raise.o lua-config.o lua-ext.o lua-lib.o \
lua-user_data.o lua.o
./cc-slib lua-ada lua-check_raise.o lua-config.o lua-ext.o lua-lib.o \
lua-user_data.o lua.o
lua-check-exception:\
ada-bind ada-link lua-check-exception.ald lua_check_exception.ali \
lua-check_raise.ali lua-ext.o
./ada-bind lua_check_exception.ali
./ada-link lua-check-exception lua_check_exception.ali lua-ext.o
lua-check_raise.o lua-check_raise.ali:\
ada-compile lua-check_raise.adb lua-check_raise.ads
./ada-compile lua-check_raise.adb
# lua-config.ads.mff
lua-config.ads: lua-config.sh lua-check-exception
./lua-config.sh > lua-config.ads.tmp && mv lua-config.ads.tmp lua-config.ads
lua-config.o lua-config.ali:\
ada-compile lua-config.ads
./ada-compile lua-config.ads
lua-ext.o:\
cc-compile lua-ext.c
./cc-compile lua-ext.c
lua-lib.ads:\
lua.ali
lua-lib.o lua-lib.ali:\
ada-compile lua-lib.adb lua.ali lua-lib.ads
./ada-compile lua-lib.adb
lua-user_data.ads:\
lua.ali lua-lib.ali
lua-user_data.o lua-user_data.ali:\
ada-compile lua-user_data.adb lua-user_data.ads
./ada-compile lua-user_data.adb
lua.o lua.ali:\
ada-compile lua.adb lua.ads
./ada-compile lua.adb
lua_check_exception.o lua_check_exception.ali:\
ada-compile lua_check_exception.adb lua.ali lua-check_raise.ali
./ada-compile lua_check_exception.adb
mk-adatype:\
conf-adacomp conf-systype
mk-cctype:\
conf-cc conf-systype
mk-ctxt:\
mk-mk-ctxt
./mk-mk-ctxt
mk-ldtype:\
conf-ld conf-systype conf-cctype
mk-mk-ctxt:\
conf-cc conf-ld
mk-sosuffix:\
conf-systype
mk-systype:\
conf-cc conf-ld
clean-all: sysdeps_clean tests_clean local_clean obj_clean ext_clean
clean: obj_clean
obj_clean:
rm -f UNIT_TESTS/except1 UNIT_TESTS/except1.ali UNIT_TESTS/except1.o \
UNIT_TESTS/execfile UNIT_TESTS/execfile.ali UNIT_TESTS/execfile.o \
UNIT_TESTS/execstring UNIT_TESTS/execstring.ali UNIT_TESTS/execstring.o \
UNIT_TESTS/loadbase UNIT_TESTS/loadbase.ali UNIT_TESTS/loadbase.o \
UNIT_TESTS/loadfile1 UNIT_TESTS/loadfile1.ali UNIT_TESTS/loadfile1.o \
UNIT_TESTS/loadfile2 UNIT_TESTS/loadfile2.ali UNIT_TESTS/loadfile2.o \
UNIT_TESTS/loadstring1 UNIT_TESTS/loadstring1.ali UNIT_TESTS/loadstring1.o \
UNIT_TESTS/loadstring2 UNIT_TESTS/loadstring2.ali UNIT_TESTS/loadstring2.o \
UNIT_TESTS/open UNIT_TESTS/open.ali UNIT_TESTS/open.o UNIT_TESTS/raiser.ali \
UNIT_TESTS/raiser.o UNIT_TESTS/utest.ali UNIT_TESTS/utest.o ctxt/bindir.c \
ctxt/bindir.o ctxt/ctxt.a ctxt/dlibdir.c ctxt/dlibdir.o ctxt/fakeroot.c \
ctxt/fakeroot.o ctxt/incdir.c ctxt/incdir.o ctxt/repos.c ctxt/repos.o \
ctxt/slibdir.c ctxt/slibdir.o ctxt/version.c ctxt/version.o deinstaller \
deinstaller.o install-core.o install-posix.o install-win32.o install.a \
installer installer.o instchk instchk.o insthier.o lua-ada-conf lua-ada-conf.o \
lua-ada.a
rm -f lua-check-exception lua-check_raise.ali lua-check_raise.o lua-config.ads \
lua-config.ali lua-config.o lua-ext.o lua-lib.ali lua-lib.o lua-user_data.ali \
lua-user_data.o lua.ali lua.o lua_check_exception.ali lua_check_exception.o
ext_clean:
rm -f conf-adatype conf-cctype conf-ldtype conf-sosuffix conf-systype mk-ctxt
regen:\
ada-srcmap ada-srcmap-all
./ada-srcmap-all
cpj-genmk > Makefile.tmp && mv Makefile.tmp Makefile