Mercurial > hg > CbC > old > device
annotate Makefile.linuxzaurus @ 911:785b2bd38982
should fix compile time constant in gcc on linux
author | kono |
---|---|
date | Wed, 09 Apr 2014 14:39:32 +0900 |
parents | ac1285a0f69f |
children |
rev | line source |
---|---|
417 | 1 CC = gcc |
2 # -O3 | |
444 | 3 # CFLAGS = -g -Wall -I. |
4 # CFLAGS = -g -Wall -I. -pg -fprofile-arcs -ftest-coverage | |
5 # LDFLAGS = -pg | |
6 # for Linux Zaurus | |
620 | 7 CFLAGS = -fsigned-char -pipe -g -I. -I/home/zaurus/develop/include -DUSE_CODE_KEYWORD |
644 | 8 CFLAGS1 = -g -pipe -I. -fsigned-char -DUSE_CODE_KEYWORD |
417 | 9 BASE=0 |
10 STAGE=1 | |
11 MFLAGS=$(MFALGS) BASE=$(BASE) STAGE=$(STAGE) | |
444 | 12 ARCH=arm |
417 | 13 MC=mc-$(ARCH) |
444 | 14 MLIB = -lm |
417 | 15 PRINTF= # printf.c |
599 | 16 CONVERTER=conv/c.o conv/null.o conv/c2cbc.o conv/cbc2c.o |
476 | 17 COMPLIB = mc-parse.o mc-codegen.o mc-switch.o mc-macro.o mc-tree.o mc-inline.o |
417 | 18 # CODE=mc-code-ia32.c |
19 CODE=mc-code-$(ARCH).c | |
444 | 20 # |
21 TARGET=test/simp | |
417 | 22 |
620 | 23 all: mc |
417 | 24 |
620 | 25 mc: mc-include.c mc-$(ARCH) |
417 | 26 cp mc-$(ARCH) mc |
27 | |
28 TAGS: | |
29 ctags mc-code-powerpc.c mc-code.h mc-codegen.c mc-codegen.h \ | |
30 mc-macro.c \ | |
31 mc-parse.c mc-tree.c mc-switch.c mc-switch.h \ | |
32 mc.h conv/c.c conv/c.h \ | |
565 | 33 mc-inline.h mc-inline.c \ |
417 | 34 conv/conv.h conv/convdef.h conv/null.c |
35 | |
36 mc-powerpc : mc-code-powerpc.o $(COMPLIB) $(CONVERTER) | |
444 | 37 $(CC) $(LDFLAGS) -g mc-code-powerpc.o $(COMPLIB) $(CONVERTER) -o $@ |
417 | 38 |
39 mc-ia32 : mc-code-ia32.o $(COMPLIB) $(CONVERTER) | |
444 | 40 $(CC) $(LDFLAGS) -g mc-code-ia32.o $(COMPLIB) $(CONVERTER) -o $@ |
417 | 41 |
42 mc-mips : mc-code-mips.o $(COMPLIB) $(CONVERTER) | |
444 | 43 $(CC) $(LDFLAGS) -g mc-code-mips.o $(COMPLIB) $(CONVERTER) -o $@ |
417 | 44 |
45 mc-arm : mc-code-arm.o $(COMPLIB) $(CONVERTER) | |
444 | 46 $(CC) $(LDFLAGS) -g mc-code-arm.o $(COMPLIB) $(CONVERTER) -o $@ |
417 | 47 |
565 | 48 conv/conv.h: conv_func.tbl tools/conv_func.pl |
49 perl tools/conv_func.pl | |
50 conv/convdef.h: conv_func.tbl tools/conv_func.pl | |
51 perl tools/conv_func.pl | |
52 conv/null.c: conv_func.tbl tools/conv_func.pl | |
53 perl tools/conv_func.pl | |
417 | 54 |
620 | 55 mc-include.c: |
56 perl tools/find-gcc-include-path -l $(CC) > mc-include.c | |
57 | |
417 | 58 mc.h-new: |
565 | 59 perl tools/mc-h-renum.pl mc.h > mc.h.1 |
417 | 60 mv mc.h.1 mc.h |
61 | |
62 check-all: check-all-c check-all-code | |
63 | |
64 check-all-c: | |
65 make check TARGET=test/basic | |
565 | 66 make check-inline TARGET=test/basic |
417 | 67 make check TARGET=test/call |
68 make check TARGET=test/fact0 | |
69 make check TARGET=test/float | |
70 make check TARGET=test/ifdef | |
71 make check TARGET=test/int | |
72 make check TARGET=test/macro | |
73 make check TARGET=test/regargs | |
74 make check TARGET=test/short | |
75 make check TARGET=test/simp | |
76 make check TARGET=test/simp0 | |
77 make check TARGET=test/simp1 | |
78 make check TARGET=test/static | |
79 make check TARGET=test/tmp | |
80 make check TARGET=test/tmp10 | |
81 make check TARGET=test/tmp11 | |
82 make check TARGET=test/tmp12 | |
83 make check TARGET=test/tmp5 | |
84 make check TARGET=test/tmp7 | |
85 make check TARGET=test/tmp8 | |
86 make check TARGET=test/tmp9 | |
87 make check TARGET=test/enum | |
88 make check TARGET=test/obsf | |
444 | 89 make check TARGET=test/obsf2 |
417 | 90 make check TARGET=test/long |
91 make check TARGET=test/tstdarg | |
92 make check TARGET=test/switch | |
93 make check TARGET=test/strinit | |
94 make check TARGET=test/code-gen-all | |
565 | 95 make check-inline TARGET=test/code-gen-all |
417 | 96 make check TARGET=test/bitfield |
97 make check TARGET=test/bitfield1 | |
565 | 98 make check-inline TARGET=test/bitfield1 |
417 | 99 make check TARGET=test/cext |
444 | 100 make check TARGET=test/const |
101 make check TARGET=test/void_code | |
565 | 102 make check TARGET=test/putenemy |
103 make check TARGET=test/inline | |
104 make check TARGET=test/offset | |
640 | 105 make check TARGET=test/ps2 |
106 make check TARGET=test/multi | |
417 | 107 # make check TARGET=test/scope STDFLAG="-std=gnu99" |
565 | 108 # make check-inline TARGET=test/scope STDFLAG="-std=gnu99" |
417 | 109 #MK =-make |
110 MK= | |
111 check-all-code: | |
112 make check-code$(MK) TARGET=test/arg | |
113 make check-code$(MK) TARGET=test/conv | |
114 make check-code$(MK) TARGET=test/conv1 | |
115 make check-code$(MK) TARGET=test/fact-a | |
116 make check-code$(MK) TARGET=test/fact | |
117 make check-code$(MK) TARGET=test/goto | |
450
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
446
diff
changeset
|
118 make check-code$(MK) TARGET=test/test1 |
604 | 119 make check-code$(MK) TARGET=test/test2 |
565 | 120 make check-code$(MK) TARGET=test/tmpa |
450
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
446
diff
changeset
|
121 make check-code$(MK) TARGET=test/tmp1 |
417 | 122 make check-code$(MK) TARGET=test/tmp2 |
123 make check-code$(MK) TARGET=test/tmp4 | |
450
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
446
diff
changeset
|
124 make check-code$(MK) TARGET=test/tmp6 |
590 | 125 make check-code$(MK) TARGET=test/tmpb |
417 | 126 make check-code$(MK) TARGET=test/scope |
581 | 127 make check-code$(MK) TARGET=test/throw |
565 | 128 make check-code$(MK) TARGET=test/too-long-argument |
417 | 129 |
130 check-nkf: | |
565 | 131 ( cd nkf203; $(CC) -g -o nkf1 nkf.c utf8tbl.c ) |
417 | 132 ( cd nkf203; ../mc-$(ARCH) -s nkf.c utf8tbl.c ) |
133 ( cd nkf203; $(CC) -g -o nkf nkf.s utf8tbl.s ) | |
134 ( cd nkf203; perl test.pl ) | |
135 | |
136 # -./$(MC) -Itest/ -s $(TARGET).c | |
137 | |
565 | 138 check: mc $(MC) $(TARGET).c |
139 -$(CC) $(CFLAGS1) $(STDFLAG) $(TARGET).c -o b.out $(MLIB) | |
417 | 140 -./b.out > $(TARGET).gcc.out |
141 -./$(MC) -s $(TARGET).c | |
565 | 142 -$(CC) $(TARGET).s $(MLIB) |
417 | 143 -./a.out > $(TARGET).$(MC).out |
144 -diff $(TARGET).gcc.out $(TARGET).$(MC).out | |
145 | |
565 | 146 check-inline: mc $(MC) $(TARGET).c |
147 -$(CC) $(CFLAGS1) $(STDFLAG) $(TARGET).c -o b.out $(MLIB) | |
148 -./b.out > $(TARGET).gcc.out | |
149 -./$(MC) -s -DINLINE=inline $(TARGET).c | |
150 -$(CC) $(TARGET).s $(MLIB) | |
151 -./a.out > $(TARGET).$(MC).out | |
152 -diff $(TARGET).gcc.out $(TARGET).$(MC).out | |
153 | |
154 check-code: mc $(MC) | |
417 | 155 -./$(MC) -s $(TARGET).c |
565 | 156 -$(CC) $(TARGET).s $(MLIB) |
417 | 157 -./a.out > $(TARGET).$(MC).out |
158 -diff $(TARGET).code-out $(TARGET).$(MC).out | |
565 | 159 check-code-make: mc $(MC) |
417 | 160 -./$(MC) -s $(TARGET).c |
565 | 161 -$(CC) $(TARGET).s $(MLIB) |
417 | 162 -./a.out > $(TARGET).code-out |
163 | |
164 test/code-gen-all.c: test/code-gen.pl test/code-gen.c | |
165 perl test/code-gen.pl < test/code-gen.c > test/code-gen-all.c | |
166 | |
565 | 167 incpri: |
168 perl tools/incpri.pl test/*.c | |
169 | |
417 | 170 tags: tags-$(ARCH) |
171 | |
172 tags-$(ARCH): | |
173 ctags mc.h mc-code.h mc-code-$(ARCH).c mc-codegen.c mc-codegen.h \ | |
174 mc-parse.c mc-tree.c \ | |
175 conv/c.c conv/c.h \ | |
176 conv/conv.h conv/convdef.h | |
177 | |
178 tar : | |
179 make clean | |
180 tar cBf - . | gzip > ../comp.tgz | |
181 | |
620 | 182 depend : mc-include.c |
417 | 183 makedepend mc-code-ia32.c mc-code.h mc-codegen.c mc-codegen.h \ |
184 mc-parse.c mc-tree.c mc-switch.c mc-switch.h mc.h \ | |
602 | 185 mc-inline.c mc-macro.c mc-macro.h mc-parse.h \ |
417 | 186 conv/c.c conv/c.h conv/c2cbc.c conv/c2cbc.h conv/cbc2c.c \ |
187 conv/cbc2c.h conv/conv.h conv/convdef.h conv/null.c conv/null.h \ | |
602 | 188 mc-code-arm.c \ |
417 | 189 mc-code-powerpc.c \ |
190 mc-code-mips.c | |
191 | |
192 clean : | |
644 | 193 -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.h |
417 | 194 |
476 | 195 mc1 : b00.s b01.s mc-codegen.o mc-tree.o mc-switch.o mc-macro.o mc-inline.o $(CONVERTER) |
196 $(CC) -g -o $@ $(PRINTF) b00.s b01.s mc-codegen.o mc-tree.o mc-switch.o mc-macro.o mc-inline.o $(CONVERTER) | |
417 | 197 |
476 | 198 mc2 : b00.s b01.s b02.s b03.s mc-macro.o mc-inline.o $(CONVERTER) |
199 $(CC) -g -o $@ $(PRINTF) b00.s b01.s b02.s b03.s b04.s mc-macro.o mc-inline.o $(CONVERTER) | |
417 | 200 |
201 b00.s : mc-parse.c $(MC) | |
202 ./$(MC) -s -ob00.s mc-parse.c | |
203 b01.s : $(CODE) $(MC) | |
204 ./$(MC) -s -ob01.s $(CODE) | |
205 b02.s : mc-codegen.c $(MC) | |
206 ./$(MC) -s -ob02.s mc-codegen.c | |
207 b03.s : mc-tree.c $(MC) | |
208 ./$(MC) -s -ob03.s mc-tree.c | |
209 b04.s : mc-switch.c $(MC) | |
210 ./$(MC) -s -ob04.s mc-switch.c | |
211 | |
212 b10.s : mc-parse.c mc1 | |
213 ./mc1 -s -ob10.s mc-parse.c | |
214 b11.s : $(CODE) $(PRINTF) mc1 | |
215 ./mc1 -s -ob11.s $(CODE) | |
216 b12.s : mc-codegen.c mc1 | |
217 ./mc1 -s -ob12.s mc-codegen.c | |
218 b13.s : mc-tree.c mc1 | |
219 ./mc1 -s -ob13.s mc-tree.c | |
220 b14.s : mc-switch.c mc1 | |
221 ./mc1 -s -ob14.s mc-switch.c | |
222 | |
223 b20.s : mc-parse.c mc2 | |
224 ./mc2 -s -ob20.s mc-parse.c | |
225 b21.s : $(CODE) $(PRINTF) mc2 | |
226 ./mc2 -s -ob21.s $(CODE) | |
227 b22.s : mc-codegen.c mc2 | |
228 ./mc2 -s -ob22.s mc-codegen.c | |
229 b23.s : mc-tree.c mc2 | |
230 ./mc2 -s -ob23.s mc-tree.c | |
231 b24.s : mc-switch.c mc1 | |
232 ./mc2 -s -ob24.s mc-switch.c | |
233 | |
234 diff : b00.s b01.s b02.s b03.s b04.s b10.s b11.s b12.s b13.s b14.s | |
235 -diff b00.s b10.s | |
236 -diff b01.s b11.s | |
237 -diff b02.s b12.s | |
238 -diff b03.s b13.s | |
239 -diff b04.s b14.s | |
240 | |
241 diff2 : b00.s b01.s b02.s b03.s b04.s b20.s b21.s b22.s b23.s b24.s | |
242 -diff b00.s b20.s | |
243 -diff b01.s b21.s | |
244 -diff b02.s b22.s | |
245 -diff b03.s b23.s | |
246 -diff b04.s b24.s | |
247 | |
248 | |
446 | 249 # DO NOT DELETE |