-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmakefile
125 lines (78 loc) · 2.57 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
gcc := gcc -O0
# expandA mcA implements universal syntax and backquote. expandA expands backquote.
mcA.o : premacros.h mc.h mcA.c premacros.h
${gcc} -g mcA.c -c
expandA : mcA.o expandA.c
${gcc} -g -o expandA mcA.o expandA.c -ldl -lm
#testA
testA.c : expandA testA.mc
./expandA testA.mc testA.c
testA.o : testA.c
${gcc} -g testA.c -c
# expandB mcB implements pattern matching ucase in terms of backquote. expandB expands both ucase and backquote.
mcB.c : expandA mcB.mc
./expandA mcB.mc mcB.c
mcB.o : mcB.c
${gcc} -g mcB.c -c
expandB.c : expandA expandB.mc
./expandA expandB.mc expandB.c
expandB : mcB.o expandB.c
${gcc} -g -o expandB mcA.o mcB.o expandB.c -ldl -lm
#testB
testB.c : expandB testB.mc
./expandB testB.mc testB.c
testB.o : testB.c
${gcc} -g testB.c -c
#expandC expandC expands macro definition (umacro) as well as ucase and backquote.
mcC.c : expandB mcC.mc
./expandB mcC.mc mcC.c
mcC.o : mcC.c
${gcc} -g mcC.c -c
expandC.c : expandB expandC.mc
./expandB expandC.mc expandC.c
expandC : mcC.o expandC.c
${gcc} -g -o expandC mcA.o mcB.o mcC.o expandC.c -ldl -lm
#the compilation of expandD is a simple enough test of expandC.
#expandD expandD expands some additional generic macros --- push, dolist and sformat.
mcD.c : expandC mcD.mc
./expandC mcD.mc mcD.c
mcD.o : mcD.c
${gcc} -g mcD.c -c
expandD.c : expandC expandD.mc
./expandC expandD.mc expandD.c
expandD : mcD.o expandD.c
${gcc} -g -o expandD mcA.o mcB.o mcC.o mcD.o expandD.c -ldl -lm
#testD
testD.c : expandD testD.mc
./expandD testD.mc testD.c
testD.o : testD.c
${gcc} -g testD.c -c
#expandE mcE provides code for the REPL aand dynamic linking. expandE only provides one additional macro, install_base, for installing the base symbols.
mcE.c : expandD mcE.mc
./expandD mcE.mc mcE.c
mcE.o : mcE.c
${gcc} -g mcE.c -c
expandE.c : expandD expandE.mc
./expandD expandE.mc expandE.c
expandE : mcE.o expandE.c base_decls.h
${gcc} -g -o expandE mcA.o mcB.o mcC.o mcD.o mcE.o expandE.c -ldl -lm
#testE
testE.c : expandE testE.mc
./expandE ./ testE.mc testE.c
testE.o : testE.c
${gcc} -g testE.c -c
#REPL --- the REPL is depricated and has not been maintained
REPL.c : REPL.mc expandE
./expandE REPL.mc REPL.c
MC : REPL.c
${gcc} -g -o MC mcA.o mcB.o mcC.o mcD.o mcE.o REPL.c -ldl -lm
#testREPL
testREPL.c : testREPL.mc expandE
./expandE testREPL.mc testREPL.c
testREPL : testREPL.c
${gcc} -g -o testREPL mcA.o mcB.o mcC.o mcD.o mcE.o testREPL.c -ldl -lm
#IDE
IDE.c : IDE.mc expandE
./expandE IDE.mc IDE.c
NIDE : IDE.c
${gcc} -g -o NIDE mcA.o mcB.o mcC.o mcD.o mcE.o IDE.c -ldl -lm