1 # $Id: proto.make,v 1.8 1995/12/06 09:52:54 ceriel Exp $
3 #PARAMS do not remove this line!
5 SRC_DIR = $(SRC_HOME)/util/cpp
7 MODULES=$(TARGET_HOME)/modules
8 UMODULES=$(UTIL_HOME)/modules
9 MODULESLIB=$(MODULES)/lib
10 UMODULESLIB=$(UMODULES)/lib
11 BIN=$(TARGET_HOME)/lib.bin
14 SYSLIB = $(MODULESLIB)/libsystem.$(LIBSUF)
15 STRLIB = $(MODULESLIB)/libstring.$(LIBSUF)
16 PRTLIB = $(MODULESLIB)/libprint.$(LIBSUF)
17 ALLOCLIB = $(MODULESLIB)/liballoc.$(LIBSUF)
18 ASSERTLIB = $(MODULESLIB)/libassert.$(LIBSUF)
19 MALLOC = $(MODULESLIB)/malloc.$(SUF)
20 LIBS = $(PRTLIB) $(STRLIB) $(ALLOCLIB) $(MALLOC) $(ASSERTLIB) $(SYSLIB)
22 $(UMODULESLIB)/$(LINTPREF)print.$(LINTSUF) \
23 $(UMODULESLIB)/$(LINTPREF)string.$(LINTSUF) \
24 $(UMODULESLIB)/$(LINTPREF)alloc.$(LINTSUF) \
25 $(UMODULESLIB)/$(LINTPREF)assert.$(LINTSUF) \
26 $(UMODULESLIB)/$(LINTPREF)system.$(LINTSUF)
27 INCLUDES = -I$(MODULES)/h -I$(MODULES)/pkg -I. -I$(SRC_DIR)
29 CFLAGS = $(INCLUDES) $(COPTIONS)
30 LDFLAGS = $(LDOPTIONS)
31 LINTFLAGS = $(INCLUDES) $(LINTOPTIONS)
33 # Where to install the preprocessor
36 # Grammar files and their objects
37 LSRC = tokenfile.g $(SRC_DIR)/expression.g
38 LCSRC = tokenfile.c expression.c Lpars.c
39 LOBJ = tokenfile.$(SUF) expression.$(SUF) Lpars.$(SUF)
41 # Objects of hand-written C files
42 CSRC = $(SRC_DIR)/LLlex.c $(SRC_DIR)/LLmessage.c $(SRC_DIR)/ch7bin.c \
43 $(SRC_DIR)/ch7mon.c $(SRC_DIR)/domacro.c $(SRC_DIR)/error.c \
44 $(SRC_DIR)/idf.c $(SRC_DIR)/init.c $(SRC_DIR)/input.c \
45 $(SRC_DIR)/main.c $(SRC_DIR)/options.c \
46 $(SRC_DIR)/preprocess.c $(SRC_DIR)/replace.c $(SRC_DIR)/scan.c \
47 $(SRC_DIR)/skip.c $(SRC_DIR)/tokenname.c $(SRC_DIR)/next.c \
49 COBJ = LLlex.$(SUF) LLmessage.$(SUF) ch7bin.$(SUF) ch7mon.$(SUF) \
50 domacro.$(SUF) error.$(SUF) idf.$(SUF) init.$(SUF) input.$(SUF) \
51 main.$(SUF) options.$(SUF) \
52 preprocess.$(SUF) replace.$(SUF) scan.$(SUF) skip.$(SUF) \
53 tokenname.$(SUF) next.$(SUF) expr.$(SUF)
55 PRFILES = $(SRC_DIR)/proto.make $(SRC_DIR)/Parameters \
56 $(SRC_DIR)/make.hfiles $(SRC_DIR)/make.tokcase $(SRC_DIR)/make.tokfile \
57 $(SRC_DIR)/LLlex.h $(SRC_DIR)/bits.h $(SRC_DIR)/file_info.h \
58 $(SRC_DIR)/idf.h $(SRC_DIR)/input.h $(SRC_DIR)/interface.h \
60 $(SRC_DIR)/class.h $(SRC_DIR)/char.tab $(SRC_DIR)/expression.g $(CSRC)
62 # Objects of other generated C files
63 GOBJ = char.$(SUF) symbol2str.$(SUF)
65 # generated source files
66 GSRC = char.c symbol2str.c
68 # .h files generated by `make hfiles'; PLEASE KEEP THIS UP-TO-DATE!
69 GHSRC = errout.h idfsize.h ifdepth.h lapbuf.h \
70 nparams.h numsize.h obufsize.h \
71 parbufsize.h pathlength.h strsize.h textsize.h \
72 botch_free.h debug.h inputtype.h dobits.h line_prefix.h
74 # Other generated files, for 'make clean' only
75 GENERATED = tokenfile.g Lpars.h LLfiles LL.output lint.out \
83 hfiles: Parameters char.c
84 $(SRC_DIR)/make.hfiles Parameters
87 Parameters: $(SRC_DIR)/Parameters
88 cp $(SRC_DIR)/Parameters Parameters
90 char.c: $(SRC_DIR)/char.tab
91 tabgen -f$(SRC_DIR)/char.tab > char.c
94 LLgen $(LLGENOPTIONS) $(LSRC)
97 tokenfile.g: $(SRC_DIR)/tokenname.c $(SRC_DIR)/make.tokfile
98 <$(SRC_DIR)/tokenname.c $(SRC_DIR)/make.tokfile >tokenfile.g
100 symbol2str.c: $(SRC_DIR)/tokenname.c $(SRC_DIR)/make.tokcase
101 <$(SRC_DIR)/tokenname.c $(SRC_DIR)/make.tokcase >symbol2str.c
103 # Objects needed for 'cpp'
104 OBJ = $(COBJ) $(LOBJ) $(GOBJ)
105 SRC = $(CSRC) $(LCSRC) $(GSRC)
108 $(CC) $(LDFLAGS) $(OBJ) $(LIBS) -o cpp
110 cfiles: hfiles LLfiles $(GSRC)
115 if [ $(DO_MACHINE_INDEP) = y ] ; \
116 then mk_manpage $(SRC_DIR)/cpp.6 $(TARGET_HOME) ; \
132 rm_deps Makefile >Makefile.new
133 for i in $(SRC) ; do \
134 echo "`basename $$i .c`.$$(SUF): $$i" >> Makefile.new ; \
135 echo ' $$(CC) -c $$(CFLAGS)' $$i >> Makefile.new ; \
136 $(UTIL_HOME)/lib.bin/cpp -d $(INCLUDES) $$i | sed "s/^/`basename $$i .c`.$$(SUF): /" >> Makefile.new ; \
138 mv Makefile Makefile.old
139 mv Makefile.new Makefile
142 $(LINT) $(LINTFLAGS) $(INCLUDES) $(SRC) $(LINTLIBS)
145 rm -f $(LCSRC) $(OBJ) $(GENERATED) $(GSRC) $(GHSRC) cpp Out
147 # do not remove the next line. It is used for generating dependencies.
149 LLlex.$(SUF): $(SRC_DIR)/LLlex.c
150 $(CC) -c $(CFLAGS) $(SRC_DIR)/LLlex.c
151 LLlex.$(SUF): ./dobits.h
152 LLlex.$(SUF): $(SRC_DIR)/bits.h
153 LLlex.$(SUF): $(SRC_DIR)/class.h
154 LLlex.$(SUF): ./Lpars.h
155 LLlex.$(SUF): $(SRC_DIR)/file_info.h
156 LLlex.$(SUF): $(TARGET_HOME)/modules/h/em_arith.h
157 LLlex.$(SUF): $(SRC_DIR)/LLlex.h
158 LLlex.$(SUF): $(TARGET_HOME)/modules/pkg/idf_pkg.spec
159 LLlex.$(SUF): $(SRC_DIR)/idf.h
160 LLlex.$(SUF): $(TARGET_HOME)/modules/pkg/inp_pkg.spec
161 LLlex.$(SUF): ./inputtype.h
162 LLlex.$(SUF): $(SRC_DIR)/input.h
163 LLlex.$(SUF): $(TARGET_HOME)/modules/h/alloc.h
164 LLlex.$(SUF): ./strsize.h
165 LLlex.$(SUF): ./numsize.h
166 LLlex.$(SUF): ./idfsize.h
167 LLmessage.$(SUF): $(SRC_DIR)/LLmessage.c
168 $(CC) -c $(CFLAGS) $(SRC_DIR)/LLmessage.c
169 LLmessage.$(SUF): ./Lpars.h
170 LLmessage.$(SUF): $(SRC_DIR)/file_info.h
171 LLmessage.$(SUF): $(TARGET_HOME)/modules/h/em_arith.h
172 LLmessage.$(SUF): $(SRC_DIR)/LLlex.h
173 ch7bin.$(SUF): $(SRC_DIR)/ch7bin.c
174 $(CC) -c $(CFLAGS) $(SRC_DIR)/ch7bin.c
175 ch7bin.$(SUF): $(TARGET_HOME)/modules/h/em_arith.h
176 ch7bin.$(SUF): ./Lpars.h
177 ch7mon.$(SUF): $(SRC_DIR)/ch7mon.c
178 $(CC) -c $(CFLAGS) $(SRC_DIR)/ch7mon.c
179 ch7mon.$(SUF): $(TARGET_HOME)/modules/h/em_arith.h
180 ch7mon.$(SUF): ./Lpars.h
181 domacro.$(SUF): $(SRC_DIR)/domacro.c
182 $(CC) -c $(CFLAGS) $(SRC_DIR)/domacro.c
183 domacro.$(SUF): ./dobits.h
184 domacro.$(SUF): $(SRC_DIR)/bits.h
185 domacro.$(SUF): $(SRC_DIR)/macro.h
186 domacro.$(SUF): $(SRC_DIR)/class.h
187 domacro.$(SUF): $(TARGET_HOME)/modules/h/alloc.h
188 domacro.$(SUF): $(TARGET_HOME)/modules/h/assert.h
189 domacro.$(SUF): ./idfsize.h
190 domacro.$(SUF): ./textsize.h
191 domacro.$(SUF): ./parbufsize.h
192 domacro.$(SUF): ./nparams.h
193 domacro.$(SUF): ./botch_free.h
194 domacro.$(SUF): ./ifdepth.h
195 domacro.$(SUF): $(TARGET_HOME)/modules/pkg/inp_pkg.spec
196 domacro.$(SUF): ./inputtype.h
197 domacro.$(SUF): $(SRC_DIR)/input.h
198 domacro.$(SUF): $(TARGET_HOME)/modules/pkg/idf_pkg.spec
199 domacro.$(SUF): $(SRC_DIR)/idf.h
200 domacro.$(SUF): ./debug.h
201 domacro.$(SUF): ./Lpars.h
202 domacro.$(SUF): $(SRC_DIR)/file_info.h
203 domacro.$(SUF): $(TARGET_HOME)/modules/h/em_arith.h
204 domacro.$(SUF): $(SRC_DIR)/LLlex.h
205 domacro.$(SUF): $(SRC_DIR)/interface.h
206 error.$(SUF): $(SRC_DIR)/error.c
207 $(CC) -c $(CFLAGS) $(SRC_DIR)/error.c
208 error.$(SUF): $(SRC_DIR)/file_info.h
209 error.$(SUF): $(TARGET_HOME)/modules/h/em_arith.h
210 error.$(SUF): $(SRC_DIR)/LLlex.h
211 error.$(SUF): ./errout.h
212 error.$(SUF): $(TARGET_HOME)/modules/h/system.h
213 idf.$(SUF): $(SRC_DIR)/idf.c
214 $(CC) -c $(CFLAGS) $(SRC_DIR)/idf.c
215 idf.$(SUF): $(TARGET_HOME)/modules/h/alloc.h
216 idf.$(SUF): $(TARGET_HOME)/modules/pkg/idf_pkg.body
217 idf.$(SUF): $(TARGET_HOME)/modules/pkg/idf_pkg.spec
218 idf.$(SUF): $(SRC_DIR)/idf.h
219 init.$(SUF): $(SRC_DIR)/init.c
220 $(CC) -c $(CFLAGS) $(SRC_DIR)/init.c
221 init.$(SUF): $(SRC_DIR)/interface.h
222 init.$(SUF): $(TARGET_HOME)/modules/pkg/idf_pkg.spec
223 init.$(SUF): $(SRC_DIR)/idf.h
224 init.$(SUF): $(SRC_DIR)/macro.h
225 init.$(SUF): $(SRC_DIR)/class.h
226 init.$(SUF): $(TARGET_HOME)/modules/h/alloc.h
227 init.$(SUF): $(TARGET_HOME)/modules/h/system.h
228 input.$(SUF): $(SRC_DIR)/input.c
229 $(CC) -c $(CFLAGS) $(SRC_DIR)/input.c
230 input.$(SUF): $(TARGET_HOME)/modules/h/system.h
231 input.$(SUF): $(TARGET_HOME)/modules/h/alloc.h
232 input.$(SUF): $(TARGET_HOME)/modules/pkg/inp_pkg.body
233 input.$(SUF): $(TARGET_HOME)/modules/pkg/inp_pkg.spec
234 input.$(SUF): ./inputtype.h
235 input.$(SUF): $(SRC_DIR)/input.h
236 input.$(SUF): $(SRC_DIR)/file_info.h
237 main.$(SUF): $(SRC_DIR)/main.c
238 $(CC) -c $(CFLAGS) $(SRC_DIR)/main.c
239 main.$(SUF): $(SRC_DIR)/macro.h
240 main.$(SUF): $(TARGET_HOME)/modules/pkg/idf_pkg.spec
241 main.$(SUF): $(SRC_DIR)/idf.h
242 main.$(SUF): ./idfsize.h
243 main.$(SUF): $(SRC_DIR)/file_info.h
244 main.$(SUF): $(TARGET_HOME)/modules/h/system.h
245 main.$(SUF): $(TARGET_HOME)/modules/h/assert.h
246 main.$(SUF): $(TARGET_HOME)/modules/h/em_arith.h
247 main.$(SUF): $(TARGET_HOME)/modules/h/alloc.h
248 options.$(SUF): $(SRC_DIR)/options.c
249 $(CC) -c $(CFLAGS) $(SRC_DIR)/options.c
250 options.$(SUF): $(TARGET_HOME)/modules/pkg/idf_pkg.spec
251 options.$(SUF): $(SRC_DIR)/idf.h
252 options.$(SUF): $(SRC_DIR)/macro.h
253 options.$(SUF): $(SRC_DIR)/class.h
254 options.$(SUF): ./idfsize.h
255 options.$(SUF): $(TARGET_HOME)/modules/h/alloc.h
256 preprocess.$(SUF): $(SRC_DIR)/preprocess.c
257 $(CC) -c $(CFLAGS) $(SRC_DIR)/preprocess.c
258 preprocess.$(SUF): ./line_prefix.h
259 preprocess.$(SUF): ./dobits.h
260 preprocess.$(SUF): $(SRC_DIR)/bits.h
261 preprocess.$(SUF): ./idfsize.h
262 preprocess.$(SUF): $(TARGET_HOME)/modules/pkg/idf_pkg.spec
263 preprocess.$(SUF): $(SRC_DIR)/idf.h
264 preprocess.$(SUF): $(SRC_DIR)/class.h
265 preprocess.$(SUF): $(SRC_DIR)/file_info.h
266 preprocess.$(SUF): $(TARGET_HOME)/modules/h/em_arith.h
267 preprocess.$(SUF): $(SRC_DIR)/LLlex.h
268 preprocess.$(SUF): ./obufsize.h
269 preprocess.$(SUF): $(TARGET_HOME)/modules/pkg/inp_pkg.spec
270 preprocess.$(SUF): ./inputtype.h
271 preprocess.$(SUF): $(SRC_DIR)/input.h
272 preprocess.$(SUF): $(TARGET_HOME)/modules/h/system.h
273 replace.$(SUF): $(SRC_DIR)/replace.c
274 $(CC) -c $(CFLAGS) $(SRC_DIR)/replace.c
275 replace.$(SUF): $(SRC_DIR)/interface.h
276 replace.$(SUF): $(SRC_DIR)/class.h
277 replace.$(SUF): $(SRC_DIR)/file_info.h
278 replace.$(SUF): $(TARGET_HOME)/modules/h/em_arith.h
279 replace.$(SUF): $(SRC_DIR)/LLlex.h
280 replace.$(SUF): $(SRC_DIR)/macro.h
281 replace.$(SUF): $(TARGET_HOME)/modules/pkg/inp_pkg.spec
282 replace.$(SUF): ./inputtype.h
283 replace.$(SUF): $(SRC_DIR)/input.h
284 replace.$(SUF): $(TARGET_HOME)/modules/pkg/idf_pkg.spec
285 replace.$(SUF): $(SRC_DIR)/idf.h
286 replace.$(SUF): $(TARGET_HOME)/modules/h/assert.h
287 replace.$(SUF): $(TARGET_HOME)/modules/h/alloc.h
288 replace.$(SUF): ./textsize.h
289 replace.$(SUF): ./pathlength.h
290 replace.$(SUF): ./debug.h
291 scan.$(SUF): $(SRC_DIR)/scan.c
292 $(CC) -c $(CFLAGS) $(SRC_DIR)/scan.c
293 scan.$(SUF): $(SRC_DIR)/file_info.h
294 scan.$(SUF): $(SRC_DIR)/interface.h
295 scan.$(SUF): $(SRC_DIR)/macro.h
296 scan.$(SUF): $(TARGET_HOME)/modules/pkg/idf_pkg.spec
297 scan.$(SUF): $(SRC_DIR)/idf.h
298 scan.$(SUF): $(SRC_DIR)/class.h
299 scan.$(SUF): $(TARGET_HOME)/modules/pkg/inp_pkg.spec
300 scan.$(SUF): ./inputtype.h
301 scan.$(SUF): $(SRC_DIR)/input.h
302 scan.$(SUF): ./nparams.h
303 scan.$(SUF): ./lapbuf.h
304 skip.$(SUF): $(SRC_DIR)/skip.c
305 $(CC) -c $(CFLAGS) $(SRC_DIR)/skip.c
306 skip.$(SUF): $(TARGET_HOME)/modules/pkg/inp_pkg.spec
307 skip.$(SUF): ./inputtype.h
308 skip.$(SUF): $(SRC_DIR)/input.h
309 skip.$(SUF): $(SRC_DIR)/class.h
310 skip.$(SUF): $(SRC_DIR)/file_info.h
311 skip.$(SUF): $(TARGET_HOME)/modules/h/em_arith.h
312 skip.$(SUF): $(SRC_DIR)/LLlex.h
313 tokenname.$(SUF): $(SRC_DIR)/tokenname.c
314 $(CC) -c $(CFLAGS) $(SRC_DIR)/tokenname.c
315 tokenname.$(SUF): ./Lpars.h
316 tokenname.$(SUF): $(SRC_DIR)/file_info.h
317 tokenname.$(SUF): $(TARGET_HOME)/modules/h/em_arith.h
318 tokenname.$(SUF): $(SRC_DIR)/LLlex.h
319 tokenname.$(SUF): $(TARGET_HOME)/modules/pkg/idf_pkg.spec
320 tokenname.$(SUF): $(SRC_DIR)/idf.h
321 next.$(SUF): $(SRC_DIR)/next.c
322 $(CC) -c $(CFLAGS) $(SRC_DIR)/next.c
323 next.$(SUF): ./debug.h
324 expr.$(SUF): $(SRC_DIR)/expr.c
325 $(CC) -c $(CFLAGS) $(SRC_DIR)/expr.c
326 expr.$(SUF): ./Lpars.h
327 tokenfile.$(SUF): tokenfile.c
328 $(CC) -c $(CFLAGS) tokenfile.c
329 tokenfile.$(SUF): Lpars.h
330 expression.$(SUF): expression.c
331 $(CC) -c $(CFLAGS) expression.c
332 expression.$(SUF): $(SRC_DIR)/file_info.h
333 expression.$(SUF): $(TARGET_HOME)/modules/h/em_arith.h
334 expression.$(SUF): $(SRC_DIR)/LLlex.h
335 expression.$(SUF): Lpars.h
336 Lpars.$(SUF): Lpars.c
337 $(CC) -c $(CFLAGS) Lpars.c
338 Lpars.$(SUF): Lpars.h
340 $(CC) -c $(CFLAGS) char.c
341 char.$(SUF): $(SRC_DIR)/class.h
342 symbol2str.$(SUF): symbol2str.c
343 $(CC) -c $(CFLAGS) symbol2str.c
344 symbol2str.$(SUF): Lpars.h