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