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