497
|
1 # CC = gcc -std=c99
|
554
|
2 CC = cc
|
497
|
3 # -O3
|
|
4 CFLAGS = -g -Wall -I.
|
|
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
|
|
9 CFLAGS1 = -g -I.
|
|
10 BASE=0
|
|
11 STAGE=1
|
|
12 MFLAGS=$(MFALGS) BASE=$(BASE) STAGE=$(STAGE)
|
|
13 ARCH=ia32
|
|
14 MC=mc-$(ARCH)
|
554
|
15 # MLIB = -lm
|
497
|
16 PRINTF= # printf.c
|
|
17 CONVERTER=conv/c.o conv/null.o
|
|
18 # 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 #
|
|
23 TARGET=test/simp
|
|
24
|
|
25 all: mc mc-ia32 mc-powerpc mc-mips mc-arm
|
|
26
|
|
27 mc: mc-$(ARCH)
|
|
28 cp mc-$(ARCH) mc
|
|
29
|
|
30 TAGS:
|
|
31 ctags mc-code-powerpc.c mc-code.h mc-codegen.c mc-codegen.h \
|
|
32 mc-macro.c \
|
|
33 mc-parse.c mc-tree.c mc-switch.c mc-switch.h \
|
|
34 mc.h conv/c.c conv/c.h \
|
|
35 mc-inline.h mc-inline.c \
|
|
36 conv/conv.h conv/convdef.h conv/null.c
|
|
37
|
|
38 mc-powerpc : mc-code-powerpc.o $(COMPLIB) $(CONVERTER)
|
|
39 $(CC) $(LDFLAGS) -g mc-code-powerpc.o $(COMPLIB) $(CONVERTER) -o $@
|
|
40
|
|
41 mc-ia32 : mc-code-ia32.o $(COMPLIB) $(CONVERTER)
|
|
42 $(CC) $(LDFLAGS) -g mc-code-ia32.o $(COMPLIB) $(CONVERTER) -o $@
|
|
43
|
|
44 mc-mips : mc-code-mips.o $(COMPLIB) $(CONVERTER)
|
|
45 $(CC) $(LDFLAGS) -g mc-code-mips.o $(COMPLIB) $(CONVERTER) -o $@
|
|
46
|
|
47 mc-arm : mc-code-arm.o $(COMPLIB) $(CONVERTER)
|
|
48 $(CC) $(LDFLAGS) -g mc-code-arm.o $(COMPLIB) $(CONVERTER) -o $@
|
|
49
|
|
50 conv/conv.h: conv_func.tbl tools/conv_func.pl
|
|
51 perl tools/conv_func.pl
|
|
52 conv/convdef.h: conv_func.tbl tools/conv_func.pl
|
|
53 perl tools/conv_func.pl
|
|
54 conv/null.c: conv_func.tbl tools/conv_func.pl
|
|
55 perl tools/conv_func.pl
|
|
56
|
|
57 mc.h-new:
|
|
58 perl tools/mc-h-renum.pl mc.h > mc.h.1
|
|
59 mv mc.h.1 mc.h
|
|
60
|
|
61 check-all: check-all-c check-all-code
|
|
62
|
|
63 check-all-c:
|
|
64 make check TARGET=test/basic
|
554
|
65 make check-inline TARGET=test/basic
|
497
|
66 make check TARGET=test/call
|
|
67 make check TARGET=test/fact0
|
|
68 make check TARGET=test/float
|
|
69 make check TARGET=test/ifdef
|
|
70 make check TARGET=test/int
|
|
71 make check TARGET=test/macro
|
|
72 make check TARGET=test/regargs
|
|
73 make check TARGET=test/short
|
|
74 make check TARGET=test/simp
|
|
75 make check TARGET=test/simp0
|
|
76 make check TARGET=test/simp1
|
|
77 make check TARGET=test/static
|
|
78 make check TARGET=test/tmp
|
|
79 make check TARGET=test/tmp10
|
|
80 make check TARGET=test/tmp11
|
|
81 make check TARGET=test/tmp12
|
|
82 make check TARGET=test/tmp5
|
|
83 make check TARGET=test/tmp7
|
|
84 make check TARGET=test/tmp8
|
|
85 make check TARGET=test/tmp9
|
|
86 make check TARGET=test/enum
|
|
87 make check TARGET=test/obsf
|
|
88 make check TARGET=test/obsf2
|
|
89 make check TARGET=test/long
|
|
90 make check TARGET=test/tstdarg
|
|
91 make check TARGET=test/switch
|
|
92 make check TARGET=test/strinit
|
|
93 make check TARGET=test/code-gen-all
|
554
|
94 make check-inline TARGET=test/code-gen-all
|
497
|
95 make check TARGET=test/bitfield
|
|
96 make check TARGET=test/bitfield1
|
|
97 make check TARGET=test/cext
|
|
98 make check TARGET=test/const
|
|
99 make check TARGET=test/void_code
|
554
|
100 make check TARGET=test/putenemy
|
497
|
101 make check TARGET=test/inline
|
|
102 # make check TARGET=test/scope STDFLAG="-std=gnu99"
|
554
|
103 # make check-inline TARGET=test/scope STDFLAG="-std=gnu99"
|
497
|
104 #MK =-make
|
|
105 MK=
|
|
106 check-all-code:
|
|
107 make check-code$(MK) TARGET=test/arg
|
|
108 make check-code$(MK) TARGET=test/conv
|
|
109 make check-code$(MK) TARGET=test/conv1
|
|
110 make check-code$(MK) TARGET=test/fact-a
|
|
111 make check-code$(MK) TARGET=test/fact
|
|
112 make check-code$(MK) TARGET=test/goto
|
|
113 make check-code$(MK) TARGET=test/test1
|
|
114 make check-code$(MK) TARGET=test/tmpa
|
|
115 make check-code$(MK) TARGET=test/tmp1
|
|
116 make check-code$(MK) TARGET=test/tmp2
|
|
117 make check-code$(MK) TARGET=test/tmp4
|
|
118 make check-code$(MK) TARGET=test/tmp6
|
|
119 make check-code$(MK) TARGET=test/scope
|
554
|
120 make check-code$(MK) TARGET=test/too-long-argument
|
497
|
121
|
|
122 check-nkf:
|
|
123 ( cd nkf203; $(CC) -g -o nkf1 nkf.c utf8tbl.c )
|
|
124 ( cd nkf203; ../mc-$(ARCH) -s nkf.c utf8tbl.c )
|
|
125 ( cd nkf203; $(CC) -g -o nkf nkf.s utf8tbl.s )
|
|
126 ( cd nkf203; perl test.pl )
|
|
127
|
|
128 # -./$(MC) -Itest/ -s $(TARGET).c
|
|
129
|
554
|
130 check: mc $(MC) $(TARGET).c
|
497
|
131 -$(CC) $(CFLAGS1) $(STDFLAG) $(TARGET).c -o b.out $(MLIB)
|
|
132 -./b.out > $(TARGET).gcc.out
|
|
133 -./$(MC) -s $(TARGET).c
|
|
134 -$(CC) $(TARGET).s $(MLIB)
|
|
135 -./a.out > $(TARGET).$(MC).out
|
|
136 -diff $(TARGET).gcc.out $(TARGET).$(MC).out
|
|
137
|
554
|
138 check-inline: mc $(MC) $(TARGET).c
|
|
139 -$(CC) $(CFLAGS1) $(STDFLAG) $(TARGET).c -o b.out $(MLIB)
|
|
140 -./b.out > $(TARGET).gcc.out
|
|
141 -./$(MC) -s -DINLINE=inline $(TARGET).c
|
|
142 -$(CC) $(TARGET).s $(MLIB)
|
|
143 -./a.out > $(TARGET).$(MC).out
|
|
144 -diff $(TARGET).gcc.out $(TARGET).$(MC).out
|
|
145
|
|
146 check-code: mc $(MC)
|
497
|
147 -./$(MC) -s $(TARGET).c
|
|
148 -$(CC) $(TARGET).s $(MLIB)
|
|
149 -./a.out > $(TARGET).$(MC).out
|
|
150 -diff $(TARGET).code-out $(TARGET).$(MC).out
|
554
|
151 check-code-make: mc $(MC)
|
497
|
152 -./$(MC) -s $(TARGET).c
|
|
153 -$(CC) $(TARGET).s $(MLIB)
|
|
154 -./a.out > $(TARGET).code-out
|
|
155
|
|
156 test/code-gen-all.c: test/code-gen.pl test/code-gen.c
|
|
157 perl test/code-gen.pl < test/code-gen.c > test/code-gen-all.c
|
|
158
|
|
159 incpri:
|
|
160 perl tools/incpri.pl test/*.c
|
|
161
|
|
162 tags: tags-$(ARCH)
|
|
163
|
|
164 tags-$(ARCH):
|
|
165 ctags mc.h mc-code.h mc-code-$(ARCH).c mc-codegen.c mc-codegen.h \
|
|
166 mc-parse.c mc-tree.c \
|
|
167 conv/c.c conv/c.h \
|
|
168 conv/conv.h conv/convdef.h
|
|
169
|
|
170 tar :
|
|
171 make clean
|
|
172 tar cBf - . | gzip > ../comp.tgz
|
|
173
|
|
174 depend :
|
|
175 makedepend mc-code-ia32.c mc-code.h mc-codegen.c mc-codegen.h \
|
|
176 mc-parse.c mc-tree.c mc-switch.c mc-switch.h mc.h \
|
|
177 mc-macro.c mc-macro.h mc-parse.h \
|
|
178 conv/c.c conv/c.h conv/c2cbc.c conv/c2cbc.h conv/cbc2c.c \
|
|
179 conv/cbc2c.h conv/conv.h conv/convdef.h conv/null.c conv/null.h \
|
|
180 mc-code-powerpc.c \
|
|
181 mc-code-mips.c
|
|
182
|
|
183 clean :
|
|
184 -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
|
|
185
|
|
186 mc1 : b00.s b01.s mc-codegen.o mc-tree.o mc-switch.o mc-macro.o mc-inline.o $(CONVERTER)
|
|
187 $(CC) -g -o $@ $(PRINTF) b00.s b01.s mc-codegen.o mc-tree.o mc-switch.o mc-macro.o mc-inline.o $(CONVERTER)
|
|
188
|
|
189 mc2 : b00.s b01.s b02.s b03.s mc-macro.o mc-inline.o $(CONVERTER)
|
|
190 $(CC) -g -o $@ $(PRINTF) b00.s b01.s b02.s b03.s b04.s mc-macro.o mc-inline.o $(CONVERTER)
|
|
191
|
|
192 b00.s : mc-parse.c $(MC)
|
|
193 ./$(MC) -s -ob00.s mc-parse.c
|
|
194 b01.s : $(CODE) $(MC)
|
|
195 ./$(MC) -s -ob01.s $(CODE)
|
|
196 b02.s : mc-codegen.c $(MC)
|
|
197 ./$(MC) -s -ob02.s mc-codegen.c
|
|
198 b03.s : mc-tree.c $(MC)
|
|
199 ./$(MC) -s -ob03.s mc-tree.c
|
|
200 b04.s : mc-switch.c $(MC)
|
|
201 ./$(MC) -s -ob04.s mc-switch.c
|
|
202
|
|
203 b10.s : mc-parse.c mc1
|
|
204 ./mc1 -s -ob10.s mc-parse.c
|
|
205 b11.s : $(CODE) $(PRINTF) mc1
|
|
206 ./mc1 -s -ob11.s $(CODE)
|
|
207 b12.s : mc-codegen.c mc1
|
|
208 ./mc1 -s -ob12.s mc-codegen.c
|
|
209 b13.s : mc-tree.c mc1
|
|
210 ./mc1 -s -ob13.s mc-tree.c
|
|
211 b14.s : mc-switch.c mc1
|
|
212 ./mc1 -s -ob14.s mc-switch.c
|
|
213
|
|
214 b20.s : mc-parse.c mc2
|
|
215 ./mc2 -s -ob20.s mc-parse.c
|
|
216 b21.s : $(CODE) $(PRINTF) mc2
|
|
217 ./mc2 -s -ob21.s $(CODE)
|
|
218 b22.s : mc-codegen.c mc2
|
|
219 ./mc2 -s -ob22.s mc-codegen.c
|
|
220 b23.s : mc-tree.c mc2
|
|
221 ./mc2 -s -ob23.s mc-tree.c
|
|
222 b24.s : mc-switch.c mc1
|
|
223 ./mc2 -s -ob24.s mc-switch.c
|
|
224
|
|
225 diff : b00.s b01.s b02.s b03.s b04.s b10.s b11.s b12.s b13.s b14.s
|
|
226 -diff b00.s b10.s
|
|
227 -diff b01.s b11.s
|
|
228 -diff b02.s b12.s
|
|
229 -diff b03.s b13.s
|
|
230 -diff b04.s b14.s
|
|
231
|
|
232 diff2 : b00.s b01.s b02.s b03.s b04.s b20.s b21.s b22.s b23.s b24.s
|
|
233 -diff b00.s b20.s
|
|
234 -diff b01.s b21.s
|
|
235 -diff b02.s b22.s
|
|
236 -diff b03.s b23.s
|
|
237 -diff b04.s b24.s
|
|
238
|
|
239
|
|
240 # DO NOT DELETE
|
|
241
|
|
242 mc-code-ia32.o: /usr/include/stdio.h /usr/include/features.h
|
|
243 mc-code-ia32.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
|
|
244 mc-code-ia32.o: /usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h
|
|
245 mc-code-ia32.o: /usr/include/bits/types.h /usr/include/libio.h
|
|
246 mc-code-ia32.o: /usr/include/_G_config.h /usr/include/wchar.h
|
|
247 mc-code-ia32.o: /usr/include/bits/wchar.h /usr/include/gconv.h
|
|
248 mc-code-ia32.o: /usr/lib/gcc-lib/i386-linux/2.95.4/include/stdarg.h
|
|
249 mc-code-ia32.o: /usr/include/bits/stdio_lim.h mc.h mc-parse.h mc-codegen.h
|
|
250 mc-code-ia32.o: mc-code.h
|
|
251 mc-codegen.o: /usr/include/stdio.h /usr/include/features.h
|
|
252 mc-codegen.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
|
|
253 mc-codegen.o: /usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h
|
|
254 mc-codegen.o: /usr/include/bits/types.h /usr/include/libio.h
|
|
255 mc-codegen.o: /usr/include/_G_config.h /usr/include/wchar.h
|
|
256 mc-codegen.o: /usr/include/bits/wchar.h /usr/include/gconv.h
|
|
257 mc-codegen.o: /usr/lib/gcc-lib/i386-linux/2.95.4/include/stdarg.h
|
|
258 mc-codegen.o: /usr/include/bits/stdio_lim.h mc.h mc-parse.h mc-codegen.h
|
|
259 mc-codegen.o: mc-code.h mc-switch.h mc-inline.h
|
|
260 mc-parse.o: /usr/include/stdio.h /usr/include/features.h
|
|
261 mc-parse.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
|
|
262 mc-parse.o: /usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h
|
|
263 mc-parse.o: /usr/include/bits/types.h /usr/include/libio.h
|
|
264 mc-parse.o: /usr/include/_G_config.h /usr/include/wchar.h
|
|
265 mc-parse.o: /usr/include/bits/wchar.h /usr/include/gconv.h
|
|
266 mc-parse.o: /usr/lib/gcc-lib/i386-linux/2.95.4/include/stdarg.h
|
|
267 mc-parse.o: /usr/include/bits/stdio_lim.h mc.h mc-parse.h mc-codegen.h
|
|
268 mc-parse.o: mc-switch.h mc-macro.h mc-inline.h conv/conv.h
|
|
269 mc-tree.o: /usr/include/stdio.h /usr/include/features.h
|
|
270 mc-tree.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
|
|
271 mc-tree.o: /usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h
|
|
272 mc-tree.o: /usr/include/bits/types.h /usr/include/libio.h
|
|
273 mc-tree.o: /usr/include/_G_config.h /usr/include/wchar.h
|
|
274 mc-tree.o: /usr/include/bits/wchar.h /usr/include/gconv.h
|
|
275 mc-tree.o: /usr/lib/gcc-lib/i386-linux/2.95.4/include/stdarg.h
|
|
276 mc-tree.o: /usr/include/bits/stdio_lim.h mc.h mc-parse.h
|
|
277 mc-switch.o: /usr/include/stdio.h /usr/include/features.h
|
|
278 mc-switch.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
|
|
279 mc-switch.o: /usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h
|
|
280 mc-switch.o: /usr/include/bits/types.h /usr/include/libio.h
|
|
281 mc-switch.o: /usr/include/_G_config.h /usr/include/wchar.h
|
|
282 mc-switch.o: /usr/include/bits/wchar.h /usr/include/gconv.h
|
|
283 mc-switch.o: /usr/lib/gcc-lib/i386-linux/2.95.4/include/stdarg.h
|
|
284 mc-switch.o: /usr/include/bits/stdio_lim.h mc.h mc-parse.h mc-codegen.h
|
|
285 mc-switch.o: mc-code.h
|
|
286 mc-macro.o: /usr/include/stdio.h /usr/include/features.h
|
|
287 mc-macro.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
|
|
288 mc-macro.o: /usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h
|
|
289 mc-macro.o: /usr/include/bits/types.h /usr/include/libio.h
|
|
290 mc-macro.o: /usr/include/_G_config.h /usr/include/wchar.h
|
|
291 mc-macro.o: /usr/include/bits/wchar.h /usr/include/gconv.h
|
|
292 mc-macro.o: /usr/lib/gcc-lib/i386-linux/2.95.4/include/stdarg.h
|
|
293 mc-macro.o: /usr/include/bits/stdio_lim.h mc.h mc-parse.h mc-macro.h
|
|
294 mc-macro.o: mc-codegen.h mc-code.h
|
|
295 conv/c.o: /usr/include/stdio.h /usr/include/features.h
|
|
296 conv/c.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
|
|
297 conv/c.o: /usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h
|
|
298 conv/c.o: /usr/include/bits/types.h /usr/include/libio.h
|
|
299 conv/c.o: /usr/include/_G_config.h /usr/include/wchar.h
|
|
300 conv/c.o: /usr/include/bits/wchar.h /usr/include/gconv.h
|
|
301 conv/c.o: /usr/lib/gcc-lib/i386-linux/2.95.4/include/stdarg.h
|
|
302 conv/c.o: /usr/include/bits/stdio_lim.h mc.h mc-parse.h conv/conv.h
|
|
303 conv/c.o: conv/convdef.h conv/c.h
|
|
304 conv/c2cbc.o: mc.h
|
|
305 conv/cbc2c.o: mc.h
|
|
306 conv/null.o: /usr/include/stdio.h /usr/include/features.h
|
|
307 conv/null.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
|
|
308 conv/null.o: /usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h
|
|
309 conv/null.o: /usr/include/bits/types.h /usr/include/libio.h
|
|
310 conv/null.o: /usr/include/_G_config.h /usr/include/wchar.h
|
|
311 conv/null.o: /usr/include/bits/wchar.h /usr/include/gconv.h
|
|
312 conv/null.o: /usr/lib/gcc-lib/i386-linux/2.95.4/include/stdarg.h
|
|
313 conv/null.o: /usr/include/bits/stdio_lim.h mc.h mc-parse.h conv/conv.h
|
|
314 conv/null.o: conv/convdef.h conv/null.h
|
|
315 mc-code-powerpc.o: /usr/include/stdio.h /usr/include/features.h
|
|
316 mc-code-powerpc.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
|
|
317 mc-code-powerpc.o: /usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h
|
|
318 mc-code-powerpc.o: /usr/include/bits/types.h /usr/include/libio.h
|
|
319 mc-code-powerpc.o: /usr/include/_G_config.h /usr/include/wchar.h
|
|
320 mc-code-powerpc.o: /usr/include/bits/wchar.h /usr/include/gconv.h
|
|
321 mc-code-powerpc.o: /usr/lib/gcc-lib/i386-linux/2.95.4/include/stdarg.h
|
|
322 mc-code-powerpc.o: /usr/include/bits/stdio_lim.h mc.h mc-parse.h mc-code.h
|
|
323 mc-code-powerpc.o: mc-codegen.h
|
|
324 mc-code-mips.o: /usr/include/stdio.h /usr/include/features.h
|
|
325 mc-code-mips.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
|
|
326 mc-code-mips.o: /usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h
|
|
327 mc-code-mips.o: /usr/include/bits/types.h /usr/include/libio.h
|
|
328 mc-code-mips.o: /usr/include/_G_config.h /usr/include/wchar.h
|
|
329 mc-code-mips.o: /usr/include/bits/wchar.h /usr/include/gconv.h
|
|
330 mc-code-mips.o: /usr/lib/gcc-lib/i386-linux/2.95.4/include/stdarg.h
|
|
331 mc-code-mips.o: /usr/include/bits/stdio_lim.h mc.h mc-parse.h mc-code.h
|
|
332 mc-code-mips.o: mc-codegen.h
|