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