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