1 # $Id: proto.make,v 1.11 1994/06/24 11:00:54 ceriel Exp $
3 #PARAMS do not remove this line!
5 SRC_DIR = $(SRC_HOME)/util/grind
6 UTIL_BIN = $(UTIL_HOME)/bin
7 TABGEN= $(UTIL_BIN)/tabgen
8 LLGEN = $(UTIL_BIN)/LLgen
12 SRC_G1 = $(SRC_DIR)/commands.g
14 GFILES1= $(GEN_G1) $(SRC_G1)
16 SRC_G2 = $(SRC_DIR)/db_symtab.g
18 GFILES2 = $(GEN_G2) $(SRC_G2)
25 $(SRC_DIR)/position.c \
26 $(SRC_DIR)/tokenname.c \
33 $(SRC_DIR)/do_comm.c \
34 $(SRC_DIR)/modula-2.c \
37 GEN_C = db_symtab.c commands.c Lpars.c DBSpars.c avl.c scope.c itemlist.c \
38 langdep.c ops.c chtab.c symbol2str.c next.c
39 CFILES= $(SRC_C) $(GEN_C)
42 $(SRC_DIR)/tokenname.h \
43 $(SRC_DIR)/operator.h \
45 $(SRC_DIR)/position.h \
47 $(SRC_DIR)/message.h \
50 $(SRC_DIR)/langdep.h \
55 GEN_H = file.h type.h symbol.h tree.h Lpars.h DBSpars.h ops.h
56 HFILES= $(GEN_H) $(SRC_H)
58 NEXTFILES = $(SRC_DIR)/file.hh \
60 $(SRC_DIR)/symbol.hh \
64 $(SRC_DIR)/itemlist.cc \
68 make -f make.main "EXTRALIB="$(EXTRALIB) grind
71 cp grind $(TARGET_HOME)/bin/grind
72 if [ $(DO_MACHINE_INDEP) = y ] ; \
73 then mk_manpage $(SRC_DIR)/grind.1 $(TARGET_HOME) ; \
77 -cmp grind $(TARGET_HOME)/bin/grind
83 @pr $(SRC_DIR)/proto.make $(SRC_DIR)/proto.main \
84 $(SRC_DIR)/char.ct operators.ot \
86 $(SRC_H) $(NEXTFILES) \
90 make -f make.main lint
92 Cfiles: LLfiles $(GEN_C) $(GEN_H) Makefile
93 echo $(CFILES) | tr ' ' '\012' > Cfiles
94 echo $(HFILES) | tr ' ' '\012' >> Cfiles
97 CC="$(CC)" UTIL_HOME="$(UTIL_HOME)" do_resolve `cat Cfiles` > Cfiles.new
98 -if cmp -s Cfiles Cfiles.new ; then rm -f Cfiles.new ; else mv Cfiles.new Cfiles ; fi
101 # there is no file called "dependencies"; we want dependencies checked
102 # every time. This means that make.main is made every time. Oh well ...
103 # it does not take much time.
104 dependencies: resolved
105 do_deps `grep '.c$$' Cfiles`
107 make.main: dependencies make_macros lists $(SRC_DIR)/proto.main
108 rm_deps $(SRC_DIR)/proto.main | sed -e '/^.PARAMS/r make_macros' -e '/^.LISTS/r lists' > make.main
109 cat *.dep >> make.main
111 make_macros: Makefile
112 echo 'SRC_DIR=$(SRC_DIR)' > make_macros
113 echo 'UTIL_HOME=$(UTIL_HOME)' >> make_macros
114 echo 'TARGET_HOME=$(TARGET_HOME)' >> make_macros
115 echo 'CC=$(CC)' >> make_macros
116 echo 'COPTIONS=$(COPTIONS)' >> make_macros
117 echo 'LDOPTIONS=$(LDOPTIONS)' >> make_macros
118 echo 'LINT=$(LINT)' >> make_macros
119 echo 'LINTSUF=$(LINTSUF)' >> make_macros
120 echo 'LINTPREF=$(LINTPREF)' >> make_macros
121 echo 'LINTOPTIONS=$(LINTOPTIONS)' >> make_macros
122 echo 'SUF=$(SUF)' >> make_macros
123 echo 'LIBSUF=$(LIBSUF)' >> make_macros
124 echo 'CC_AND_MKDEP=$(CC_AND_MKDEP)' >> make_macros
127 echo "C_SRC = \\" > lists
128 echo $(CFILES) >> lists
129 echo "OBJ = \\" >> lists
130 echo $(CFILES) | sed -e 's|[^ ]*/||g' -e 's/\.c/.$$(SUF)/g' >> lists
133 -make -f make.main clean
134 rm -f $(GEN_C) $(GEN_G) $(GEN_H) \
135 LL1files LL2files Cfiles LL.output DBS.output
136 rm -f resolved *.dep lists make.main make_macros tokenfile.[cg]
138 LLfiles: LL1files LL2files
141 $(LLGEN) $(LLGENOPTIONS) $(GFILES1)
145 $(LLGEN) $(LLGENOPTIONS) $(GFILES2)
148 tokenfile.g: $(SRC_DIR)/tokenname.c $(SRC_DIR)/make.tokfile
149 $(SRC_DIR)/make.tokfile <$(SRC_DIR)/tokenname.c >tokenfile.g
151 symbol2str.c: $(SRC_DIR)/tokenname.c $(SRC_DIR)/make.tokcase
152 $(SRC_DIR)/make.tokcase <$(SRC_DIR)/tokenname.c >symbol2str.c
154 file.h: $(SRC_DIR)/file.hh $(SRC_DIR)/make.allocd
155 $(SRC_DIR)/make.allocd < $(SRC_DIR)/file.hh > file.h
157 symbol.h: $(SRC_DIR)/symbol.hh $(SRC_DIR)/make.allocd
158 $(SRC_DIR)/make.allocd < $(SRC_DIR)/symbol.hh > symbol.h
160 tree.h: $(SRC_DIR)/tree.hh $(SRC_DIR)/make.allocd
161 $(SRC_DIR)/make.allocd < $(SRC_DIR)/tree.hh > tree.h
163 type.h: $(SRC_DIR)/type.hh $(SRC_DIR)/make.allocd
164 $(SRC_DIR)/make.allocd < $(SRC_DIR)/type.hh > type.h
166 avl.c: $(SRC_DIR)/avl.cc $(SRC_DIR)/make.allocd
167 $(SRC_DIR)/make.allocd < $(SRC_DIR)/avl.cc > avl.c
169 itemlist.c: $(SRC_DIR)/itemlist.cc $(SRC_DIR)/make.allocd
170 $(SRC_DIR)/make.allocd < $(SRC_DIR)/itemlist.cc > itemlist.c
172 langdep.c: $(SRC_DIR)/langdep.cc $(SRC_DIR)/make.allocd
173 $(SRC_DIR)/make.allocd < $(SRC_DIR)/langdep.cc > langdep.c
175 scope.c: $(SRC_DIR)/scope.cc $(SRC_DIR)/make.allocd
176 $(SRC_DIR)/make.allocd < $(SRC_DIR)/scope.cc > scope.c
178 next.c: $(NEXTFILES) $(SRC_DIR)/make.next
179 $(SRC_DIR)/make.next $(NEXTFILES) > next.c
181 chtab.c: $(SRC_DIR)/char.ct
182 $(TABGEN) -f$(SRC_DIR)/char.ct >chtab.c
184 ops.c ops.h: $(SRC_DIR)/operators.ot $(SRC_DIR)/make.ops
185 $(SRC_DIR)/make.ops $(SRC_DIR)/operators.ot