switch to tail -f circular pipes
[jackhill/mal.git] / ada.2 / Makefile
1 ifdef DEBUG
2 ADAFLAGS := -Wall -Wextra -gnatw.eH.Y -gnatySdouxy -gnatVa -g -gnataEfoqQ \
3 -fstack-check -pg
4 LDFLAGS := -pg
5 else
6 # -O3 is not recommended as the default by the GCC documentation,
7 # and -O2 seems to produce slightly better performances.
8 ADAFLAGS := -O2 -gnatnp
9 endif
10
11 # Compiler arguments.
12 CARGS = $(ADAFLAGS)
13 # Linker arguments.
14 LARGS = $(LDFLAGS) -lreadline
15
16 step0 := step0_repl
17 step13 := step1_read_print \
18 step2_eval \
19 step3_env
20 step49 := step4_if_fn_do \
21 step5_tco \
22 step6_file \
23 step7_quote \
24 step8_macros \
25 step9_try
26 stepa := stepA_mal
27 steps := $(step0) $(step13) $(step49) $(stepa)
28
29 .PHONY: all clean
30 all: $(steps)
31 clean:
32 $(RM) *~ *.adt *.ali *.o b~*.ad[bs] gmon.out $(steps)
33
34 # Tell Make how to detect out-of-date executables, and let gnatmake do
35 # the rest when it must be executed.
36 sources = $(foreach unit,$1,$(unit).adb $(unit).ads)
37 TYPES := $(call sources,\
38 envs \
39 err \
40 garbage_collected \
41 printer \
42 reader \
43 readline \
44 types \
45 types-atoms \
46 types-builtins \
47 types-fns \
48 types-maps \
49 types-sequences \
50 types-strings \
51 )
52 CORE := $(call sources,\
53 core \
54 )
55
56 $(step0) : %: %.adb
57 $(step13): %: %.adb $(TYPES)
58 $(step49): %: %.adb $(TYPES) $(CORE)
59 $(stepa) : stepA%: stepa%.adb $(TYPES) $(CORE)
60 $(steps) :
61 gnatmake $< -o $@ -cargs $(CARGS) -largs $(LARGS)
62
63 .PHONY: steps.diff
64 steps.diff:
65 diff -u step0_*.adb step1_*.adb || true
66 diff -u step1_*.adb step2_*.adb || true
67 diff -u step2_*.adb step3_*.adb || true
68 diff -u step3_*.adb step4_*.adb || true
69 diff -u step4_*.adb step5_*.adb || true
70 diff -u step5_*.adb step6_*.adb || true
71 diff -u step6_*.adb step7_*.adb || true
72 diff -u step7_*.adb step8_*.adb || true
73 diff -u step8_*.adb step9_*.adb || true
74 diff -u step9_*.adb stepa_*.adb || true