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