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