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