Mercurial > hg > CbC > old > device
annotate Makefile @ 672:3f559c67bc86
*** empty log message ***
author | kono |
---|---|
date | Sat, 05 May 2007 03:39:29 +0900 |
parents | 1530b1a636ac |
children | 5e71527f9fd6 |
rev | line source |
---|---|
664 | 1 # CC = gcc -std=c99 |
2 CC = cc | |
3 # -O3 | |
668 | 4 CFLAGS = -g -O -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 | |
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 |
666 | 26 all: mc |
94 | 27 |
666 | 28 mc: mc-$(ARCH) |
126 | 29 cp mc-$(ARCH) mc |
0 | 30 |
195 | 31 TAGS: |
664 | 32 ctags mc-code-powerpc.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 | |
666 | 39 mc-powerpc :mc-include.c mc-code-powerpc.o $(COMPLIB) $(CONVERTER) |
440 | 40 $(CC) $(LDFLAGS) -g mc-code-powerpc.o $(COMPLIB) $(CONVERTER) -o $@ |
94 | 41 |
666 | 42 mc-ia32 :mc-include.c mc-code-ia32.o $(COMPLIB) $(CONVERTER) |
440 | 43 $(CC) $(LDFLAGS) -g mc-code-ia32.o $(COMPLIB) $(CONVERTER) -o $@ |
61 | 44 |
666 | 45 mc-mips :mc-include.c mc-code-mips.o $(COMPLIB) $(CONVERTER) |
440 | 46 $(CC) $(LDFLAGS) -g mc-code-mips.o $(COMPLIB) $(CONVERTER) -o $@ |
130 | 47 |
666 | 48 mc-arm :mc-include.c mc-code-arm.o $(COMPLIB) $(CONVERTER) |
440 | 49 $(CC) $(LDFLAGS) -g mc-code-arm.o $(COMPLIB) $(CONVERTER) -o $@ |
383 | 50 |
666 | 51 mc-spu :mc-include.c mc-code-spu.o $(COMPLIB) $(CONVERTER) |
52 $(CC) $(LDFLAGS) -g mc-code-spu.o $(COMPLIB) $(CONVERTER) -o $@ | |
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 |
615 | 61 mc-include.c: |
62 perl tools/find-gcc-include-path -l $(CC) > mc-include.c | |
63 | |
166 | 64 mc.h-new: |
466 | 65 perl tools/mc-h-renum.pl mc.h > mc.h.1 |
166 | 66 mv mc.h.1 mc.h |
67 | |
172 | 68 check-all: check-all-c check-all-code |
69 | |
70 check-all-c: | |
118 | 71 make check TARGET=test/basic |
550 | 72 make check-inline TARGET=test/basic |
118 | 73 make check TARGET=test/call |
74 make check TARGET=test/fact0 | |
75 make check TARGET=test/float | |
76 make check TARGET=test/ifdef | |
77 make check TARGET=test/int | |
78 make check TARGET=test/macro | |
79 make check TARGET=test/regargs | |
172 | 80 make check TARGET=test/short |
118 | 81 make check TARGET=test/simp |
82 make check TARGET=test/simp0 | |
249 | 83 make check TARGET=test/simp1 |
172 | 84 make check TARGET=test/static |
118 | 85 make check TARGET=test/tmp |
86 make check TARGET=test/tmp10 | |
87 make check TARGET=test/tmp11 | |
161 | 88 make check TARGET=test/tmp12 |
336 | 89 make check TARGET=test/tmp5 |
118 | 90 make check TARGET=test/tmp7 |
664 | 91 make check TARGET=test/tmp8 |
118 | 92 make check TARGET=test/tmp9 |
176 | 93 make check TARGET=test/enum |
214 | 94 make check TARGET=test/obsf |
444 | 95 make check TARGET=test/obsf2 |
221 | 96 make check TARGET=test/long |
307 | 97 make check TARGET=test/tstdarg |
311 | 98 make check TARGET=test/switch |
310 | 99 make check TARGET=test/strinit |
221 | 100 make check TARGET=test/code-gen-all |
550 | 101 make check-inline TARGET=test/code-gen-all |
338 | 102 make check TARGET=test/bitfield |
103 make check 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 |
110 make check TARGET=test/multi | |
366 | 111 # make check TARGET=test/scope STDFLAG="-std=gnu99" |
550 | 112 # make check-inline TARGET=test/scope STDFLAG="-std=gnu99" |
172 | 113 #MK =-make |
114 MK= | |
115 check-all-code: | |
116 make check-code$(MK) TARGET=test/arg | |
117 make check-code$(MK) TARGET=test/conv | |
118 make check-code$(MK) TARGET=test/conv1 | |
119 make check-code$(MK) TARGET=test/fact-a | |
120 make check-code$(MK) TARGET=test/fact | |
121 make check-code$(MK) TARGET=test/goto | |
449 | 122 make check-code$(MK) TARGET=test/test1 |
664 | 123 make check-code$(MK) TARGET=test/test2 |
477 | 124 make check-code$(MK) TARGET=test/tmpa |
449 | 125 make check-code$(MK) TARGET=test/tmp1 |
172 | 126 make check-code$(MK) TARGET=test/tmp2 |
127 make check-code$(MK) TARGET=test/tmp4 | |
449 | 128 make check-code$(MK) TARGET=test/tmp6 |
664 | 129 make check-code$(MK) TARGET=test/tmpb |
366 | 130 make check-code$(MK) TARGET=test/scope |
581 | 131 make check-code$(MK) TARGET=test/throw |
545 | 132 make check-code$(MK) TARGET=test/too-long-argument |
172 | 133 |
191 | 134 check-nkf: |
135 ( cd nkf203; $(CC) -g -o nkf1 nkf.c utf8tbl.c ) | |
136 ( cd nkf203; ../mc-$(ARCH) -s nkf.c utf8tbl.c ) | |
137 ( cd nkf203; $(CC) -g -o nkf nkf.s utf8tbl.s ) | |
138 ( cd nkf203; perl test.pl ) | |
139 | |
224 | 140 # -./$(MC) -Itest/ -s $(TARGET).c |
118 | 141 |
551 | 142 check: mc $(MC) $(TARGET).c |
466 | 143 -$(CC) $(CFLAGS1) $(STDFLAG) $(TARGET).c -o b.out $(MLIB) |
123 | 144 -./b.out > $(TARGET).gcc.out |
664 | 145 -./$(MC) -s $(TARGET).c |
466 | 146 -$(CC) $(TARGET).s $(MLIB) |
123 | 147 -./a.out > $(TARGET).$(MC).out |
225 | 148 -diff $(TARGET).gcc.out $(TARGET).$(MC).out |
118 | 149 |
551 | 150 check-inline: mc $(MC) $(TARGET).c |
550 | 151 -$(CC) $(CFLAGS1) $(STDFLAG) $(TARGET).c -o b.out $(MLIB) |
152 -./b.out > $(TARGET).gcc.out | |
664 | 153 -./$(MC) -s -DINLINE=inline $(TARGET).c |
550 | 154 -$(CC) $(TARGET).s $(MLIB) |
155 -./a.out > $(TARGET).$(MC).out | |
156 -diff $(TARGET).gcc.out $(TARGET).$(MC).out | |
157 | |
551 | 158 check-code: mc $(MC) |
664 | 159 -./$(MC) -s $(TARGET).c |
466 | 160 -$(CC) $(TARGET).s $(MLIB) |
172 | 161 -./a.out > $(TARGET).$(MC).out |
162 -diff $(TARGET).code-out $(TARGET).$(MC).out | |
551 | 163 check-code-make: mc $(MC) |
664 | 164 -./$(MC) -s $(TARGET).c |
466 | 165 -$(CC) $(TARGET).s $(MLIB) |
172 | 166 -./a.out > $(TARGET).code-out |
167 | |
245 | 168 test/code-gen-all.c: test/code-gen.pl test/code-gen.c |
169 perl test/code-gen.pl < test/code-gen.c > test/code-gen-all.c | |
170 | |
491 | 171 incpri: |
172 perl tools/incpri.pl test/*.c | |
173 | |
186 | 174 tags: tags-$(ARCH) |
175 | |
176 tags-$(ARCH): | |
177 ctags mc.h mc-code.h mc-code-$(ARCH).c mc-codegen.c mc-codegen.h \ | |
178 mc-parse.c mc-tree.c \ | |
179 conv/c.c conv/c.h \ | |
180 conv/conv.h conv/convdef.h | |
181 | |
0 | 182 tar : |
183 make clean | |
184 tar cBf - . | gzip > ../comp.tgz | |
185 | |
664 | 186 depend : mc.h mc-include.c |
615 | 187 makedepend -I$(GCC_INCLUDE) mc-code-ia32.c mc-code.h mc-codegen.c mc-codegen.h \ |
664 | 188 mc-parse.c mc-tree.c mc-switch.c mc-switch.h mc.h \ |
189 mc-inline.c mc-macro.c mc-macro.h mc-parse.h \ | |
67 | 190 conv/c.c conv/c.h conv/c2cbc.c conv/c2cbc.h conv/cbc2c.c \ |
93 | 191 conv/cbc2c.h conv/conv.h conv/convdef.h conv/null.c conv/null.h \ |
664 | 192 mc-code-arm.c \ |
193 mc-code-powerpc.c \ | |
194 mc-code-mips.c | |
0 | 195 |
196 clean : | |
664 | 197 -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 mc-include.c |
0 | 198 |
453 | 199 mc1 : b00.s b01.s mc-codegen.o mc-tree.o mc-switch.o mc-macro.o mc-inline.o $(CONVERTER) |
200 $(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 | 201 |
453 | 202 mc2 : b00.s b01.s b02.s b03.s mc-macro.o mc-inline.o $(CONVERTER) |
203 $(CC) -g -o $@ $(PRINTF) b00.s b01.s b02.s b03.s b04.s mc-macro.o mc-inline.o $(CONVERTER) | |
140 | 204 |
94 | 205 b00.s : mc-parse.c $(MC) |
206 ./$(MC) -s -ob00.s mc-parse.c | |
109 | 207 b01.s : $(CODE) $(MC) |
208 ./$(MC) -s -ob01.s $(CODE) | |
140 | 209 b02.s : mc-codegen.c $(MC) |
210 ./$(MC) -s -ob02.s mc-codegen.c | |
211 b03.s : mc-tree.c $(MC) | |
212 ./$(MC) -s -ob03.s mc-tree.c | |
298 | 213 b04.s : mc-switch.c $(MC) |
214 ./$(MC) -s -ob04.s mc-switch.c | |
140 | 215 |
0 | 216 b10.s : mc-parse.c mc1 |
65 | 217 ./mc1 -s -ob10.s mc-parse.c |
109 | 218 b11.s : $(CODE) $(PRINTF) mc1 |
219 ./mc1 -s -ob11.s $(CODE) | |
140 | 220 b12.s : mc-codegen.c mc1 |
221 ./mc1 -s -ob12.s mc-codegen.c | |
222 b13.s : mc-tree.c mc1 | |
223 ./mc1 -s -ob13.s mc-tree.c | |
298 | 224 b14.s : mc-switch.c mc1 |
225 ./mc1 -s -ob14.s mc-switch.c | |
0 | 226 |
140 | 227 b20.s : mc-parse.c mc2 |
228 ./mc2 -s -ob20.s mc-parse.c | |
229 b21.s : $(CODE) $(PRINTF) mc2 | |
230 ./mc2 -s -ob21.s $(CODE) | |
231 b22.s : mc-codegen.c mc2 | |
232 ./mc2 -s -ob22.s mc-codegen.c | |
233 b23.s : mc-tree.c mc2 | |
234 ./mc2 -s -ob23.s mc-tree.c | |
298 | 235 b24.s : mc-switch.c mc1 |
236 ./mc2 -s -ob24.s mc-switch.c | |
140 | 237 |
298 | 238 diff : b00.s b01.s b02.s b03.s b04.s b10.s b11.s b12.s b13.s b14.s |
0 | 239 -diff b00.s b10.s |
240 -diff b01.s b11.s | |
140 | 241 -diff b02.s b12.s |
242 -diff b03.s b13.s | |
298 | 243 -diff b04.s b14.s |
140 | 244 |
298 | 245 diff2 : b00.s b01.s b02.s b03.s b04.s b20.s b21.s b22.s b23.s b24.s |
140 | 246 -diff b00.s b20.s |
247 -diff b01.s b21.s | |
248 -diff b02.s b22.s | |
249 -diff b03.s b23.s | |
298 | 250 -diff b04.s b24.s |
140 | 251 |
67 | 252 |
0 | 253 # DO NOT DELETE |
254 |