Mercurial > hg > CbC > old > device
annotate Makefile.powerpc @ 922:3cdc3c1d83bd
macro try ...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 11 Apr 2014 19:41:24 +0900 |
parents | 2e6a95731a5e |
children |
rev | line source |
---|---|
708 | 1 CC = gcc -std=c99 $(CCEXT) |
2 # -O3 | |
824 | 3 MCFLAG = -DUSE_CODE_KEYWORD |
4 CFLAGS = -g -O -Wall -I. $(MCFLAG) | |
581 | 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 | |
708 | 9 CFLAGS1 = -g -I. |
581 | 10 BASE=0 |
11 STAGE=1 | |
12 MFLAGS=$(MFALGS) BASE=$(BASE) STAGE=$(STAGE) | |
13 ARCH=powerpc | |
14 MC=mc-$(ARCH) | |
15 MLIB = -lm | |
16 PRINTF= # printf.c | |
708 | 17 CONVERTER=conv/c.o conv/null.o conv/c2cbc.o conv/cbc2c.o |
581 | 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)` |
708 | 22 # |
581 | 23 # |
24 TARGET=test/simp | |
25 | |
708 | 26 all: mc tags |
656 | 27 |
708 | 28 ppc: |
29 make ARCH=powerpc CCEXT="-arch ppc" check-all | |
581 | 30 |
708 | 31 mc: mc-$(ARCH) |
581 | 32 cp mc-$(ARCH) mc |
33 | |
34 TAGS: | |
708 | 35 ctags mc-code-*.c mc-code.h mc-codegen.c mc-codegen.h \ |
581 | 36 mc-macro.c \ |
37 mc-parse.c mc-tree.c mc-switch.c mc-switch.h \ | |
38 mc.h conv/c.c conv/c.h \ | |
39 mc-inline.h mc-inline.c \ | |
40 conv/conv.h conv/convdef.h conv/null.c | |
41 | |
708 | 42 mc-powerpc :conv/conv.h mc-include.c mc-code-powerpc.o $(COMPLIB) $(CONVERTER) |
581 | 43 $(CC) $(LDFLAGS) -g mc-code-powerpc.o $(COMPLIB) $(CONVERTER) -o $@ |
44 | |
708 | 45 mc-ia32 :conv/conv.h mc-include.c mc-code-ia32.o $(COMPLIB) $(CONVERTER) |
581 | 46 $(CC) $(LDFLAGS) -g mc-code-ia32.o $(COMPLIB) $(CONVERTER) -o $@ |
47 | |
708 | 48 mc-mips :conv/conv.h mc-include.c mc-code-mips.o $(COMPLIB) $(CONVERTER) |
581 | 49 $(CC) $(LDFLAGS) -g mc-code-mips.o $(COMPLIB) $(CONVERTER) -o $@ |
50 | |
708 | 51 mc-arm :conv/conv.h mc-include.c mc-code-arm.o $(COMPLIB) $(CONVERTER) |
581 | 52 $(CC) $(LDFLAGS) -g mc-code-arm.o $(COMPLIB) $(CONVERTER) -o $@ |
53 | |
708 | 54 mc-spu :conv/conv.h mc-include.c mc-code-spu.o $(COMPLIB) $(CONVERTER) |
667 | 55 $(CC) $(LDFLAGS) -g mc-code-spu.o $(COMPLIB) $(CONVERTER) -o $@ |
56 | |
581 | 57 conv/conv.h: conv_func.tbl tools/conv_func.pl |
58 perl tools/conv_func.pl | |
59 conv/convdef.h: conv_func.tbl tools/conv_func.pl | |
60 perl tools/conv_func.pl | |
61 conv/null.c: conv_func.tbl tools/conv_func.pl | |
62 perl tools/conv_func.pl | |
63 | |
615 | 64 mc-include.c: |
65 perl tools/find-gcc-include-path -l $(CC) > mc-include.c | |
66 | |
581 | 67 mc.h-new: |
68 perl tools/mc-h-renum.pl mc.h > mc.h.1 | |
69 mv mc.h.1 mc.h | |
70 | |
71 check-all: check-all-c check-all-code | |
72 | |
73 check-all-c: | |
74 make check TARGET=test/basic | |
75 make check-inline TARGET=test/basic | |
76 make check TARGET=test/call | |
77 make check TARGET=test/fact0 | |
78 make check TARGET=test/float | |
79 make check TARGET=test/ifdef | |
80 make check TARGET=test/int | |
81 make check TARGET=test/macro | |
82 make check TARGET=test/regargs | |
83 make check TARGET=test/short | |
84 make check TARGET=test/simp | |
85 make check TARGET=test/simp0 | |
86 make check TARGET=test/simp1 | |
87 make check TARGET=test/static | |
708 | 88 make check-inline TARGET=test/static |
581 | 89 make check TARGET=test/tmp |
90 make check TARGET=test/tmp10 | |
91 make check TARGET=test/tmp11 | |
92 make check TARGET=test/tmp12 | |
93 make check TARGET=test/tmp5 | |
94 make check TARGET=test/tmp7 | |
708 | 95 make check-inline TARGET=test/tmp7 |
96 make check TARGET=test/tmp8 | |
581 | 97 make check TARGET=test/tmp9 |
98 make check TARGET=test/enum | |
99 make check TARGET=test/obsf | |
100 make check TARGET=test/obsf2 | |
101 make check TARGET=test/long | |
102 make check TARGET=test/tstdarg | |
103 make check TARGET=test/switch | |
708 | 104 make check-inline TARGET=test/switch |
581 | 105 make check TARGET=test/strinit |
656 | 106 make check-inline TARGET=test/strinit |
581 | 107 make check TARGET=test/code-gen-all |
108 make check-inline TARGET=test/code-gen-all | |
109 make check TARGET=test/bitfield | |
110 make check TARGET=test/bitfield1 | |
111 make check-inline TARGET=test/bitfield1 | |
112 make check TARGET=test/cext | |
113 make check TARGET=test/const | |
114 make check TARGET=test/void_code | |
115 make check TARGET=test/putenemy | |
116 make check TARGET=test/inline | |
640 | 117 make check TARGET=test/ps2 |
708 | 118 make check-inline TARGET=test/ps2 |
640 | 119 make check TARGET=test/multi |
708 | 120 make check-inline TARGET=test/multi |
121 make check TARGET=test/comp | |
122 make check-inline TARGET=test/comp | |
581 | 123 # make check TARGET=test/scope STDFLAG="-std=gnu99" |
124 # make check-inline TARGET=test/scope STDFLAG="-std=gnu99" | |
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 | |
134 make check-code$(MK) TARGET=test/test1 | |
708 | 135 make check-code$(MK) TARGET=test/test2 |
581 | 136 make check-code$(MK) TARGET=test/tmpa |
137 make check-code$(MK) TARGET=test/tmp1 | |
138 make check-code$(MK) TARGET=test/tmp2 | |
139 make check-code$(MK) TARGET=test/tmp4 | |
140 make check-code$(MK) TARGET=test/tmp6 | |
708 | 141 make check-code$(MK) TARGET=test/tmpb |
142 make check-code-inline TARGET=test/tmpb | |
581 | 143 make check-code$(MK) TARGET=test/scope |
708 | 144 make check-code-inline TARGET=test/scope |
808
2a4a40168fa4
char is unsigned on Yellow dog.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
708
diff
changeset
|
145 # make check-code$(MK) TARGET=test/throw |
581 | 146 make check-code$(MK) TARGET=test/too-long-argument |
147 | |
708 | 148 check-nkf: mc |
581 | 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 | |
154 # -./$(MC) -Itest/ -s $(TARGET).c | |
155 | |
156 check: mc $(MC) $(TARGET).c | |
157 -$(CC) $(CFLAGS1) $(STDFLAG) $(TARGET).c -o b.out $(MLIB) | |
158 -./b.out > $(TARGET).gcc.out | |
824 | 159 -./$(MC) $(MCFLAG) -s $(TARGET).c |
581 | 160 -$(CC) $(TARGET).s $(MLIB) |
161 -./a.out > $(TARGET).$(MC).out | |
162 -diff $(TARGET).gcc.out $(TARGET).$(MC).out | |
163 | |
164 check-inline: mc $(MC) $(TARGET).c | |
165 -$(CC) $(CFLAGS1) $(STDFLAG) $(TARGET).c -o b.out $(MLIB) | |
166 -./b.out > $(TARGET).gcc.out | |
824 | 167 -./$(MC) $(MCFLAG) -s -DINLINE=inline $(TARGET).c |
581 | 168 -$(CC) $(TARGET).s $(MLIB) |
169 -./a.out > $(TARGET).$(MC).out | |
170 -diff $(TARGET).gcc.out $(TARGET).$(MC).out | |
171 | |
172 check-code: mc $(MC) | |
824 | 173 -./$(MC) $(MCFLAG) -s $(TARGET).c |
708 | 174 -$(CC) $(TARGET).s $(MLIB) |
175 -./a.out > $(TARGET).$(MC).out | |
176 -diff $(TARGET).code-out $(TARGET).$(MC).out | |
177 check-code-inline: mc $(MC) | |
824 | 178 -./$(MC) $(MCFLAG) -s -DINLINE=inline $(TARGET).c |
581 | 179 -$(CC) $(TARGET).s $(MLIB) |
180 -./a.out > $(TARGET).$(MC).out | |
181 -diff $(TARGET).code-out $(TARGET).$(MC).out | |
182 check-code-make: mc $(MC) | |
824 | 183 -./$(MC) $(MCFLAG) -s $(TARGET).c |
581 | 184 -$(CC) $(TARGET).s $(MLIB) |
185 -./a.out > $(TARGET).code-out | |
186 | |
708 | 187 check-flip: mc $(MC) |
188 -$(CC) -DFLIP -c test/basic2.c | |
189 -$(CC) basic2.o test/basic2.c | |
190 ./a.out | |
824 | 191 -./$(MC) $(MCFLAG) -s test/basic2.c |
708 | 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 | |
581 | 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 | |
201 incpri: | |
202 perl tools/incpri.pl test/*.c | |
203 | |
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 \ | |
208 mc-parse.c mc-tree.c \ | |
209 conv/c.c conv/c.h \ | |
210 conv/conv.h conv/convdef.h | |
211 | |
212 tar : | |
213 make clean | |
214 tar cBf - . | gzip > ../comp.tgz | |
215 | |
708 | 216 depend : mc.h mc-include.c |
615 | 217 makedepend -I$(GCC_INCLUDE) mc-code-ia32.c mc-code.h mc-codegen.c mc-codegen.h \ |
708 | 218 mc-parse.c mc-tree.c mc-switch.c mc-switch.h mc.h \ |
219 mc-inline.c mc-macro.c mc-macro.h mc-parse.h \ | |
581 | 220 conv/c.c conv/c.h conv/c2cbc.c conv/c2cbc.h conv/cbc2c.c \ |
221 conv/cbc2c.h conv/conv.h conv/convdef.h conv/null.c conv/null.h \ | |
708 | 222 mc-code-arm.c \ |
223 mc-code-powerpc.c \ | |
224 mc-code-mips.c | |
581 | 225 |
226 clean : | |
708 | 227 -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 |
581 | 228 |
229 mc1 : b00.s b01.s mc-codegen.o mc-tree.o mc-switch.o mc-macro.o mc-inline.o $(CONVERTER) | |
230 $(CC) -g -o $@ $(PRINTF) b00.s b01.s mc-codegen.o mc-tree.o mc-switch.o mc-macro.o mc-inline.o $(CONVERTER) | |
231 | |
232 mc2 : b00.s b01.s b02.s b03.s mc-macro.o mc-inline.o $(CONVERTER) | |
233 $(CC) -g -o $@ $(PRINTF) b00.s b01.s b02.s b03.s b04.s mc-macro.o mc-inline.o $(CONVERTER) | |
234 | |
235 b00.s : mc-parse.c $(MC) | |
824 | 236 ./$(MC) $(MCFLAG) -s -ob00.s mc-parse.c |
581 | 237 b01.s : $(CODE) $(MC) |
824 | 238 ./$(MC) $(MCFLAG) -s -ob01.s $(CODE) |
581 | 239 b02.s : mc-codegen.c $(MC) |
824 | 240 ./$(MC) $(MCFLAG) -s -ob02.s mc-codegen.c |
581 | 241 b03.s : mc-tree.c $(MC) |
824 | 242 ./$(MC) $(MCFLAG) -s -ob03.s mc-tree.c |
581 | 243 b04.s : mc-switch.c $(MC) |
824 | 244 ./$(MC) $(MCFLAG) -s -ob04.s mc-switch.c |
581 | 245 |
246 b10.s : mc-parse.c mc1 | |
824 | 247 ./mc1 $(MCFLAG) -s -ob10.s mc-parse.c |
581 | 248 b11.s : $(CODE) $(PRINTF) mc1 |
824 | 249 ./mc1 $(MCFLAG) -s -ob11.s $(CODE) |
581 | 250 b12.s : mc-codegen.c mc1 |
824 | 251 ./mc1 $(MCFLAG) -s -ob12.s mc-codegen.c |
581 | 252 b13.s : mc-tree.c mc1 |
824 | 253 ./mc1 $(MCFLAG) -s -ob13.s mc-tree.c |
581 | 254 b14.s : mc-switch.c mc1 |
824 | 255 ./mc1 $(MCFLAG) -s -ob14.s mc-switch.c |
581 | 256 |
257 b20.s : mc-parse.c mc2 | |
824 | 258 ./mc2 $(MCFLAG) -s -ob20.s mc-parse.c |
581 | 259 b21.s : $(CODE) $(PRINTF) mc2 |
824 | 260 ./mc2 $(MCFLAG) -s -ob21.s $(CODE) |
581 | 261 b22.s : mc-codegen.c mc2 |
824 | 262 ./mc2 $(MCFLAG) -s -ob22.s mc-codegen.c |
581 | 263 b23.s : mc-tree.c mc2 |
824 | 264 ./mc2 $(MCFLAG) -s -ob23.s mc-tree.c |
581 | 265 b24.s : mc-switch.c mc1 |
824 | 266 ./mc2 $(MCFLAG) -s -ob24.s mc-switch.c |
581 | 267 |
268 diff : b00.s b01.s b02.s b03.s b04.s b10.s b11.s b12.s b13.s b14.s | |
269 -diff b00.s b10.s | |
270 -diff b01.s b11.s | |
271 -diff b02.s b12.s | |
272 -diff b03.s b13.s | |
273 -diff b04.s b14.s | |
274 | |
275 diff2 : b00.s b01.s b02.s b03.s b04.s b20.s b21.s b22.s b23.s b24.s | |
276 -diff b00.s b20.s | |
277 -diff b01.s b21.s | |
278 -diff b02.s b22.s | |
279 -diff b03.s b23.s | |
280 -diff b04.s b24.s | |
281 | |
282 | |
283 # DO NOT DELETE |