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