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
|
94
|
22 mc-powerpc : mc-code-powerpc.o $(COMPLIB) $(CONVERTER)
|
|
23 $(CC) -g mc-code-powerpc.o $(COMPLIB) $(CONVERTER) -o $@
|
|
24
|
|
25 mc-ia32 : mc-code-ia32.o $(COMPLIB) $(CONVERTER)
|
|
26 $(CC) -g mc-code-ia32.o $(COMPLIB) $(CONVERTER) -o $@
|
61
|
27
|
130
|
28 mc-mips : mc-code-mips.o $(COMPLIB) $(CONVERTER)
|
|
29 $(CC) -g mc-code-mips.o $(COMPLIB) $(CONVERTER) -o $@
|
|
30
|
82
|
31 conv/conv.h: conv_func.tbl conv_func.pl
|
67
|
32 perl conv_func.pl
|
82
|
33 conv/convdef.h: conv_func.tbl conv_func.pl
|
|
34 perl conv_func.pl
|
|
35 conv/null.c: conv_func.tbl conv_func.pl
|
67
|
36 perl conv_func.pl
|
|
37
|
118
|
38 check-all:
|
|
39 make check TARGET=test/basic
|
|
40 make check TARGET=test/call
|
|
41 make check TARGET=test/fact0
|
|
42 make check TARGET=test/float
|
|
43 make check TARGET=test/ifdef
|
|
44 make check TARGET=test/int
|
|
45 make check TARGET=test/macro
|
|
46 make check TARGET=test/regargs
|
|
47 make check TARGET=test/simp
|
|
48 make check TARGET=test/simp0
|
|
49 make check TARGET=test/tmp
|
|
50 make check TARGET=test/tmp10
|
|
51 make check TARGET=test/tmp11
|
|
52 make check TARGET=test/tmp7
|
|
53 make check TARGET=test/tmp8
|
|
54 make check TARGET=test/tmp9
|
158
|
55 make check TARGET=test/static
|
118
|
56
|
122
|
57 check: $(MC)
|
126
|
58 -gcc $(TARGET).c -o b.out $(MLIB)
|
123
|
59 -./b.out > $(TARGET).gcc.out
|
|
60 -./$(MC) -s $(TARGET).c
|
127
|
61 -gcc $(TARGET).s $(MLIB)
|
123
|
62 -./a.out > $(TARGET).$(MC).out
|
118
|
63 -diff $(TARGET).gcc.out $(TARGET).$(MC).out
|
|
64
|
0
|
65 tar :
|
|
66 make clean
|
|
67 tar cBf - . | gzip > ../comp.tgz
|
|
68
|
|
69 depend :
|
67
|
70 makedepend mc-code-ia32.c mc-code.h mc-codegen.c mc-codegen.h \
|
|
71 mc-parse.c mc-tree.c mc.h \
|
|
72 conv/c.c conv/c.h conv/c2cbc.c conv/c2cbc.h conv/cbc2c.c \
|
93
|
73 conv/cbc2c.h conv/conv.h conv/convdef.h conv/null.c conv/null.h \
|
150
|
74 mc-code-powerpc.c \
|
|
75 mc-code-mips.c
|
0
|
76
|
|
77 clean :
|
140
|
78 -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
|
79
|
78
|
80 mc1 : b00.s b01.s mc-codegen.o mc-tree.o $(CONVERTER)
|
|
81 $(CC) -g -o $@ $(PRINTF) b00.s b01.s mc-codegen.o mc-tree.o $(CONVERTER)
|
140
|
82
|
|
83 mc2 : b00.s b01.s b02.s b03.s mc-codegen.o mc-tree.o $(CONVERTER)
|
|
84 $(CC) -g -o $@ $(PRINTF) b00.s b01.s b02.s b03.s $(CONVERTER)
|
|
85
|
94
|
86 b00.s : mc-parse.c $(MC)
|
|
87 ./$(MC) -s -ob00.s mc-parse.c
|
109
|
88 b01.s : $(CODE) $(MC)
|
|
89 ./$(MC) -s -ob01.s $(CODE)
|
140
|
90 b02.s : mc-codegen.c $(MC)
|
|
91 ./$(MC) -s -ob02.s mc-codegen.c
|
|
92 b03.s : mc-tree.c $(MC)
|
|
93 ./$(MC) -s -ob03.s mc-tree.c
|
|
94
|
0
|
95 b10.s : mc-parse.c mc1
|
65
|
96 ./mc1 -s -ob10.s mc-parse.c
|
109
|
97 b11.s : $(CODE) $(PRINTF) mc1
|
|
98 ./mc1 -s -ob11.s $(CODE)
|
140
|
99 b12.s : mc-codegen.c mc1
|
|
100 ./mc1 -s -ob12.s mc-codegen.c
|
|
101 b13.s : mc-tree.c mc1
|
|
102 ./mc1 -s -ob13.s mc-tree.c
|
0
|
103
|
140
|
104 b20.s : mc-parse.c mc2
|
|
105 ./mc2 -s -ob20.s mc-parse.c
|
|
106 b21.s : $(CODE) $(PRINTF) mc2
|
|
107 ./mc2 -s -ob21.s $(CODE)
|
|
108 b22.s : mc-codegen.c mc2
|
|
109 ./mc2 -s -ob22.s mc-codegen.c
|
|
110 b23.s : mc-tree.c mc2
|
|
111 ./mc2 -s -ob23.s mc-tree.c
|
|
112
|
|
113 diff : b00.s b01.s b02.s b03.s b10.s b11.s b12.s b13.s
|
0
|
114 -diff b00.s b10.s
|
|
115 -diff b01.s b11.s
|
140
|
116 -diff b02.s b12.s
|
|
117 -diff b03.s b13.s
|
|
118
|
|
119 diff2 : b00.s b01.s b02.s b03.s b20.s b21.s b22.s b23.s
|
|
120 -diff b00.s b20.s
|
|
121 -diff b01.s b21.s
|
|
122 -diff b02.s b22.s
|
|
123 -diff b03.s b23.s
|
|
124
|
67
|
125
|
0
|
126 # DO NOT DELETE
|
|
127
|
127
|
128 mc-code-ia32.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
129 mc-code-ia32.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
130 mc-code-ia32.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
131 mc-code-ia32.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
132 mc-code-ia32.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
|
133 mc-code-ia32.o: conv/conv.h mc-codegen.h mc-code.h
|
|
134 mc-codegen.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
135 mc-codegen.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
136 mc-codegen.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
137 mc-codegen.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
138 mc-codegen.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
|
139 mc-codegen.o: conv/conv.h mc-codegen.h mc-code.h
|
|
140 mc-parse.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
141 mc-parse.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
142 mc-parse.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
143 mc-parse.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
144 mc-parse.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
|
145 mc-parse.o: conv/conv.h mc-codegen.h
|
|
146 mc-tree.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
147 mc-tree.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
148 mc-tree.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
149 mc-tree.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
150 mc-tree.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
|
151 mc-tree.o: conv/conv.h
|
|
152 mc.o: /usr/include/stdio.h /usr/include/sys/types.h
|
|
153 mc.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
154 mc.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
155 mc.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
156 mc.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h conv/conv.h
|
|
157 conv/c.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
158 conv/c.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
159 conv/c.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
160 conv/c.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
161 conv/c.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h conv/conv.h
|
|
162 conv/c.o: conv/convdef.h conv/c.h
|
|
163 conv/c2cbc.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
164 conv/c2cbc.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
165 conv/c2cbc.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
166 conv/c2cbc.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
167 conv/c2cbc.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
|
168 conv/c2cbc.o: conv/conv.h
|
|
169 conv/cbc2c.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
170 conv/cbc2c.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
171 conv/cbc2c.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
172 conv/cbc2c.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
173 conv/cbc2c.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
|
174 conv/cbc2c.o: conv/conv.h
|
|
175 conv/null.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
176 conv/null.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
177 conv/null.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
178 conv/null.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
179 conv/null.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
|
180 conv/null.o: conv/conv.h conv/convdef.h conv/null.h
|
|
181 mc-code-powerpc.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
182 mc-code-powerpc.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
183 mc-code-powerpc.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
184 mc-code-powerpc.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
185 mc-code-powerpc.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
|
186 mc-code-powerpc.o: conv/conv.h mc-code.h mc-codegen.h
|
150
|
187 mc-code-mips.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
188 mc-code-mips.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
189 mc-code-mips.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
190 mc-code-mips.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
191 mc-code-mips.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
|
192 mc-code-mips.o: conv/conv.h mc-code.h mc-codegen.h
|