-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.old
328 lines (241 loc) · 6.83 KB
/
Makefile.old
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
# Used for project1 by Scott Lorberbaum
#
# This makefile includes an entry "depend" which will automatically
# generate complete include file dependencies (including nested
# includes. To update dependencies, simply update the SRCS variable
# (and OBJS) and type "make depend"
#
TARGETDIR = .
#
# Use gcc for Motif compilations.
#CC = /usr/local/bin/gcc-8
#CC = /usr/bin/gcc
CC = /usr/bin/g++
#BISON = /usr/local/opt/bison@2.7/bin/bison
BISON = /usr/bin/bison
#FLEX = /usr/local/opt/flex/bin/flex
FLEX = /usr/bin/flex++
MYUCC = "./ucc"
#CFLAGS = -g -ggdb -I/usr/local/opt/bison@2.7/include -D DEBUGON
#CFLAGS = -g -ggdb -D DEBUGOFF
#CFLAGS = -g -ggdb -D DEBUGON
CPPFLAGS= -std=c++11 -Wno-deprecated-register
CFLAGS0 = -O0 $(CPPFLAGS)
CFLAGS1 = -O1 $(CPPFLAGS)
CFLAGS2 = -O2 $(CPPFLAGS)
CFLAGS3 = -O3 $(CPPFLAGS)
CFLAGSF = -Ofast $(CPPFLAGS)
CFLAGSS = -Os $(CPPFLAGS)
CFLAGSZ = -Oz $(CPPFLAGS)
CFLAGSG = -Og $(CPPFLAGS)
#LDFLAGS = -g -L/usr/local/opt/bison@2.7/lib -lc -L/usr/local/opt/flex/lib
#LDFLAGS = -g -lc
FLOP =
BISOP = -vytdg -o ucc.tab.cpp
#LIBS = -lfl -lm
LIBS = -ll -lm
all: ucc0 ucc1 ucc2 ucc3 uccf uccs uccz uccg
main.c : main.h ucc.tab.cpp
trans0.o: trans.cpp trans.hpp
$(CC) $(CFLAGS0) -c $< -o $@
trans1.o: trans.cpp trans.hpp
$(CC) $(CFLAGS1) -c $< -o $@
trans2.o: trans.cpp trans.hpp
$(CC) $(CFLAGS2) -c $< -o $@
trans3.o: trans.cpp trans.hpp
$(CC) $(CFLAGS3) -c $< -o $@
transf.o: trans.cpp trans.hpp
$(CC) $(CFLAGSF) -c $< -o $@
transs.o: trans.cpp trans.hpp
$(CC) $(CFLAGSS) -c $< -o $@
transz.o: trans.cpp trans.hpp
$(CC) $(CFLAGSZ) -c $< -o $@
transg.o: trans.cpp trans.hpp
$(CC) $(CFLAGSG) -c $< -o $@
ucc.tab.cpp : ucc.ypp
$(BISON) $(BISOP) $^
lex.yy.cc : ucc.l ucc.tab.cpp
$(FLEX) $(FLOP) ucc.l
lex0.yy.o: lex.yy.cc
$(CC) $(CFLAGS0) -c $< -o $@
lex1.yy.o: lex.yy.cc
$(CC) $(CFLAGS1) -c $< -o $@
lex2.yy.o: lex.yy.cc
$(CC) $(CFLAGS2) -c $< -o $@
lex3.yy.o: lex.yy.cc
$(CC) $(CFLAGS3) -c $< -o $@
lexf.yy.o: lex.yy.cc
$(CC) $(CFLAGSF) -c $< -o $@
lexs.yy.o: lex.yy.cc
$(CC) $(CFLAGSS) -c $< -o $@
lexz.yy.o: lex.yy.cc
$(CC) $(CFLAGSZ) -c $< -o $@
lexg.yy.o: lex.yy.cc
$(CC) $(CFLAGSG) -c $< -o $@
ucc0.tab.o: ucc.tab.cpp
$(CC) $(CFLAGS0) -c $< -o $@
ucc1.tab.o: ucc.tab.cpp
$(CC) $(CFLAGS1) -c $< -o $@
ucc2.tab.o: ucc.tab.cpp
$(CC) $(CFLAGS2) -c $< -o $@
ucc3.tab.o: ucc.tab.cpp
$(CC) $(CFLAGS3) -c $< -o $@
uccf.tab.o: ucc.tab.cpp
$(CC) $(CFLAGSF) -c $< -o $@
uccs.tab.o: ucc.tab.cpp
$(CC) $(CFLAGSS) -c $< -o $@
uccz.tab.o: ucc.tab.cpp
$(CC) $(CFLAGSZ) -c $< -o $@
uccg.tab.o: ucc.tab.cpp
$(CC) $(CFLAGSG) -c $< -o $@
symtab0.o: symtab.cpp symtab.hpp
$(CC) $(CFLAGS0) -c $< -o $@
symtab1.o: symtab.cpp symtab.hpp
$(CC) $(CFLAGS1) -c $< -o $@
symtab2.o: symtab.cpp symtab.hpp
$(CC) $(CFLAGS2) -c $< -o $@
symtab3.o: symtab.cpp symtab.hpp
$(CC) $(CFLAGS3) -c $< -o $@
symtabf.o: symtab.cpp symtab.hpp
$(CC) $(CFLAGSF) -c $< -o $@
symtabs.o: symtab.cpp symtab.hpp
$(CC) $(CFLAGSS) -c $< -o $@
symtabz.o: symtab.cpp symtab.hpp
$(CC) $(CFLAGSZ) -c $< -o $@
symtabg.o: symtab.cpp symtab.hpp
$(CC) $(CFLAGSG) -c $< -o $@
List0.o: List.cpp List.hpp
$(CC) $(CFLAGS0) -c $< -o $@
List1.o: List.cpp List.hpp
$(CC) $(CFLAGS1) -c $< -o $@
List2.o: List.cpp List.hpp
$(CC) $(CFLAGS2) -c $< -o $@
List3.o: List.cpp List.hpp
$(CC) $(CFLAGS3) -c $< -o $@
Listf.o: List.cpp List.hpp
$(CC) $(CFLAGSF) -c $< -o $@
Lists.o: List.cpp List.hpp
$(CC) $(CFLAGSS) -c $< -o $@
Listz.o: List.cpp List.hpp
$(CC) $(CFLAGSZ) -c $< -o $@
Listg.o: List.cpp List.hpp
$(CC) $(CFLAGSG) -c $< -o $@
command0.o: command.cpp command.hpp
$(CC) $(CFLAGS0) -c $< -o $@
command1.o: command.cpp command.hpp
$(CC) $(CFLAGS1) -c $< -o $@
command2.o: command.cpp command.hpp
$(CC) $(CFLAGS2) -c $< -o $@
command3.o: command.cpp command.hpp
$(CC) $(CFLAGS3) -c $< -o $@
commandf.o: command.cpp command.hpp
$(CC) $(CFLAGSF) -c $< -o $@
commands.o: command.cpp command.hpp
$(CC) $(CFLAGSS) -c $< -o $@
commandz.o: command.cpp command.hpp
$(CC) $(CFLAGSZ) -c $< -o $@
commandg.o: command.cpp command.hpp
$(CC) $(CFLAGSG) -c $< -o $@
MAIN = main.c
SRCS = lex.yy.cc \
main.c \
symtab.cpp \
List.cpp \
command.cpp \
trans.cpp \
ucc.tab.cpp
OBJS0 = lex0.yy.o \
symtab0.o \
List0.o \
command0.o \
trans0.o \
ucc0.tab.o
OBJS1 = symtab1.o \
List1.o \
command1.o \
trans1.o \
lex1.yy.o \
ucc1.tab.o
OBJS2 = symtab2.o \
List2.o \
command2.o \
trans2.o \
lex2.yy.o \
ucc2.tab.o
OBJS3 = symtab3.o \
List3.o \
command3.o \
trans3.o \
lex3.yy.o \
ucc3.tab.o
OBJSF = symtabf.o \
Listf.o \
commandf.o \
transf.o \
lexf.yy.o \
uccf.tab.o
OBJSS = symtabs.o \
Lists.o \
commands.o \
transs.o \
lexs.yy.o \
uccs.tab.o
OBJSZ = symtabz.o \
Listz.o \
commandz.o \
transz.o \
lexz.yy.o \
uccz.tab.o
OBJSG = symtabg.o \
Listg.o \
commandg.o \
transg.o \
lexg.yy.o \
uccg.tab.o
sample$(NUM) : sample$(NUM).c
$(MYUCC) sample$(NUM).c
clean :
rm *.o lex.yy.cc ucc.tab.* ucc.output ucc0 ucc1 ucc2 ucc3 uccf uccs uccz uccg example core test *.out *.asm; rm -rf *.dSYM;
ucc0 : $(OBJS0) $(MAIN)
$(CC) $(CFLAGS0) $(LDFLAGS) -o $(TARGETDIR)/$@ $(OBJS0) $(MAIN) $(LIBS)
ucc1 : $(OBJS1) $(MAIN)
$(CC) $(CFLAGS1) $(LDFLAGS) -o $(TARGETDIR)/$@ $(OBJS1) $(MAIN) $(LIBS)
ucc2 : $(OBJS2) $(MAIN)
$(CC) $(CFLAGS2) $(LDFLAGS) -o $(TARGETDIR)/$@ $(OBJS2) $(MAIN) $(LIBS)
ucc3 : $(OBJS3) $(MAIN)
$(CC) $(CFLAGS3) $(LDFLAGS) -o $(TARGETDIR)/$@ $(OBJS3) $(MAIN) $(LIBS)
uccf : $(OBJSF) $(MAIN)
$(CC) $(CFLAGSF) $(LDFLAGS) -o $(TARGETDIR)/$@ $(OBJSF) $(MAIN) $(LIBS)
uccs : $(OBJSS) $(MAIN)
$(CC) $(CFLAGSS) $(LDFLAGS) -o $(TARGETDIR)/$@ $(OBJSS) $(MAIN) $(LIBS)
uccz : $(OBJSZ) $(MAIN)
$(CC) $(CFLAGSZ) $(LDFLAGS) -o $(TARGETDIR)/$@ $(OBJSZ) $(MAIN) $(LIBS)
uccg : $(OBJSG) $(MAIN)
$(CC) $(CFLAGSG) $(LDFLAGS) -o $(TARGETDIR)/$@ $(OBJSG) $(MAIN) $(LIBS)
example: $(OBJS) $(MAIN) symtab.o example.c List.o
$(CC) $(CFLAGS) $(LDFLAGS) -o $(TARGETDIR)/$@ $(OBJS) example.c $(LIBS)
# if (/bin/test -w $@) then (rm $@) else (:) fi
#
# make depend
#
# The depend switch varies (unfortunately) for different C compilers.
# -Em is used by DEC,
# -M by Sun
#DEPEND = -Em
#DEPEND = -M
DEPEND = -MM
depend:
sed -e "/^#=====DO NOT DELETE THIS LINE=====/q" Makefile > Makefile.new
$(CC) $(CFLAGS) $(DEPEND) $(SRCS) >> Makefile.new
# gcc $(CFLAGS) $(DEPEND) $(SRCS) >> Makefile.new
mv Makefile.new Makefile
#=====DO NOT DELETE THIS LINE=====
lex.yy.o: lex.yy.cc List.hpp type.h expr.h symtab.hpp main.h data.h trans.hpp \
ucc.tab.h
ucc.tab.o: ucc.tab.cpp type.h List.hpp expr.h symtab.hpp main.h data.h trans.hpp \
main.o: main.c data.h symtab.hpp List.hpp type.h expr.h main.h trans.hpp \
ucc.tab.h command.hpp
symtab.o: symtab.cpp symtab.hpp List.hpp type.h expr.h main.h data.h trans.hpp \
List.o: List.cpp List.hpp type.h expr.h
command.o: command.cpp command.hpp
trans.o: trans.cpp trans.hpp