Mercurial > hg > CbC > old > device
annotate Makefile @ 655:cddab906095e
struct init in function arg (or other expression).
author | kono |
---|---|
date | Sun, 14 Jan 2007 20:30:31 +0900 |
parents | c9a489ac3fc7 |
children | 8320ae3ac186 |
rev | line source |
---|---|
571 | 1 CC = gcc -std=c99 |
2 # -O2 | |
569 | 3 # -O99 |
609 | 4 CFLAGS = -g -Wall -I. -DUSE_CODE_KEYWORD |
440 | 5 # CFLAGS = -g -Wall -I. -pg -fprofile-arcs -ftest-coverage |
6 # LDFLAGS = -pg | |
407 | 7 # for Linux Zaurus |
8 # CFLAGS = -fsigned-char -pipe -g -I. -I/home/zaurus/develop/include | |
609 | 9 CFLAGS1 = -g -I. -DUSE_CODE_KEYWORD |
0 | 10 BASE=0 |
11 STAGE=1 | |
12 MFLAGS=$(MFALGS) BASE=$(BASE) STAGE=$(STAGE) | |
126 | 13 ARCH=powerpc |
14 MC=mc-$(ARCH) | |
561 | 15 MLIB = -lm |
0 | 16 PRINTF= # printf.c |
609 | 17 CONVERTER=conv/c.o conv/null.o conv/cbc2c.o conv/c2cbc.o |
18 | |
19 # conv/c2cbc.o conv/cbc2c.o | |
453 | 20 COMPLIB = mc-parse.o mc-codegen.o mc-switch.o mc-macro.o mc-tree.o mc-inline.o |
109 | 21 # CODE=mc-code-ia32.c |
126 | 22 CODE=mc-code-$(ARCH).c |
615 | 23 GCC_INCLUDE=`perl tools/find-gcc-include-path -p $(CC)` |
24 | |
420 | 25 # |
26 TARGET=test/simp | |
93 | 27 |
651 | 28 all: mc-include.c mc |
29 | |
30 allall: mc-include.c mc mc-ia32 mc-powerpc mc-mips mc-arm | |
94 | 31 |
126 | 32 mc: mc-$(ARCH) |
33 cp mc-$(ARCH) mc | |
0 | 34 |
195 | 35 TAGS: |
609 | 36 ctags mc-code-null.c mc-code.h mc-codegen.c mc-codegen.h \ |
327 | 37 mc-macro.c \ |
297 | 38 mc-parse.c mc-tree.c mc-switch.c mc-switch.h \ |
39 mc.h conv/c.c conv/c.h \ | |
453 | 40 mc-inline.h mc-inline.c \ |
195 | 41 conv/conv.h conv/convdef.h conv/null.c |
42 | |
609 | 43 mc-null : mc-code-null.o $(COMPLIB) $(CONVERTER) |
44 $(CC) $(LDFLAGS) -g mc-code-null.o $(COMPLIB) $(CONVERTER) -o $@ | |
45 | |
94 | 46 mc-powerpc : mc-code-powerpc.o $(COMPLIB) $(CONVERTER) |
440 | 47 $(CC) $(LDFLAGS) -g mc-code-powerpc.o $(COMPLIB) $(CONVERTER) -o $@ |
94 | 48 |
49 mc-ia32 : mc-code-ia32.o $(COMPLIB) $(CONVERTER) | |
440 | 50 $(CC) $(LDFLAGS) -g mc-code-ia32.o $(COMPLIB) $(CONVERTER) -o $@ |
61 | 51 |
130 | 52 mc-mips : mc-code-mips.o $(COMPLIB) $(CONVERTER) |
440 | 53 $(CC) $(LDFLAGS) -g mc-code-mips.o $(COMPLIB) $(CONVERTER) -o $@ |
130 | 54 |
383 | 55 mc-arm : mc-code-arm.o $(COMPLIB) $(CONVERTER) |
440 | 56 $(CC) $(LDFLAGS) -g mc-code-arm.o $(COMPLIB) $(CONVERTER) -o $@ |
383 | 57 |
466 | 58 conv/conv.h: conv_func.tbl tools/conv_func.pl |
59 perl tools/conv_func.pl | |
60 conv/convdef.h: conv_func.tbl tools/conv_func.pl | |
61 perl tools/conv_func.pl | |
62 conv/null.c: conv_func.tbl tools/conv_func.pl | |
63 perl tools/conv_func.pl | |
67 | 64 |
615 | 65 mc-include.c: |
66 perl tools/find-gcc-include-path -l $(CC) > mc-include.c | |
67 | |
166 | 68 mc.h-new: |
466 | 69 perl tools/mc-h-renum.pl mc.h > mc.h.1 |
166 | 70 mv mc.h.1 mc.h |
71 | |
172 | 72 check-all: check-all-c check-all-code |
73 | |
74 check-all-c: | |
118 | 75 make check TARGET=test/basic |
550 | 76 make check-inline TARGET=test/basic |
118 | 77 make check TARGET=test/call |
78 make check TARGET=test/fact0 | |
79 make check TARGET=test/float | |
80 make check TARGET=test/ifdef | |
81 make check TARGET=test/int | |
82 make check TARGET=test/macro | |
83 make check TARGET=test/regargs | |
172 | 84 make check TARGET=test/short |
118 | 85 make check TARGET=test/simp |
86 make check TARGET=test/simp0 | |
249 | 87 make check TARGET=test/simp1 |
172 | 88 make check TARGET=test/static |
118 | 89 make check TARGET=test/tmp |
90 make check TARGET=test/tmp10 | |
91 make check TARGET=test/tmp11 | |
161 | 92 make check TARGET=test/tmp12 |
336 | 93 make check TARGET=test/tmp5 |
118 | 94 make check TARGET=test/tmp7 |
575 | 95 make check-inline TARGET=test/tmp8 |
118 | 96 make check TARGET=test/tmp9 |
176 | 97 make check TARGET=test/enum |
214 | 98 make check TARGET=test/obsf |
444 | 99 make check TARGET=test/obsf2 |
221 | 100 make check TARGET=test/long |
307 | 101 make check TARGET=test/tstdarg |
311 | 102 make check TARGET=test/switch |
310 | 103 make check TARGET=test/strinit |
221 | 104 make check TARGET=test/code-gen-all |
550 | 105 make check-inline TARGET=test/code-gen-all |
338 | 106 make check TARGET=test/bitfield |
107 make check TARGET=test/bitfield1 | |
556 | 108 make check-inline TARGET=test/bitfield1 |
353 | 109 make check TARGET=test/cext |
400 | 110 make check TARGET=test/const |
438
626d705471d5
Unexecuted code in conditional. Lazy jmp code generation.
kono
parents:
420
diff
changeset
|
111 make check TARGET=test/void_code |
494 | 112 make check TARGET=test/putenemy |
453 | 113 make check TARGET=test/inline |
556 | 114 make check TARGET=test/offset |
640 | 115 make check TARGET=test/ps2 |
116 make check TARGET=test/multi | |
366 | 117 # make check TARGET=test/scope STDFLAG="-std=gnu99" |
550 | 118 # make check-inline TARGET=test/scope STDFLAG="-std=gnu99" |
172 | 119 #MK =-make |
120 MK= | |
121 check-all-code: | |
122 make check-code$(MK) TARGET=test/arg | |
123 make check-code$(MK) TARGET=test/conv | |
124 make check-code$(MK) TARGET=test/conv1 | |
125 make check-code$(MK) TARGET=test/fact-a | |
126 make check-code$(MK) TARGET=test/fact | |
127 make check-code$(MK) TARGET=test/goto | |
449 | 128 make check-code$(MK) TARGET=test/test1 |
477 | 129 make check-code$(MK) TARGET=test/tmpa |
449 | 130 make check-code$(MK) TARGET=test/tmp1 |
172 | 131 make check-code$(MK) TARGET=test/tmp2 |
132 make check-code$(MK) TARGET=test/tmp4 | |
449 | 133 make check-code$(MK) TARGET=test/tmp6 |
366 | 134 make check-code$(MK) TARGET=test/scope |
581 | 135 make check-code$(MK) TARGET=test/throw |
604 | 136 make check-code$(MK) TARGET=test/test2 |
545 | 137 make check-code$(MK) TARGET=test/too-long-argument |
172 | 138 |
191 | 139 check-nkf: |
140 ( cd nkf203; $(CC) -g -o nkf1 nkf.c utf8tbl.c ) | |
141 ( cd nkf203; ../mc-$(ARCH) -s nkf.c utf8tbl.c ) | |
142 ( cd nkf203; $(CC) -g -o nkf nkf.s utf8tbl.s ) | |
143 ( cd nkf203; perl test.pl ) | |
144 | |
224 | 145 # -./$(MC) -Itest/ -s $(TARGET).c |
118 | 146 |
551 | 147 check: mc $(MC) $(TARGET).c |
466 | 148 -$(CC) $(CFLAGS1) $(STDFLAG) $(TARGET).c -o b.out $(MLIB) |
123 | 149 -./b.out > $(TARGET).gcc.out |
609 | 150 -./$(MC) -s $(TARGET).c |
466 | 151 -$(CC) $(TARGET).s $(MLIB) |
123 | 152 -./a.out > $(TARGET).$(MC).out |
225 | 153 -diff $(TARGET).gcc.out $(TARGET).$(MC).out |
118 | 154 |
551 | 155 check-inline: mc $(MC) $(TARGET).c |
550 | 156 -$(CC) $(CFLAGS1) $(STDFLAG) $(TARGET).c -o b.out $(MLIB) |
157 -./b.out > $(TARGET).gcc.out | |
609 | 158 -./$(MC) -s -DINLINE=inline $(TARGET).c |
550 | 159 -$(CC) $(TARGET).s $(MLIB) |
160 -./a.out > $(TARGET).$(MC).out | |
161 -diff $(TARGET).gcc.out $(TARGET).$(MC).out | |
162 | |
551 | 163 check-code: mc $(MC) |
609 | 164 -./$(MC) -s $(TARGET).c |
466 | 165 -$(CC) $(TARGET).s $(MLIB) |
172 | 166 -./a.out > $(TARGET).$(MC).out |
167 -diff $(TARGET).code-out $(TARGET).$(MC).out | |
551 | 168 check-code-make: mc $(MC) |
609 | 169 -./$(MC) -s $(TARGET).c |
466 | 170 -$(CC) $(TARGET).s $(MLIB) |
172 | 171 -./a.out > $(TARGET).code-out |
172 | |
245 | 173 test/code-gen-all.c: test/code-gen.pl test/code-gen.c |
174 perl test/code-gen.pl < test/code-gen.c > test/code-gen-all.c | |
175 | |
491 | 176 incpri: |
177 perl tools/incpri.pl test/*.c | |
178 | |
186 | 179 tags: tags-$(ARCH) |
180 | |
181 tags-$(ARCH): | |
182 ctags mc.h mc-code.h mc-code-$(ARCH).c mc-codegen.c mc-codegen.h \ | |
183 mc-parse.c mc-tree.c \ | |
184 conv/c.c conv/c.h \ | |
185 conv/conv.h conv/convdef.h | |
186 | |
0 | 187 tar : |
188 make clean | |
189 tar cBf - . | gzip > ../comp.tgz | |
190 | |
615 | 191 depend : mc.h mc-include.c conv/conv.h |
192 makedepend -I$(GCC_INCLUDE) mc-code-ia32.c mc-code.h mc-codegen.c mc-codegen.h \ | |
193 mc-parse.c mc-tree.c mc-switch.c mc-switch.h mc.h \ | |
194 mc-inline.c mc-macro.c mc-macro.h mc-parse.h \ | |
67 | 195 conv/c.c conv/c.h conv/c2cbc.c conv/c2cbc.h conv/cbc2c.c \ |
93 | 196 conv/cbc2c.h conv/conv.h conv/convdef.h conv/null.c conv/null.h \ |
615 | 197 mc-code-arm.c \ |
198 mc-code-powerpc.c \ | |
199 mc-code-mips.c | |
0 | 200 |
201 clean : | |
644 | 202 -rm -f mc mc-null mc-ia32 mc-powerpc mc-mips mc-arm *.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 *.cbc.? */*.cbc.? mc-include.h |
609 | 203 -rm -f *.tsv ../test/*.tsv ../test/sample/*.tsv |
0 | 204 |
453 | 205 mc1 : b00.s b01.s mc-codegen.o mc-tree.o mc-switch.o mc-macro.o mc-inline.o $(CONVERTER) |
206 $(CC) -g -o $@ $(PRINTF) b00.s b01.s mc-codegen.o mc-tree.o mc-switch.o mc-macro.o mc-inline.o $(CONVERTER) | |
140 | 207 |
453 | 208 mc2 : b00.s b01.s b02.s b03.s mc-macro.o mc-inline.o $(CONVERTER) |
209 $(CC) -g -o $@ $(PRINTF) b00.s b01.s b02.s b03.s b04.s mc-macro.o mc-inline.o $(CONVERTER) | |
140 | 210 |
94 | 211 b00.s : mc-parse.c $(MC) |
212 ./$(MC) -s -ob00.s mc-parse.c | |
109 | 213 b01.s : $(CODE) $(MC) |
214 ./$(MC) -s -ob01.s $(CODE) | |
140 | 215 b02.s : mc-codegen.c $(MC) |
216 ./$(MC) -s -ob02.s mc-codegen.c | |
217 b03.s : mc-tree.c $(MC) | |
218 ./$(MC) -s -ob03.s mc-tree.c | |
298 | 219 b04.s : mc-switch.c $(MC) |
220 ./$(MC) -s -ob04.s mc-switch.c | |
140 | 221 |
0 | 222 b10.s : mc-parse.c mc1 |
65 | 223 ./mc1 -s -ob10.s mc-parse.c |
109 | 224 b11.s : $(CODE) $(PRINTF) mc1 |
225 ./mc1 -s -ob11.s $(CODE) | |
140 | 226 b12.s : mc-codegen.c mc1 |
227 ./mc1 -s -ob12.s mc-codegen.c | |
228 b13.s : mc-tree.c mc1 | |
229 ./mc1 -s -ob13.s mc-tree.c | |
298 | 230 b14.s : mc-switch.c mc1 |
231 ./mc1 -s -ob14.s mc-switch.c | |
0 | 232 |
140 | 233 b20.s : mc-parse.c mc2 |
234 ./mc2 -s -ob20.s mc-parse.c | |
235 b21.s : $(CODE) $(PRINTF) mc2 | |
236 ./mc2 -s -ob21.s $(CODE) | |
237 b22.s : mc-codegen.c mc2 | |
238 ./mc2 -s -ob22.s mc-codegen.c | |
239 b23.s : mc-tree.c mc2 | |
240 ./mc2 -s -ob23.s mc-tree.c | |
298 | 241 b24.s : mc-switch.c mc1 |
242 ./mc2 -s -ob24.s mc-switch.c | |
140 | 243 |
298 | 244 diff : b00.s b01.s b02.s b03.s b04.s b10.s b11.s b12.s b13.s b14.s |
0 | 245 -diff b00.s b10.s |
246 -diff b01.s b11.s | |
140 | 247 -diff b02.s b12.s |
248 -diff b03.s b13.s | |
298 | 249 -diff b04.s b14.s |
140 | 250 |
298 | 251 diff2 : b00.s b01.s b02.s b03.s b04.s b20.s b21.s b22.s b23.s b24.s |
140 | 252 -diff b00.s b20.s |
253 -diff b01.s b21.s | |
254 -diff b02.s b22.s | |
255 -diff b03.s b23.s | |
298 | 256 -diff b04.s b24.s |
140 | 257 |
67 | 258 |
0 | 259 # DO NOT DELETE |
260 | |
466 | 261 mc-code-ia32.o: /usr/include/stdio.h /usr/include/_types.h |
262 mc-code-ia32.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h | |
263 mc-code-ia32.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h mc.h | |
615 | 264 mc-code-ia32.o: mc-parse.h mc-codegen.h mc-code.h mc-include.c |
466 | 265 mc-codegen.o: /usr/include/stdio.h /usr/include/_types.h |
266 mc-codegen.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h | |
267 mc-codegen.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h mc.h | |
268 mc-codegen.o: mc-parse.h mc-codegen.h mc-code.h mc-switch.h mc-inline.h | |
609 | 269 mc-codegen.o: conv/conv.h |
466 | 270 mc-parse.o: /usr/include/stdio.h /usr/include/_types.h |
271 mc-parse.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h | |
272 mc-parse.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h mc.h | |
273 mc-parse.o: mc-parse.h mc-codegen.h mc-switch.h mc-macro.h mc-inline.h | |
274 mc-parse.o: conv/conv.h | |
275 mc-tree.o: /usr/include/stdio.h /usr/include/_types.h | |
276 mc-tree.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h | |
277 mc-tree.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h mc.h | |
599 | 278 mc-tree.o: mc-parse.h mc-codegen.h |
466 | 279 mc-switch.o: /usr/include/stdio.h /usr/include/_types.h |
280 mc-switch.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h | |
281 mc-switch.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h mc.h | |
387 | 282 mc-switch.o: mc-parse.h mc-codegen.h mc-code.h |
615 | 283 mc-inline.o: /usr/include/stdio.h /usr/include/_types.h |
284 mc-inline.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h | |
285 mc-inline.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h mc.h | |
286 mc-inline.o: mc-parse.h mc-codegen.h mc-switch.h mc-code.h mc-inline.h | |
466 | 287 mc-macro.o: /usr/include/stdio.h /usr/include/_types.h |
288 mc-macro.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h | |
289 mc-macro.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h mc.h | |
290 mc-macro.o: mc-parse.h mc-macro.h mc-codegen.h mc-code.h | |
291 conv/c.o: /usr/include/stdio.h /usr/include/_types.h | |
292 conv/c.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h | |
293 conv/c.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h mc.h | |
599 | 294 conv/c.o: mc-parse.h mc-codegen.h conv/conv.h conv/convdef.h conv/c.h |
596 | 295 conv/c2cbc.o: /usr/include/stdio.h /usr/include/_types.h |
296 conv/c2cbc.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h | |
297 conv/c2cbc.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h mc.h | |
599 | 298 conv/c2cbc.o: mc-parse.h mc-codegen.h conv/conv.h conv/convdef.h conv/c2cbc.h |
299 conv/cbc2c.o: /usr/include/stdio.h /usr/include/_types.h | |
300 conv/cbc2c.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h | |
301 conv/cbc2c.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h mc.h | |
302 conv/cbc2c.o: mc-parse.h mc-codegen.h conv/conv.h conv/convdef.h conv/cbc2c.h | |
466 | 303 conv/null.o: /usr/include/stdio.h /usr/include/_types.h |
304 conv/null.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h | |
305 conv/null.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h mc.h | |
387 | 306 conv/null.o: mc-parse.h conv/conv.h conv/convdef.h conv/null.h |
602 | 307 mc-code-arm.o: /usr/include/stdio.h /usr/include/_types.h |
308 mc-code-arm.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h | |
309 mc-code-arm.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h mc.h | |
310 mc-code-arm.o: mc-parse.h mc-code.h mc-codegen.h | |
615 | 311 mc-code-powerpc.o: /usr/include/stdio.h /usr/include/_types.h |
312 mc-code-powerpc.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h | |
313 mc-code-powerpc.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h | |
314 mc-code-powerpc.o: mc.h mc-parse.h mc-code.h mc-codegen.h mc-include.c | |
466 | 315 mc-code-mips.o: /usr/include/stdio.h /usr/include/_types.h |
316 mc-code-mips.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h | |
317 mc-code-mips.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h mc.h | |
387 | 318 mc-code-mips.o: mc-parse.h mc-code.h mc-codegen.h |