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