Mercurial > hg > CbC > old > device
annotate Makefile @ 916:af6f9373ce64
include
author | kono |
---|---|
date | Thu, 10 Apr 2014 12:04:39 +0900 |
parents | 7aa39f5128f9 |
children | 08dcc3b7c39b |
rev | line source |
---|---|
916 | 1 GCC = gcc |
773 | 2 CC = $(GCC) -std=c99 $(CCEXT) $(M) -fgnu89-inline |
664 | 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 |
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) | |
731 | 14 ARCH=i64 |
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 |
705 | 27 all: mc tags |
94 | 28 |
731 | 29 predefined: |
30 $(CC) -xc -E -dM /dev/null | |
31 | |
690 | 32 ppc: |
33 make ARCH=powerpc CCEXT="-arch ppc" check-all | |
34 | |
775 | 35 ia32: |
36 make ARCH=ia32 CCEXT="-m32" check-all | |
37 | |
776 | 38 ia32-make-code-check: |
39 make ARCH=ia32 CCEXT="-m32" MK=-make check-all-code | |
40 | |
666 | 41 mc: mc-$(ARCH) |
126 | 42 cp mc-$(ARCH) mc |
0 | 43 |
731 | 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 | |
691 | 47 mc-powerpc :conv/conv.h mc-include.c mc-code-powerpc.o $(COMPLIB) $(CONVERTER) |
440 | 48 $(CC) $(LDFLAGS) -g mc-code-powerpc.o $(COMPLIB) $(CONVERTER) -o $@ |
94 | 49 |
691 | 50 mc-ia32 :conv/conv.h mc-include.c mc-code-ia32.o $(COMPLIB) $(CONVERTER) |
440 | 51 $(CC) $(LDFLAGS) -g mc-code-ia32.o $(COMPLIB) $(CONVERTER) -o $@ |
61 | 52 |
691 | 53 mc-mips :conv/conv.h mc-include.c mc-code-mips.o $(COMPLIB) $(CONVERTER) |
440 | 54 $(CC) $(LDFLAGS) -g mc-code-mips.o $(COMPLIB) $(CONVERTER) -o $@ |
130 | 55 |
691 | 56 mc-arm :conv/conv.h mc-include.c mc-code-arm.o $(COMPLIB) $(CONVERTER) |
440 | 57 $(CC) $(LDFLAGS) -g mc-code-arm.o $(COMPLIB) $(CONVERTER) -o $@ |
383 | 58 |
691 | 59 mc-spu :conv/conv.h mc-include.c mc-code-spu.o $(COMPLIB) $(CONVERTER) |
666 | 60 $(CC) $(LDFLAGS) -g mc-code-spu.o $(COMPLIB) $(CONVERTER) -o $@ |
61 | |
466 | 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 | |
67 | 68 |
861 | 69 mc-include.c: stdio.h |
615 | 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 | |
166 | 75 mc.h-new: |
466 | 76 perl tools/mc-h-renum.pl mc.h > mc.h.1 |
166 | 77 mv mc.h.1 mc.h |
78 | |
172 | 79 check-all: check-all-c check-all-code |
80 | |
81 check-all-c: | |
118 | 82 make check TARGET=test/basic |
550 | 83 make check-inline TARGET=test/basic |
118 | 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 | |
172 | 91 make check TARGET=test/short |
118 | 92 make check TARGET=test/simp |
93 make check TARGET=test/simp0 | |
249 | 94 make check TARGET=test/simp1 |
172 | 95 make check TARGET=test/static |
705 | 96 make check-inline TARGET=test/static |
118 | 97 make check TARGET=test/tmp |
98 make check TARGET=test/tmp10 | |
99 make check TARGET=test/tmp11 | |
161 | 100 make check TARGET=test/tmp12 |
336 | 101 make check TARGET=test/tmp5 |
118 | 102 make check TARGET=test/tmp7 |
701 | 103 make check-inline TARGET=test/tmp7 |
664 | 104 make check TARGET=test/tmp8 |
118 | 105 make check TARGET=test/tmp9 |
176 | 106 make check TARGET=test/enum |
214 | 107 make check TARGET=test/obsf |
444 | 108 make check TARGET=test/obsf2 |
221 | 109 make check TARGET=test/long |
307 | 110 make check TARGET=test/tstdarg |
311 | 111 make check TARGET=test/switch |
705 | 112 make check-inline TARGET=test/switch |
310 | 113 make check TARGET=test/strinit |
705 | 114 make check-inline TARGET=test/strinit |
221 | 115 make check TARGET=test/code-gen-all |
550 | 116 make check-inline TARGET=test/code-gen-all |
338 | 117 make check TARGET=test/bitfield |
118 make check TARGET=test/bitfield1 | |
705 | 119 make check-inline TARGET=test/bitfield1 |
353 | 120 make check TARGET=test/cext |
400 | 121 make check TARGET=test/const |
438
626d705471d5
Unexecuted code in conditional. Lazy jmp code generation.
kono
parents:
420
diff
changeset
|
122 make check TARGET=test/void_code |
494 | 123 make check TARGET=test/putenemy |
453 | 124 make check TARGET=test/inline |
640 | 125 make check TARGET=test/ps2 |
705 | 126 make check-inline TARGET=test/ps2 |
713 | 127 make check TARGET=test/offset |
640 | 128 make check TARGET=test/multi |
705 | 129 make check-inline TARGET=test/multi |
130 make check TARGET=test/comp | |
131 make check-inline TARGET=test/comp | |
366 | 132 # make check TARGET=test/scope STDFLAG="-std=gnu99" |
550 | 133 # make check-inline TARGET=test/scope STDFLAG="-std=gnu99" |
172 | 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 | |
449 | 143 make check-code$(MK) TARGET=test/test1 |
664 | 144 make check-code$(MK) TARGET=test/test2 |
477 | 145 make check-code$(MK) TARGET=test/tmpa |
449 | 146 make check-code$(MK) TARGET=test/tmp1 |
172 | 147 make check-code$(MK) TARGET=test/tmp2 |
148 make check-code$(MK) TARGET=test/tmp4 | |
449 | 149 make check-code$(MK) TARGET=test/tmp6 |
664 | 150 make check-code$(MK) TARGET=test/tmpb |
705 | 151 make check-code-inline TARGET=test/tmpb |
366 | 152 make check-code$(MK) TARGET=test/scope |
705 | 153 make check-code-inline TARGET=test/scope |
725
3f1f6c0610c1
goto with enviornment syntax changed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
714
diff
changeset
|
154 # make check-code$(MK) TARGET=test/throw |
545 | 155 make check-code$(MK) TARGET=test/too-long-argument |
172 | 156 |
702 | 157 check-nkf: mc |
191 | 158 ( cd nkf203; $(CC) -g -o nkf1 nkf.c utf8tbl.c ) |
862 | 159 ( cd nkf203; ../mc-$(ARCH) nkf.c utf8tbl.c ) |
191 | 160 ( cd nkf203; $(CC) -g -o nkf nkf.s utf8tbl.s ) |
161 ( cd nkf203; perl test.pl ) | |
162 | |
862 | 163 # -./$(MC) -Itest/ $(TARGET).c |
118 | 164 |
551 | 165 check: mc $(MC) $(TARGET).c |
868
c55337499f96
remove warnings and error from test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
862
diff
changeset
|
166 -$(CC) $(CFLAGS1) $(STDFLAG) $(TARGET).c -o b.out $(MLIB) -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 | |
123 | 169 -./b.out > $(TARGET).gcc.out |
862 | 170 -./$(MC) $(MCFLAG) $(TARGET).c |
466 | 171 -$(CC) $(TARGET).s $(MLIB) |
123 | 172 -./a.out > $(TARGET).$(MC).out |
225 | 173 -diff $(TARGET).gcc.out $(TARGET).$(MC).out |
118 | 174 |
551 | 175 check-inline: mc $(MC) $(TARGET).c |
868
c55337499f96
remove warnings and error from test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
862
diff
changeset
|
176 -$(CC) $(CFLAGS1) $(STDFLAG) $(TARGET).c -o b.out $(MLIB) -Wno-literal-conversion -Wno-implicit-function-declaration -Wno-implicit-int \ |
882 | 177 -Wno-incompatible-pointer-types -Wno-int-conversion -Wno-return-type -Wno-bitfield-constant-conversion -Wno-tautological-compare -Wno-shift-overflow \ |
178 -Wno-unused-value | |
550 | 179 -./b.out > $(TARGET).gcc.out |
862 | 180 -./$(MC) $(MCFLAG) -DINLINE=inline $(TARGET).c |
550 | 181 -$(CC) $(TARGET).s $(MLIB) |
182 -./a.out > $(TARGET).$(MC).out | |
183 -diff $(TARGET).gcc.out $(TARGET).$(MC).out | |
184 | |
551 | 185 check-code: mc $(MC) |
862 | 186 -./$(MC) $(MCFLAG) $(TARGET).c |
466 | 187 -$(CC) $(TARGET).s $(MLIB) |
172 | 188 -./a.out > $(TARGET).$(MC).out |
189 -diff $(TARGET).code-out $(TARGET).$(MC).out | |
705 | 190 check-code-inline: mc $(MC) |
862 | 191 -./$(MC) $(MCFLAG) -DINLINE=inline $(TARGET).c |
705 | 192 -$(CC) $(TARGET).s $(MLIB) |
193 -./a.out > $(TARGET).$(MC).out | |
194 -diff $(TARGET).code-out $(TARGET).$(MC).out | |
551 | 195 check-code-make: mc $(MC) |
862 | 196 -./$(MC) $(MCFLAG) $(TARGET).c |
466 | 197 -$(CC) $(TARGET).s $(MLIB) |
172 | 198 -./a.out > $(TARGET).code-out |
199 | |
676 | 200 check-flip: mc $(MC) |
201 -$(CC) -DFLIP -c test/basic2.c | |
202 -$(CC) basic2.o test/basic2.c | |
203 ./a.out | |
862 | 204 -./$(MC) test/basic2.c |
676 | 205 -$(CC) test/basic2.s -DFLIP test/basic2.c |
206 ./a.out | |
862 | 207 -./$(MC) -DFLIP test/basic2.c |
676 | 208 -$(CC) test/basic2.s test/basic2.c |
209 ./a.out | |
210 | |
245 | 211 test/code-gen-all.c: test/code-gen.pl test/code-gen.c |
212 perl test/code-gen.pl < test/code-gen.c > test/code-gen-all.c | |
213 | |
491 | 214 incpri: |
215 perl tools/incpri.pl test/*.c | |
216 | |
904 | 217 tags: # tags-$(ARCH) |
186 | 218 |
219 tags-$(ARCH): | |
904 | 220 -ctags -w mc.h mc-code.h mc-code-$(ARCH).c mc-codegen.c mc-codegen.h \ |
714 | 221 mc-parse.h mc-tree.c mc-inline.h mc-switch.h \ |
222 mc-macro.h mc-macro.c \ | |
186 | 223 conv/c.c conv/c.h \ |
224 conv/conv.h conv/convdef.h | |
225 | |
0 | 226 tar : |
227 make clean | |
228 tar cBf - . | gzip > ../comp.tgz | |
229 | |
664 | 230 depend : mc.h mc-include.c |
615 | 231 makedepend -I$(GCC_INCLUDE) mc-code-ia32.c mc-code.h mc-codegen.c mc-codegen.h \ |
664 | 232 mc-parse.c mc-tree.c mc-switch.c mc-switch.h mc.h \ |
233 mc-inline.c mc-macro.c mc-macro.h mc-parse.h \ | |
67 | 234 conv/c.c conv/c.h conv/c2cbc.c conv/c2cbc.h conv/cbc2c.c \ |
93 | 235 conv/cbc2c.h conv/conv.h conv/convdef.h conv/null.c conv/null.h \ |
664 | 236 mc-code-arm.c \ |
237 mc-code-powerpc.c \ | |
238 mc-code-mips.c | |
0 | 239 |
240 clean : | |
861 | 241 -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 |
0 | 242 |
453 | 243 mc1 : b00.s b01.s mc-codegen.o mc-tree.o mc-switch.o mc-macro.o mc-inline.o $(CONVERTER) |
244 $(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 | 245 |
453 | 246 mc2 : b00.s b01.s b02.s b03.s mc-macro.o mc-inline.o $(CONVERTER) |
247 $(CC) -g -o $@ $(PRINTF) b00.s b01.s b02.s b03.s b04.s mc-macro.o mc-inline.o $(CONVERTER) | |
140 | 248 |
94 | 249 b00.s : mc-parse.c $(MC) |
862 | 250 ./$(MC) $(MCFLAG) -ob00.s mc-parse.c |
109 | 251 b01.s : $(CODE) $(MC) |
862 | 252 ./$(MC) $(MCFLAG) -ob01.s $(CODE) |
140 | 253 b02.s : mc-codegen.c $(MC) |
862 | 254 ./$(MC) $(MCFLAG) -ob02.s mc-codegen.c |
140 | 255 b03.s : mc-tree.c $(MC) |
862 | 256 ./$(MC) $(MCFLAG) -ob03.s mc-tree.c |
298 | 257 b04.s : mc-switch.c $(MC) |
862 | 258 ./$(MC) $(MCFLAG) -ob04.s mc-switch.c |
140 | 259 |
0 | 260 b10.s : mc-parse.c mc1 |
862 | 261 ./mc1 $(MCFLAG) -ob10.s mc-parse.c |
109 | 262 b11.s : $(CODE) $(PRINTF) mc1 |
862 | 263 ./mc1 $(MCFLAG) -ob11.s $(CODE) |
140 | 264 b12.s : mc-codegen.c mc1 |
862 | 265 ./mc1 $(MCFLAG) -ob12.s mc-codegen.c |
140 | 266 b13.s : mc-tree.c mc1 |
862 | 267 ./mc1 $(MCFLAG) -ob13.s mc-tree.c |
298 | 268 b14.s : mc-switch.c mc1 |
862 | 269 ./mc1 $(MCFLAG) -ob14.s mc-switch.c |
0 | 270 |
140 | 271 b20.s : mc-parse.c mc2 |
862 | 272 ./mc2 $(MCFLAG) -ob20.s mc-parse.c |
140 | 273 b21.s : $(CODE) $(PRINTF) mc2 |
862 | 274 ./mc2 $(MCFLAG) -ob21.s $(CODE) |
140 | 275 b22.s : mc-codegen.c mc2 |
862 | 276 ./mc2 $(MCFLAG) -ob22.s mc-codegen.c |
140 | 277 b23.s : mc-tree.c mc2 |
862 | 278 ./mc2 $(MCFLAG) -ob23.s mc-tree.c |
298 | 279 b24.s : mc-switch.c mc1 |
862 | 280 ./mc2 $(MCFLAG) -ob24.s mc-switch.c |
140 | 281 |
298 | 282 diff : b00.s b01.s b02.s b03.s b04.s b10.s b11.s b12.s b13.s b14.s |
0 | 283 -diff b00.s b10.s |
284 -diff b01.s b11.s | |
140 | 285 -diff b02.s b12.s |
286 -diff b03.s b13.s | |
298 | 287 -diff b04.s b14.s |
140 | 288 |
298 | 289 diff2 : b00.s b01.s b02.s b03.s b04.s b20.s b21.s b22.s b23.s b24.s |
140 | 290 -diff b00.s b20.s |
291 -diff b01.s b21.s | |
292 -diff b02.s b22.s | |
293 -diff b03.s b23.s | |
298 | 294 -diff b04.s b24.s |
140 | 295 |
67 | 296 |
0 | 297 # DO NOT DELETE |