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