0
|
1 CC = gcc
|
59
|
2 CFLAGS = -g -Wall -I.
|
0
|
3 BASE=0
|
|
4 STAGE=1
|
|
5 MFLAGS=$(MFALGS) BASE=$(BASE) STAGE=$(STAGE)
|
|
6 MC=mc
|
|
7 PRINTF= # printf.c
|
82
|
8 CONVERTER=conv/c.o conv/null.o
|
|
9 # conv/c2cbc.o conv/cbc2c.o
|
94
|
10 COMPLIB = mc-parse.o mc-codegen.o mc-tree.o
|
109
|
11 # CODE=mc-code-ia32.c
|
|
12 CODE=mc-code-powerpc.c
|
93
|
13
|
94
|
14 all: mc mc-ia32 mc-powerpc
|
|
15
|
|
16 mc: mc-powerpc
|
|
17 cp mc-powerpc mc
|
0
|
18
|
94
|
19 mc-powerpc : mc-code-powerpc.o $(COMPLIB) $(CONVERTER)
|
|
20 $(CC) -g mc-code-powerpc.o $(COMPLIB) $(CONVERTER) -o $@
|
|
21
|
|
22 mc-ia32 : mc-code-ia32.o $(COMPLIB) $(CONVERTER)
|
|
23 $(CC) -g mc-code-ia32.o $(COMPLIB) $(CONVERTER) -o $@
|
61
|
24
|
82
|
25 conv/conv.h: conv_func.tbl conv_func.pl
|
67
|
26 perl conv_func.pl
|
82
|
27 conv/convdef.h: conv_func.tbl conv_func.pl
|
|
28 perl conv_func.pl
|
|
29 conv/null.c: conv_func.tbl conv_func.pl
|
67
|
30 perl conv_func.pl
|
|
31
|
118
|
32 check-all:
|
|
33 make check TARGET=test/basic
|
|
34 make check TARGET=test/call
|
|
35 make check TARGET=test/fact0
|
|
36 make check TARGET=test/float
|
|
37 make check TARGET=test/ifdef
|
|
38 make check TARGET=test/int
|
|
39 make check TARGET=test/macro
|
|
40 make check TARGET=test/regargs
|
|
41 make check TARGET=test/simp
|
|
42 make check TARGET=test/simp0
|
|
43 make check TARGET=test/tmp
|
|
44 make check TARGET=test/tmp10
|
|
45 make check TARGET=test/tmp11
|
|
46 make check TARGET=test/tmp7
|
|
47 make check TARGET=test/tmp8
|
|
48 make check TARGET=test/tmp9
|
|
49
|
122
|
50 check: $(MC)
|
118
|
51 -gcc $(TARGET).c -o b.out
|
|
52 -b.out > $(TARGET).gcc.out
|
|
53 -$(MC) -s $(TARGET).c
|
|
54 -gcc $(TARGET).s
|
|
55 -a.out > $(TARGET).$(MC).out
|
|
56 -diff $(TARGET).gcc.out $(TARGET).$(MC).out
|
|
57
|
0
|
58 tar :
|
|
59 make clean
|
|
60 tar cBf - . | gzip > ../comp.tgz
|
|
61
|
|
62 depend :
|
67
|
63 makedepend mc-code-ia32.c mc-code.h mc-codegen.c mc-codegen.h \
|
|
64 mc-parse.c mc-tree.c mc.h \
|
|
65 conv/c.c conv/c.h conv/c2cbc.c conv/c2cbc.h conv/cbc2c.c \
|
93
|
66 conv/cbc2c.h conv/conv.h conv/convdef.h conv/null.c conv/null.h \
|
|
67 mc-code-powerpc.c
|
0
|
68
|
|
69 clean :
|
118
|
70 -rm -f mc mc-ia32 mc-powerpc *.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
|
0
|
71
|
78
|
72 mc1 : b00.s b01.s mc-codegen.o mc-tree.o $(CONVERTER)
|
|
73 $(CC) -g -o $@ $(PRINTF) b00.s b01.s mc-codegen.o mc-tree.o $(CONVERTER)
|
94
|
74 b00.s : mc-parse.c $(MC)
|
|
75 ./$(MC) -s -ob00.s mc-parse.c
|
109
|
76 b01.s : $(CODE) $(MC)
|
|
77 ./$(MC) -s -ob01.s $(CODE)
|
0
|
78 b10.s : mc-parse.c mc1
|
65
|
79 ./mc1 -s -ob10.s mc-parse.c
|
109
|
80 b11.s : $(CODE) $(PRINTF) mc1
|
|
81 ./mc1 -s -ob11.s $(CODE)
|
0
|
82
|
|
83 diff : b00.s b01.s b10.s b11.s
|
|
84 -diff b00.s b10.s
|
|
85 -diff b01.s b11.s
|
67
|
86
|
0
|
87 # DO NOT DELETE
|
|
88
|
67
|
89 mc-code-ia32.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
90 mc-code-ia32.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
91 mc-code-ia32.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
92 mc-code-ia32.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
93 mc-code-ia32.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
93
|
94 mc-code-ia32.o: conv/conv.h mc-codegen.h
|
67
|
95 mc-codegen.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
96 mc-codegen.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
97 mc-codegen.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
98 mc-codegen.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
99 mc-codegen.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
93
|
100 mc-codegen.o: conv/conv.h mc-codegen.h mc-code.h
|
67
|
101 mc-parse.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
102 mc-parse.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
103 mc-parse.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
104 mc-parse.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
105 mc-parse.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
93
|
106 mc-parse.o: conv/conv.h mc-codegen.h
|
67
|
107 mc-tree.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
108 mc-tree.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
109 mc-tree.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
110 mc-tree.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
111 mc-tree.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
93
|
112 mc-tree.o: conv/conv.h
|
67
|
113 mc.o: /usr/include/stdio.h /usr/include/sys/types.h
|
|
114 mc.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
115 mc.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
116 mc.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
117 mc.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h conv/conv.h
|
|
118 conv/c.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
119 conv/c.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
120 conv/c.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
121 conv/c.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
122 conv/c.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h conv/conv.h
|
93
|
123 conv/c.o: conv/convdef.h conv/c.h
|
67
|
124 conv/c2cbc.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
125 conv/c2cbc.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
126 conv/c2cbc.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
127 conv/c2cbc.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
128 conv/c2cbc.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
93
|
129 conv/c2cbc.o: conv/conv.h
|
67
|
130 conv/cbc2c.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
131 conv/cbc2c.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
132 conv/cbc2c.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
133 conv/cbc2c.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
134 conv/cbc2c.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
93
|
135 conv/cbc2c.o: conv/conv.h
|
67
|
136 conv/null.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
137 conv/null.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
138 conv/null.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
139 conv/null.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
140 conv/null.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
93
|
141 conv/null.o: conv/conv.h conv/convdef.h conv/null.h
|
|
142 mc-code-powerpc.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
|
|
143 mc-code-powerpc.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
|
|
144 mc-code-powerpc.o: /usr/include/machine/types.h /usr/include/ppc/types.h
|
|
145 mc-code-powerpc.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
|
|
146 mc-code-powerpc.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
|
|
147 mc-code-powerpc.o: conv/conv.h mc-codegen.h
|