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