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