1 # $Id: proto.make,v 1.6 1994/06/24 11:02:14 ceriel Exp $
5 #PARAMS do not remove this line!
10 $(SRC_HOME)/lang/cem/cemcom.ansi
12 $(SRC_HOME)/fast/f_c.ansi
14 TABGEN= $(UTIL_BIN)/tabgen
15 LLGEN = $(UTIL_BIN)/LLgen
19 SRC_G = $(SRC_DIR)/program.g $(SRC_DIR)/declar.g \
20 $(SRC_DIR)/expression.g $(SRC_DIR)/statement.g $(SRC_DIR)/ival.g
22 GFILES= $(GEN_G) $(SRC_G)
25 $(SRC_DIR)/Version.c \
27 $(SRC_DIR)/LLmessage.c \
34 $(SRC_DIR)/conversion.c \
35 $(SRC_DIR)/cstoper.c \
36 $(SRC_DIR)/dataflow.c \
37 $(SRC_DIR)/declarator.c \
38 $(SRC_DIR)/decspecs.c \
39 $(SRC_DIR)/domacro.c \
40 $(SRC_DIR)/dumpidf.c \
45 $(SRC_DIR)/fltcstoper.c \
49 $(SRC_DIR)/l_comment.c \
50 $(SRC_DIR)/l_ev_ord.c \
53 $(SRC_DIR)/l_outdef.c \
54 $(SRC_DIR)/l_states.c \
57 $(SRC_DIR)/options.c \
60 $(SRC_DIR)/replace.c \
66 $(SRC_DIR)/tokenname.c \
69 GEN_C = tokenfile.c program.c declar.c expression.c statement.c ival.c \
70 symbol2str.c char.c Lpars.c next.c
71 CFILES= $(SRC_C) $(GEN_C)
80 $(SRC_DIR)/decspecs.h \
81 $(SRC_DIR)/file_info.h \
83 $(SRC_DIR)/interface.h \
84 $(SRC_DIR)/l_class.h \
85 $(SRC_DIR)/l_comment.h \
92 $(SRC_DIR)/specials.h \
93 $(SRC_DIR)/tokenname.h
95 GEN_H = botch_free.h dataflow.h debug.h density.h errout.h \
96 idfsize.h ifdepth.h inputtype.h macbuf.h lint.h \
97 nobitfield.h nopp.h nocross.h \
98 nparams.h numsize.h parbufsize.h pathlength.h Lpars.h \
99 strsize.h trgt_sizes.h textsize.h use_tmp.h spec_arith.h static.h \
100 regcount.h dbsymtab.h \
101 code.h declar.h def.h expr.h field.h estack.h util.h proto.h replace.h \
102 idf.h macro.h stmt.h struct.h switch.h type.h l_brace.h l_state.h \
105 HFILES= $(GEN_H) $(SRC_H)
108 $(SRC_DIR)/code.str \
109 $(SRC_DIR)/declar.str \
111 $(SRC_DIR)/expr.str \
112 $(SRC_DIR)/field.str \
113 $(SRC_DIR)/estack.str \
114 $(SRC_DIR)/util.str \
115 $(SRC_DIR)/proto.str \
116 $(SRC_DIR)/replace.str \
118 $(SRC_DIR)/macro.str \
119 $(SRC_DIR)/stack.str \
120 $(SRC_DIR)/stmt.str \
121 $(SRC_DIR)/struct.str \
122 $(SRC_DIR)/switch.str \
123 $(SRC_DIR)/type.str \
124 $(SRC_DIR)/l_brace.str \
125 $(SRC_DIR)/l_state.str \
126 $(SRC_DIR)/l_outdef.str
129 make -f make.main main
132 cp main $(TARGET_HOME)/lib.bin/c_ce.ansi
135 -cmp main $(TARGET_HOME)/lib.bin/c_ce.ansi
141 @pr $(FSRC_DIR)/proto.make $(FSRC_DIR)/proto.main \
142 $(FSRC_DIR)/Parameters
145 make -f make.main lint
147 Cfiles: hfiles LLfiles $(GEN_C) $(GEN_H) Makefile
148 echo $(CFILES) | tr ' ' '\012' > Cfiles
149 echo $(HFILES) | tr ' ' '\012' >> Cfiles
152 CC="$(CC)" UTIL_HOME="$(UTIL_HOME)" do_resolve `cat Cfiles` > Cfiles.new
153 -if cmp -s Cfiles Cfiles.new ; then rm -f Cfiles.new ; else mv Cfiles.new Cfiles ; fi
156 # there is no file called "dependencies"; we want dependencies checked
157 # every time. This means that make.main is made every time. Oh well ...
158 # it does not take much time.
159 dependencies: resolved
160 do_deps `grep '.c$$' Cfiles`
162 make.main: dependencies make_macros lists $(FSRC_DIR)/proto.main
163 rm_deps $(FSRC_DIR)/proto.main | sed -e '/^.PARAMS/r make_macros' -e '/^.LISTS/r lists' > make.main
164 cat *.dep >> make.main
166 make_macros: Makefile
167 echo 'SRC_DIR=$(SRC_DIR)' > make_macros
168 echo 'UTIL_HOME=$(UTIL_HOME)' >> make_macros
169 echo 'TARGET_HOME=$(TARGET_HOME)' >> make_macros
170 echo 'CC=$(CC)' >> make_macros
171 echo 'COPTIONS=$(COPTIONS) -DPEEPHOLE' >> make_macros
172 echo 'LDOPTIONS=$(LDOPTIONS)' >> make_macros
173 echo 'LINT=$(LINT)' >> make_macros
174 echo 'LINTSUF=$(LINTSUF)' >> make_macros
175 echo 'LINTPREF=$(LINTPREF)' >> make_macros
176 echo 'LINTOPTIONS=$(LINTOPTIONS)' >> make_macros
177 echo 'SUF=$(SUF)' >> make_macros
178 echo 'LIBSUF=$(LIBSUF)' >> make_macros
179 echo 'CC_AND_MKDEP=$(CC_AND_MKDEP)' >> make_macros
180 echo 'MACH=$(MACH)' >> make_macros
183 echo "C_SRC = \\" > lists
184 echo $(CFILES) >> lists
185 echo "OBJ = \\" >> lists
186 echo $(CFILES) | sed -e 's|[^ ]*/||g' -e 's/\.c/.$$(SUF)/g' >> lists
189 -make -f make.main clean
190 rm -f $(GEN_C) $(GEN_G) $(GEN_H) hfiles LLfiles Cfiles LL.output
191 rm -f resolved *.dep lists make.main make_macros
194 $(LLGEN) $(LLGENOPTIONS) $(GFILES)
197 hfiles: $(FSRC_DIR)/Parameters $(SRC_DIR)/make.hfiles
198 $(SRC_DIR)/make.hfiles $(FSRC_DIR)/Parameters
201 tokenfile.g: $(SRC_DIR)/tokenname.c $(SRC_DIR)/make.tokfile
202 $(SRC_DIR)/make.tokfile <$(SRC_DIR)/tokenname.c >tokenfile.g
204 symbol2str.c: $(SRC_DIR)/tokenname.c $(SRC_DIR)/make.tokcase
205 $(SRC_DIR)/make.tokcase <$(SRC_DIR)/tokenname.c >symbol2str.c
207 code.h: $(SRC_DIR)/code.str $(SRC_DIR)/make.allocd
208 $(SRC_DIR)/make.allocd < $(SRC_DIR)/code.str > code.h
210 declar.h: $(SRC_DIR)/declar.str $(SRC_DIR)/make.allocd
211 $(SRC_DIR)/make.allocd < $(SRC_DIR)/declar.str > declar.h
213 def.h: $(SRC_DIR)/def.str $(SRC_DIR)/make.allocd
214 $(SRC_DIR)/make.allocd < $(SRC_DIR)/def.str > def.h
216 expr.h: $(SRC_DIR)/expr.str $(SRC_DIR)/make.allocd
217 $(SRC_DIR)/make.allocd < $(SRC_DIR)/expr.str > expr.h
219 field.h: $(SRC_DIR)/field.str $(SRC_DIR)/make.allocd
220 $(SRC_DIR)/make.allocd < $(SRC_DIR)/field.str > field.h
222 estack.h: $(SRC_DIR)/estack.str $(SRC_DIR)/make.allocd
223 $(SRC_DIR)/make.allocd < $(SRC_DIR)/estack.str > estack.h
225 util.h: $(SRC_DIR)/util.str $(SRC_DIR)/make.allocd
226 $(SRC_DIR)/make.allocd < $(SRC_DIR)/util.str > util.h
228 proto.h: $(SRC_DIR)/proto.str $(SRC_DIR)/make.allocd
229 $(SRC_DIR)/make.allocd < $(SRC_DIR)/proto.str > proto.h
231 replace.h: $(SRC_DIR)/replace.str $(SRC_DIR)/make.allocd
232 $(SRC_DIR)/make.allocd < $(SRC_DIR)/replace.str > replace.h
234 idf.h: $(SRC_DIR)/idf.str $(SRC_DIR)/make.allocd
235 $(SRC_DIR)/make.allocd < $(SRC_DIR)/idf.str > idf.h
237 macro.h: $(SRC_DIR)/macro.str $(SRC_DIR)/make.allocd
238 $(SRC_DIR)/make.allocd < $(SRC_DIR)/macro.str > macro.h
240 stack.h: $(SRC_DIR)/stack.str $(SRC_DIR)/make.allocd
241 $(SRC_DIR)/make.allocd < $(SRC_DIR)/stack.str > stack.h
243 stmt.h: $(SRC_DIR)/stmt.str $(SRC_DIR)/make.allocd
244 $(SRC_DIR)/make.allocd < $(SRC_DIR)/stmt.str > stmt.h
246 struct.h: $(SRC_DIR)/struct.str $(SRC_DIR)/make.allocd
247 $(SRC_DIR)/make.allocd < $(SRC_DIR)/struct.str > struct.h
249 switch.h: $(SRC_DIR)/switch.str $(SRC_DIR)/make.allocd
250 $(SRC_DIR)/make.allocd < $(SRC_DIR)/switch.str > switch.h
252 type.h: $(SRC_DIR)/type.str $(SRC_DIR)/make.allocd
253 $(SRC_DIR)/make.allocd < $(SRC_DIR)/type.str > type.h
255 l_brace.h: $(SRC_DIR)/l_brace.str $(SRC_DIR)/make.allocd
256 $(SRC_DIR)/make.allocd < $(SRC_DIR)/l_brace.str > l_brace.h
258 l_state.h: $(SRC_DIR)/l_state.str $(SRC_DIR)/make.allocd
259 $(SRC_DIR)/make.allocd < $(SRC_DIR)/l_state.str > l_state.h
261 l_outdef.h: $(SRC_DIR)/l_outdef.str $(SRC_DIR)/make.allocd
262 $(SRC_DIR)/make.allocd < $(SRC_DIR)/l_outdef.str > l_outdef.h
264 next.c: $(NEXTFILES) $(SRC_DIR)/make.next
265 $(SRC_DIR)/make.next $(NEXTFILES) > next.c
267 char.c: $(SRC_DIR)/char.tab
268 $(TABGEN) -f$(SRC_DIR)/char.tab >char.c