1 # $Id: proto.make,v 1.4 1994/06/24 11:03:03 ceriel Exp $
5 #PARAMS do not remove this line!
10 $(SRC_HOME)/lang/pc/comp
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
22 GFILES= $(GEN_G) $(SRC_G)
24 SRC_C = $(SRC_DIR)/LLlex.c $(SRC_DIR)/LLmessage.c $(SRC_DIR)/body.c \
25 $(SRC_DIR)/error.c $(SRC_DIR)/label.c $(SRC_DIR)/readwrite.c \
26 $(SRC_DIR)/main.c $(SRC_DIR)/tokenname.c $(SRC_DIR)/idf.c \
27 $(SRC_DIR)/input.c $(SRC_DIR)/type.c $(SRC_DIR)/def.c \
28 $(SRC_DIR)/misc.c $(SRC_DIR)/enter.c $(SRC_DIR)/progs.c \
29 $(SRC_DIR)/typequiv.c $(SRC_DIR)/node.c $(SRC_DIR)/cstoper.c \
30 $(SRC_DIR)/chk_expr.c $(SRC_DIR)/options.c $(SRC_DIR)/scope.c \
31 $(SRC_DIR)/desig.c $(SRC_DIR)/code.c $(SRC_DIR)/lookup.c \
33 GEN_C = tokenfile.c program.c declar.c expression.c statement.c \
34 symbol2str.c char.c Lpars.c casestat.c tmpvar.c next.c
35 CFILES= $(SRC_C) $(GEN_C)
37 SRC_H = $(SRC_DIR)/LLlex.h $(SRC_DIR)/chk_expr.h $(SRC_DIR)/class.h \
38 $(SRC_DIR)/const.h $(SRC_DIR)/debug.h $(SRC_DIR)/f_info.h \
39 $(SRC_DIR)/idf.h $(SRC_DIR)/input.h $(SRC_DIR)/main.h \
40 $(SRC_DIR)/misc.h $(SRC_DIR)/required.h $(SRC_DIR)/tokenname.h
42 GEN_H = errout.h idfsize.h numsize.h strsize.h target_sizes.h \
43 inputtype.h density.h nocross.h def.h debugcst.h \
44 type.h Lpars.h node.h dbsymtab.h scope.h desig.h
46 HFILES= $(GEN_H) $(SRC_H)
49 $(SRC_DIR)/def.H $(SRC_DIR)/type.H $(SRC_DIR)/node.H \
50 $(SRC_DIR)/scope.H $(SRC_DIR)/desig.H \
51 $(SRC_DIR)/tmpvar.C $(SRC_DIR)/casestat.C
54 make -f make.main main
57 cp main $(TARGET_HOME)/lib.bin/pc_ce
60 -cmp main $(TARGET_HOME)/lib.bin/pc_ce
66 @pr $(FSRC_DIR)/proto.make $(FSRC_DIR)/proto.main \
67 $(FSRC_DIR)/Parameters
70 make -f make.main lint
72 Cfiles: hfiles LLfiles $(GEN_C) $(GEN_H) Makefile
73 echo $(CFILES) | tr ' ' '\012' > Cfiles
74 echo $(HFILES) | tr ' ' '\012' >> Cfiles
77 CC="$(CC)" UTIL_HOME="$(UTIL_HOME)" do_resolve `cat Cfiles` > Cfiles.new
78 -if cmp -s Cfiles Cfiles.new ; then rm -f Cfiles.new ; else mv Cfiles.new Cfiles ; fi
81 # there is no file called "dependencies"; we want dependencies checked
82 # every time. This means that make.main is made every time. Oh well ...
83 # it does not take much time.
84 dependencies: resolved
85 do_deps `grep '.c$$' Cfiles`
87 make.main: dependencies make_macros lists $(FSRC_DIR)/proto.main
88 rm_deps $(FSRC_DIR)/proto.main | sed -e '/^.PARAMS/r make_macros' -e '/^.LISTS/r lists' > make.main
89 cat *.dep >> make.main
92 echo 'SRC_DIR=$(SRC_DIR)' > make_macros
93 echo 'UTIL_HOME=$(UTIL_HOME)' >> make_macros
94 echo 'TARGET_HOME=$(TARGET_HOME)' >> make_macros
95 echo 'CC=$(CC)' >> make_macros
96 echo 'COPTIONS=$(COPTIONS) -DPEEPHOLE' >> make_macros
97 echo 'LDOPTIONS=$(LDOPTIONS)' >> make_macros
98 echo 'LINT=$(LINT)' >> make_macros
99 echo 'LINTOPTIONS=$(LINTOPTIONS)' >> make_macros
100 echo 'LINTSUF=$(LINTSUF)' >> make_macros
101 echo 'LINTPREF=$(LINTPREF)' >> make_macros
102 echo 'SUF=$(SUF)' >> make_macros
103 echo 'LIBSUF=$(LIBSUF)' >> make_macros
104 echo 'CC_AND_MKDEP=$(CC_AND_MKDEP)' >> make_macros
105 echo 'MACH=$(MACH)' >> make_macros
108 echo "C_SRC = \\" > lists
109 echo $(CFILES) >> lists
110 echo "OBJ = \\" >> lists
111 echo $(CFILES) | sed -e 's|[^ ]*/||g' -e 's/\.c/.$$(SUF)/g' >> lists
114 -make -f make.main clean
115 rm -f $(GEN_C) $(GEN_G) $(GEN_H) hfiles LLfiles Cfiles LL.output
116 rm -f resolved *.dep lists make.main make_macros
119 $(LLGEN) $(LLGENOPTIONS) $(GFILES)
122 hfiles: $(FSRC_DIR)/Parameters $(SRC_DIR)/make.hfiles
123 $(SRC_DIR)/make.hfiles $(FSRC_DIR)/Parameters
126 tokenfile.g: $(SRC_DIR)/tokenname.c $(SRC_DIR)/make.tokfile
127 $(SRC_DIR)/make.tokfile <$(SRC_DIR)/tokenname.c >tokenfile.g
129 symbol2str.c: $(SRC_DIR)/tokenname.c $(SRC_DIR)/make.tokcase
130 $(SRC_DIR)/make.tokcase <$(SRC_DIR)/tokenname.c >symbol2str.c
132 def.h: $(SRC_DIR)/make.allocd $(SRC_DIR)/def.H
133 $(SRC_DIR)/make.allocd < $(SRC_DIR)/def.H > def.h
135 type.h: $(SRC_DIR)/make.allocd $(SRC_DIR)/type.H
136 $(SRC_DIR)/make.allocd < $(SRC_DIR)/type.H > type.h
138 scope.h: $(SRC_DIR)/make.allocd $(SRC_DIR)/scope.H
139 $(SRC_DIR)/make.allocd < $(SRC_DIR)/scope.H > scope.h
141 node.h: $(SRC_DIR)/make.allocd $(SRC_DIR)/node.H
142 $(SRC_DIR)/make.allocd < $(SRC_DIR)/node.H > node.h
144 desig.h: $(SRC_DIR)/make.allocd $(SRC_DIR)/desig.H
145 $(SRC_DIR)/make.allocd < $(SRC_DIR)/desig.H > desig.h
147 tmpvar.c: $(SRC_DIR)/make.allocd $(SRC_DIR)/tmpvar.C
148 $(SRC_DIR)/make.allocd < $(SRC_DIR)/tmpvar.C > tmpvar.c
150 casestat.c: $(SRC_DIR)/make.allocd $(SRC_DIR)/casestat.C
151 $(SRC_DIR)/make.allocd < $(SRC_DIR)/casestat.C > casestat.c
153 next.c: $(NEXTFILES) $(SRC_DIR)/make.next
154 $(SRC_DIR)/make.next $(NEXTFILES) > next.c
156 char.c: $(SRC_DIR)/char.tab
157 $(TABGEN) -f$(SRC_DIR)/char.tab >char.c