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