363
|
1 CC = gcc
|
127
|
2 # -O3
|
59
|
3 CFLAGS = -g -Wall -I.
|
0
|
4 BASE=0
|
|
5 STAGE=1
|
|
6 MFLAGS=$(MFALGS) BASE=$(BASE) STAGE=$(STAGE)
|
126
|
7 ARCH=powerpc
|
|
8 MC=mc-$(ARCH)
|
|
9 # MLIB = -lm
|
0
|
10 PRINTF= # printf.c
|
82
|
11 CONVERTER=conv/c.o conv/null.o
|
|
12 # conv/c2cbc.o conv/cbc2c.o
|
327
|
13 COMPLIB = mc-parse.o mc-codegen.o mc-switch.o mc-macro.o mc-tree.o
|
109
|
14 # CODE=mc-code-ia32.c
|
126
|
15 CODE=mc-code-$(ARCH).c
|
93
|
16
|
130
|
17 all: mc mc-ia32 mc-powerpc mc-mips
|
94
|
18
|
126
|
19 mc: mc-$(ARCH)
|
|
20 cp mc-$(ARCH) mc
|
0
|
21
|
195
|
22 TAGS:
|
213
|
23 ctags mc-code-powerpc.c mc-code.h mc-codegen.c mc-codegen.h \
|
327
|
24 mc-macro.c \
|
297
|
25 mc-parse.c mc-tree.c mc-switch.c mc-switch.h \
|
|
26 mc.h conv/c.c conv/c.h \
|
195
|
27 conv/conv.h conv/convdef.h conv/null.c
|
|
28
|
94
|
29 mc-powerpc : mc-code-powerpc.o $(COMPLIB) $(CONVERTER)
|
|
30 $(CC) -g mc-code-powerpc.o $(COMPLIB) $(CONVERTER) -o $@
|
|
31
|
|
32 mc-ia32 : mc-code-ia32.o $(COMPLIB) $(CONVERTER)
|
|
33 $(CC) -g mc-code-ia32.o $(COMPLIB) $(CONVERTER) -o $@
|
61
|
34
|
130
|
35 mc-mips : mc-code-mips.o $(COMPLIB) $(CONVERTER)
|
|
36 $(CC) -g mc-code-mips.o $(COMPLIB) $(CONVERTER) -o $@
|
|
37
|
82
|
38 conv/conv.h: conv_func.tbl conv_func.pl
|
67
|
39 perl conv_func.pl
|
82
|
40 conv/convdef.h: conv_func.tbl conv_func.pl
|
|
41 perl conv_func.pl
|
|
42 conv/null.c: conv_func.tbl conv_func.pl
|
67
|
43 perl conv_func.pl
|
|
44
|
166
|
45 mc.h-new:
|
|
46 perl mc-h-renum.pl mc.h > mc.h.1
|
|
47 mv mc.h.1 mc.h
|
|
48
|
172
|
49 check-all: check-all-c check-all-code
|
|
50
|
|
51 check-all-c:
|
118
|
52 make check TARGET=test/basic
|
|
53 make check TARGET=test/call
|
|
54 make check TARGET=test/fact0
|
|
55 make check TARGET=test/float
|
|
56 make check TARGET=test/ifdef
|
|
57 make check TARGET=test/int
|
|
58 make check TARGET=test/macro
|
|
59 make check TARGET=test/regargs
|
172
|
60 make check TARGET=test/short
|
118
|
61 make check TARGET=test/simp
|
|
62 make check TARGET=test/simp0
|
249
|
63 make check TARGET=test/simp1
|
172
|
64 make check TARGET=test/static
|
118
|
65 make check TARGET=test/tmp
|
|
66 make check TARGET=test/tmp10
|
|
67 make check TARGET=test/tmp11
|
161
|
68 make check TARGET=test/tmp12
|
336
|
69 make check TARGET=test/tmp5
|
118
|
70 make check TARGET=test/tmp7
|
336
|
71 make check TARGET=test/tmp8
|
118
|
72 make check TARGET=test/tmp9
|
176
|
73 make check TARGET=test/enum
|
214
|
74 make check TARGET=test/obsf
|
221
|
75 make check TARGET=test/long
|
307
|
76 make check TARGET=test/tstdarg
|
311
|
77 make check TARGET=test/switch
|
310
|
78 make check TARGET=test/strinit
|
221
|
79 make check TARGET=test/code-gen-all
|
338
|
80 make check TARGET=test/bitfield
|
|
81 make check TARGET=test/bitfield1
|
353
|
82 make check TARGET=test/cext
|
366
|
83 # make check TARGET=test/scope STDFLAG="-std=gnu99"
|
172
|
84 #MK =-make
|
|
85 MK=
|
|
86 check-all-code:
|
|
87 make check-code$(MK) TARGET=test/arg
|
|
88 make check-code$(MK) TARGET=test/conv
|
|
89 make check-code$(MK) TARGET=test/conv1
|
|
90 make check-code$(MK) TARGET=test/fact-a
|
|
91 make check-code$(MK) TARGET=test/fact
|
|
92 make check-code$(MK) TARGET=test/goto
|
|
93 # make check-code$(MK) TARGET=test/test1
|
|
94 # make check-code$(MK) TARGET=test/tmp1
|
|
95 make check-code$(MK) TARGET=test/tmp2
|
|
96 make check-code$(MK) TARGET=test/tmp4
|
|
97 # make check-code$(MK) TARGET=test/tmp6
|
366
|
98 make check-code$(MK) TARGET=test/scope
|
172
|
99
|
191
|
100 check-nkf:
|
|
101 ( cd nkf203; $(CC) -g -o nkf1 nkf.c utf8tbl.c )
|
|
102 ( cd nkf203; ../mc-$(ARCH) -s nkf.c utf8tbl.c )
|
|
103 ( cd nkf203; $(CC) -g -o nkf nkf.s utf8tbl.s )
|
|
104 ( cd nkf203; perl test.pl )
|
|
105
|
224
|
106 # -./$(MC) -Itest/ -s $(TARGET).c
|
118
|
107
|
245
|
108 check: $(MC) $(TARGET).c
|
365
|
109 -gcc $(STDFLAG) $(TARGET).c -o b.out $(MLIB)
|
123
|
110 -./b.out > $(TARGET).gcc.out
|
224
|
111 -./$(MC) -s $(TARGET).c
|
127
|
112 -gcc $(TARGET).s $(MLIB)
|
123
|
113 -./a.out > $(TARGET).$(MC).out
|
225
|
114 -diff $(TARGET).gcc.out $(TARGET).$(MC).out
|
118
|
115
|
172
|
116 check-code: $(MC)
|
|
117 -./$(MC) -s $(TARGET).c
|
|
118 -gcc $(TARGET).s $(MLIB)
|
|
119 -./a.out > $(TARGET).$(MC).out
|
|
120 -diff $(TARGET).code-out $(TARGET).$(MC).out
|
|
121 check-code-make: $(MC)
|
|
122 -./$(MC) -s $(TARGET).c
|
|
123 -gcc $(TARGET).s $(MLIB)
|
|
124 -./a.out > $(TARGET).code-out
|
|
125
|
245
|
126 test/code-gen-all.c: test/code-gen.pl test/code-gen.c
|
|
127 perl test/code-gen.pl < test/code-gen.c > test/code-gen-all.c
|
|
128
|
186
|
129 tags: tags-$(ARCH)
|
|
130
|
|
131 tags-$(ARCH):
|
|
132 ctags mc.h mc-code.h mc-code-$(ARCH).c mc-codegen.c mc-codegen.h \
|
|
133 mc-parse.c mc-tree.c \
|
|
134 conv/c.c conv/c.h \
|
|
135 conv/conv.h conv/convdef.h
|
|
136
|
0
|
137 tar :
|
|
138 make clean
|
|
139 tar cBf - . | gzip > ../comp.tgz
|
|
140
|
|
141 depend :
|
67
|
142 makedepend mc-code-ia32.c mc-code.h mc-codegen.c mc-codegen.h \
|
297
|
143 mc-parse.c mc-tree.c mc-switch.c mc-switch.h mc.h \
|
328
|
144 mc-macro.c mc-macro.h mc-parse.h \
|
67
|
145 conv/c.c conv/c.h conv/c2cbc.c conv/c2cbc.h conv/cbc2c.c \
|
93
|
146 conv/cbc2c.h conv/conv.h conv/convdef.h conv/null.c conv/null.h \
|
150
|
147 mc-code-powerpc.c \
|
|
148 mc-code-mips.c
|
0
|
149
|
|
150 clean :
|
140
|
151 -rm -f mc mc-ia32 mc-powerpc mc-mips *.bak *.s *.o *.cc mc mc1 mc2 a.out *~ core* */*.o *.bak test/*.s test/*.cc test/*.o test/*.bak test/*~ conv/*.s conv/*.cc conv/*.o conv/*.bak conv/*~ *.out */*.out *.i */*.i
|
0
|
152
|
327
|
153 mc1 : b00.s b01.s mc-codegen.o mc-tree.o mc-switch.o mc-macro.o $(CONVERTER)
|
|
154 $(CC) -g -o $@ $(PRINTF) b00.s b01.s mc-codegen.o mc-tree.o mc-switch.o mc-macro.o $(CONVERTER)
|
140
|
155
|
327
|
156 mc2 : b00.s b01.s b02.s b03.s mc-macro.o $(CONVERTER)
|
|
157 $(CC) -g -o $@ $(PRINTF) b00.s b01.s b02.s b03.s b04.s mc-macro.o $(CONVERTER)
|
140
|
158
|
94
|
159 b00.s : mc-parse.c $(MC)
|
|
160 ./$(MC) -s -ob00.s mc-parse.c
|
109
|
161 b01.s : $(CODE) $(MC)
|
|
162 ./$(MC) -s -ob01.s $(CODE)
|
140
|
163 b02.s : mc-codegen.c $(MC)
|
|
164 ./$(MC) -s -ob02.s mc-codegen.c
|
|
165 b03.s : mc-tree.c $(MC)
|
|
166 ./$(MC) -s -ob03.s mc-tree.c
|
298
|
167 b04.s : mc-switch.c $(MC)
|
|
168 ./$(MC) -s -ob04.s mc-switch.c
|
140
|
169
|
0
|
170 b10.s : mc-parse.c mc1
|
65
|
171 ./mc1 -s -ob10.s mc-parse.c
|
109
|
172 b11.s : $(CODE) $(PRINTF) mc1
|
|
173 ./mc1 -s -ob11.s $(CODE)
|
140
|
174 b12.s : mc-codegen.c mc1
|
|
175 ./mc1 -s -ob12.s mc-codegen.c
|
|
176 b13.s : mc-tree.c mc1
|
|
177 ./mc1 -s -ob13.s mc-tree.c
|
298
|
178 b14.s : mc-switch.c mc1
|
|
179 ./mc1 -s -ob14.s mc-switch.c
|
0
|
180
|
140
|
181 b20.s : mc-parse.c mc2
|
|
182 ./mc2 -s -ob20.s mc-parse.c
|
|
183 b21.s : $(CODE) $(PRINTF) mc2
|
|
184 ./mc2 -s -ob21.s $(CODE)
|
|
185 b22.s : mc-codegen.c mc2
|
|
186 ./mc2 -s -ob22.s mc-codegen.c
|
|
187 b23.s : mc-tree.c mc2
|
|
188 ./mc2 -s -ob23.s mc-tree.c
|
298
|
189 b24.s : mc-switch.c mc1
|
|
190 ./mc2 -s -ob24.s mc-switch.c
|
140
|
191
|
298
|
192 diff : b00.s b01.s b02.s b03.s b04.s b10.s b11.s b12.s b13.s b14.s
|
0
|
193 -diff b00.s b10.s
|
|
194 -diff b01.s b11.s
|
140
|
195 -diff b02.s b12.s
|
|
196 -diff b03.s b13.s
|
298
|
197 -diff b04.s b14.s
|
140
|
198
|
298
|
199 diff2 : b00.s b01.s b02.s b03.s b04.s b20.s b21.s b22.s b23.s b24.s
|
140
|
200 -diff b00.s b20.s
|
|
201 -diff b01.s b21.s
|
|
202 -diff b02.s b22.s
|
|
203 -diff b03.s b23.s
|
298
|
204 -diff b04.s b24.s
|
140
|
205
|
67
|
206
|
0
|
207 # DO NOT DELETE
|
|
208
|
127
|
209 mc-code-ia32.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
210 mc-code-ia32.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
211 mc-code-ia32.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
212 mc-code-ia32.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
213 mc-code-ia32.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
225
|
214 mc-code-ia32.o: /usr/include/stdlib.h /usr/include/alloca.h conv/conv.h
|
|
215 mc-code-ia32.o: mc-codegen.h mc-code.h
|
127
|
216 mc-codegen.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
217 mc-codegen.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
218 mc-codegen.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
219 mc-codegen.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
220 mc-codegen.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
225
|
221 mc-codegen.o: /usr/include/stdlib.h /usr/include/alloca.h conv/conv.h
|
|
222 mc-codegen.o: mc-codegen.h mc-code.h
|
127
|
223 mc-parse.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
224 mc-parse.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
225 mc-parse.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
226 mc-parse.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
227 mc-parse.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
225
|
228 mc-parse.o: /usr/include/stdlib.h /usr/include/alloca.h conv/conv.h
|
298
|
229 mc-parse.o: mc-codegen.h mc-switch.h
|
127
|
230 mc-tree.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
231 mc-tree.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
232 mc-tree.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
233 mc-tree.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
234 mc-tree.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
225
|
235 mc-tree.o: /usr/include/stdlib.h /usr/include/alloca.h conv/conv.h
|
298
|
236 mc-switch.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
237 mc-switch.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
238 mc-switch.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
239 mc-switch.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
240 mc-switch.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
|
241 mc-switch.o: /usr/include/stdlib.h /usr/include/alloca.h conv/conv.h
|
|
242 mc-switch.o: mc-code.h mc-codegen.h
|
127
|
243 mc.o: /usr/include/stdio.h /usr/include/sys/types.h
|
|
244 mc.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
245 mc.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
246 mc.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
225
|
247 mc.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
|
248 mc.o: /usr/include/stdlib.h /usr/include/alloca.h conv/conv.h
|
127
|
249 conv/c.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
250 conv/c.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
251 conv/c.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
252 conv/c.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
225
|
253 conv/c.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
|
254 conv/c.o: /usr/include/stdlib.h /usr/include/alloca.h conv/conv.h
|
127
|
255 conv/c.o: conv/convdef.h conv/c.h
|
|
256 conv/c2cbc.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
257 conv/c2cbc.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
258 conv/c2cbc.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
259 conv/c2cbc.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
260 conv/c2cbc.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
225
|
261 conv/c2cbc.o: /usr/include/stdlib.h /usr/include/alloca.h conv/conv.h
|
127
|
262 conv/cbc2c.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
263 conv/cbc2c.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
264 conv/cbc2c.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
265 conv/cbc2c.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
266 conv/cbc2c.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
225
|
267 conv/cbc2c.o: /usr/include/stdlib.h /usr/include/alloca.h conv/conv.h
|
127
|
268 conv/null.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
269 conv/null.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
270 conv/null.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
271 conv/null.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
272 conv/null.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
225
|
273 conv/null.o: /usr/include/stdlib.h /usr/include/alloca.h conv/conv.h
|
|
274 conv/null.o: conv/convdef.h conv/null.h
|
127
|
275 mc-code-powerpc.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
276 mc-code-powerpc.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
277 mc-code-powerpc.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
278 mc-code-powerpc.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
279 mc-code-powerpc.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
225
|
280 mc-code-powerpc.o: /usr/include/stdlib.h /usr/include/alloca.h conv/conv.h
|
|
281 mc-code-powerpc.o: mc-code.h mc-codegen.h
|
150
|
282 mc-code-mips.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
283 mc-code-mips.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
284 mc-code-mips.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
285 mc-code-mips.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
286 mc-code-mips.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
225
|
287 mc-code-mips.o: /usr/include/stdlib.h /usr/include/alloca.h conv/conv.h
|
|
288 mc-code-mips.o: mc-code.h mc-codegen.h
|