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