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