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
|
|
55
|
122
|
56 check: $(MC)
|
126
|
57 -gcc $(TARGET).c -o b.out $(MLIB)
|
123
|
58 -./b.out > $(TARGET).gcc.out
|
|
59 -./$(MC) -s $(TARGET).c
|
127
|
60 -gcc $(TARGET).s $(MLIB)
|
123
|
61 -./a.out > $(TARGET).$(MC).out
|
118
|
62 -diff $(TARGET).gcc.out $(TARGET).$(MC).out
|
|
63
|
0
|
64 tar :
|
|
65 make clean
|
|
66 tar cBf - . | gzip > ../comp.tgz
|
|
67
|
|
68 depend :
|
67
|
69 makedepend mc-code-ia32.c mc-code.h mc-codegen.c mc-codegen.h \
|
|
70 mc-parse.c mc-tree.c mc.h \
|
|
71 conv/c.c conv/c.h conv/c2cbc.c conv/c2cbc.h conv/cbc2c.c \
|
93
|
72 conv/cbc2c.h conv/conv.h conv/convdef.h conv/null.c conv/null.h \
|
|
73 mc-code-powerpc.c
|
0
|
74
|
|
75 clean :
|
138
|
76 -rm -f mc mc-ia32 mc-powerpc mc-mips *.bak *.s *.o *.cc mc mc1 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
|
77
|
78
|
78 mc1 : b00.s b01.s mc-codegen.o mc-tree.o $(CONVERTER)
|
|
79 $(CC) -g -o $@ $(PRINTF) b00.s b01.s mc-codegen.o mc-tree.o $(CONVERTER)
|
94
|
80 b00.s : mc-parse.c $(MC)
|
|
81 ./$(MC) -s -ob00.s mc-parse.c
|
109
|
82 b01.s : $(CODE) $(MC)
|
|
83 ./$(MC) -s -ob01.s $(CODE)
|
0
|
84 b10.s : mc-parse.c mc1
|
65
|
85 ./mc1 -s -ob10.s mc-parse.c
|
109
|
86 b11.s : $(CODE) $(PRINTF) mc1
|
|
87 ./mc1 -s -ob11.s $(CODE)
|
0
|
88
|
|
89 diff : b00.s b01.s b10.s b11.s
|
|
90 -diff b00.s b10.s
|
|
91 -diff b01.s b11.s
|
67
|
92
|
0
|
93 # DO NOT DELETE
|
|
94
|
127
|
95 mc-code-ia32.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
96 mc-code-ia32.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
97 mc-code-ia32.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
98 mc-code-ia32.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
99 mc-code-ia32.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
|
100 mc-code-ia32.o: conv/conv.h mc-codegen.h mc-code.h
|
|
101 mc-codegen.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
102 mc-codegen.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
103 mc-codegen.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
104 mc-codegen.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
105 mc-codegen.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
|
106 mc-codegen.o: conv/conv.h mc-codegen.h mc-code.h
|
|
107 mc-parse.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
108 mc-parse.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
109 mc-parse.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
110 mc-parse.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
111 mc-parse.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
|
112 mc-parse.o: conv/conv.h mc-codegen.h
|
|
113 mc-tree.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
114 mc-tree.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
115 mc-tree.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
116 mc-tree.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
117 mc-tree.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
|
118 mc-tree.o: conv/conv.h
|
|
119 mc.o: /usr/include/stdio.h /usr/include/sys/types.h
|
|
120 mc.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
121 mc.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
122 mc.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
123 mc.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h conv/conv.h
|
|
124 conv/c.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
125 conv/c.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
126 conv/c.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
127 conv/c.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
128 conv/c.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h conv/conv.h
|
|
129 conv/c.o: conv/convdef.h conv/c.h
|
|
130 conv/c2cbc.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
131 conv/c2cbc.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
132 conv/c2cbc.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
133 conv/c2cbc.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
134 conv/c2cbc.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
|
135 conv/c2cbc.o: conv/conv.h
|
|
136 conv/cbc2c.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
137 conv/cbc2c.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
138 conv/cbc2c.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
139 conv/cbc2c.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
140 conv/cbc2c.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
|
141 conv/cbc2c.o: conv/conv.h
|
|
142 conv/null.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
143 conv/null.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
144 conv/null.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
145 conv/null.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
146 conv/null.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
|
147 conv/null.o: conv/conv.h conv/convdef.h conv/null.h
|
|
148 mc-code-powerpc.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
149 mc-code-powerpc.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
150 mc-code-powerpc.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
151 mc-code-powerpc.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
152 mc-code-powerpc.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
|
153 mc-code-powerpc.o: conv/conv.h mc-code.h mc-codegen.h
|