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