1 # $Id: proto.make,v 1.5 1994/06/24 12:36:06 ceriel Exp $
5 #PARAMS do not remove this line!
10 $(SRC_HOME)/lang/pc/comp
12 TABGEN= $(UTIL_BIN)/tabgen
13 LLGEN = $(UTIL_BIN)/LLgen
17 SRC_G = $(SRC_DIR)/program.g $(SRC_DIR)/declar.g \
18 $(SRC_DIR)/expression.g $(SRC_DIR)/statement.g
20 GFILES= $(GEN_G) $(SRC_G)
22 SRC_C = $(SRC_DIR)/LLlex.c $(SRC_DIR)/LLmessage.c $(SRC_DIR)/body.c \
23 $(SRC_DIR)/error.c $(SRC_DIR)/label.c $(SRC_DIR)/readwrite.c \
24 $(SRC_DIR)/main.c $(SRC_DIR)/tokenname.c $(SRC_DIR)/idf.c \
25 $(SRC_DIR)/input.c $(SRC_DIR)/type.c $(SRC_DIR)/def.c \
26 $(SRC_DIR)/misc.c $(SRC_DIR)/enter.c $(SRC_DIR)/progs.c \
27 $(SRC_DIR)/typequiv.c $(SRC_DIR)/node.c $(SRC_DIR)/cstoper.c \
28 $(SRC_DIR)/chk_expr.c $(SRC_DIR)/options.c $(SRC_DIR)/scope.c \
29 $(SRC_DIR)/desig.c $(SRC_DIR)/code.c $(SRC_DIR)/lookup.c \
31 GEN_C = tokenfile.c program.c declar.c expression.c statement.c \
32 symbol2str.c char.c Lpars.c casestat.c tmpvar.c next.c
33 CFILES= $(SRC_C) $(GEN_C)
35 SRC_H = $(SRC_DIR)/LLlex.h $(SRC_DIR)/chk_expr.h $(SRC_DIR)/class.h \
36 $(SRC_DIR)/const.h $(SRC_DIR)/debug.h $(SRC_DIR)/f_info.h \
37 $(SRC_DIR)/idf.h $(SRC_DIR)/input.h $(SRC_DIR)/main.h \
38 $(SRC_DIR)/misc.h $(SRC_DIR)/required.h $(SRC_DIR)/tokenname.h
40 GEN_H = errout.h idfsize.h numsize.h strsize.h target_sizes.h \
41 inputtype.h density.h nocross.h def.h debugcst.h \
42 type.h Lpars.h node.h dbsymtab.h scope.h desig.h
44 HFILES= $(GEN_H) $(SRC_H)
47 $(SRC_DIR)/def.H $(SRC_DIR)/type.H $(SRC_DIR)/node.H \
48 $(SRC_DIR)/scope.H $(SRC_DIR)/desig.H \
49 $(SRC_DIR)/tmpvar.C $(SRC_DIR)/casestat.C
52 make -f make.main main
55 cp main $(TARGET_HOME)/lib.bin/em_pc
58 -cmp main $(TARGET_HOME)/lib.bin/em_pc
64 @pr $(SRC_DIR)/proto.make $(SRC_DIR)/proto.main Parameters \
65 $(SRC_DIR)/char.tab $(SRC_G) $(SRC_H) $(NEXTFILES) $(SRC_C)
68 make -f make.main lint
70 Cfiles: hfiles LLfiles $(GEN_C) $(GEN_H) Makefile
71 echo $(CFILES) | tr ' ' '\012' > Cfiles
72 echo $(HFILES) | tr ' ' '\012' >> Cfiles
75 CC="$(CC)" UTIL_HOME="$(UTIL_HOME)" do_resolve `cat Cfiles` > Cfiles.new
76 -if cmp -s Cfiles Cfiles.new ; then rm -f Cfiles.new ; else mv Cfiles.new Cfiles ; fi
79 # there is no file called "dependencies"; we want dependencies checked
80 # every time. This means that make.main is made every time. Oh well ...
81 # it does not take much time.
82 dependencies: resolved
83 do_deps `grep '.c$$' Cfiles`
85 make.main: dependencies make_macros lists $(SRC_DIR)/proto.main
86 rm_deps $(SRC_DIR)/proto.main | sed -e '/^.PARAMS/r make_macros' -e '/^.LISTS/r lists' > make.main
87 cat *.dep >> make.main
90 echo 'SRC_DIR=$(SRC_DIR)' > make_macros
91 echo 'UTIL_HOME=$(UTIL_HOME)' >> make_macros
92 echo 'TARGET_HOME=$(TARGET_HOME)' >> make_macros
93 echo 'CC=$(CC)' >> make_macros
94 echo 'COPTIONS=$(COPTIONS)' >> make_macros
95 echo 'LDOPTIONS=$(LDOPTIONS)' >> make_macros
96 echo 'LINT=$(LINT)' >> make_macros
97 echo 'LINTSUF=$(LINTSUF)' >> make_macros
98 echo 'LINTPREF=$(LINTPREF)' >> make_macros
99 echo 'LINTOPTIONS=$(LINTOPTIONS)' >> make_macros
100 echo 'SUF=$(SUF)' >> make_macros
101 echo 'LIBSUF=$(LIBSUF)' >> make_macros
102 echo 'CC_AND_MKDEP=$(CC_AND_MKDEP)' >> make_macros
105 echo "C_SRC = \\" > lists
106 echo $(CFILES) >> lists
107 echo "OBJ = \\" >> lists
108 echo $(CFILES) | sed -e 's|[^ ]*/||g' -e 's/\.c/.$$(SUF)/g' >> lists
111 -make -f make.main clean
112 rm -f $(GEN_C) $(GEN_G) $(GEN_H) hfiles LLfiles Cfiles LL.output
113 rm -f resolved *.dep lists make.main make_macros
116 $(LLGEN) $(LLGENOPTIONS) $(GFILES)
119 hfiles: Parameters $(SRC_DIR)/make.hfiles
120 $(SRC_DIR)/make.hfiles Parameters
123 tokenfile.g: $(SRC_DIR)/tokenname.c $(SRC_DIR)/make.tokfile
124 $(SRC_DIR)/make.tokfile <$(SRC_DIR)/tokenname.c >tokenfile.g
126 symbol2str.c: $(SRC_DIR)/tokenname.c $(SRC_DIR)/make.tokcase
127 $(SRC_DIR)/make.tokcase <$(SRC_DIR)/tokenname.c >symbol2str.c
129 def.h: $(SRC_DIR)/make.allocd $(SRC_DIR)/def.H
130 $(SRC_DIR)/make.allocd < $(SRC_DIR)/def.H > def.h
132 type.h: $(SRC_DIR)/make.allocd $(SRC_DIR)/type.H
133 $(SRC_DIR)/make.allocd < $(SRC_DIR)/type.H > type.h
135 scope.h: $(SRC_DIR)/make.allocd $(SRC_DIR)/scope.H
136 $(SRC_DIR)/make.allocd < $(SRC_DIR)/scope.H > scope.h
138 node.h: $(SRC_DIR)/make.allocd $(SRC_DIR)/node.H
139 $(SRC_DIR)/make.allocd < $(SRC_DIR)/node.H > node.h
141 desig.h: $(SRC_DIR)/make.allocd $(SRC_DIR)/desig.H
142 $(SRC_DIR)/make.allocd < $(SRC_DIR)/desig.H > desig.h
144 tmpvar.c: $(SRC_DIR)/make.allocd $(SRC_DIR)/tmpvar.C
145 $(SRC_DIR)/make.allocd < $(SRC_DIR)/tmpvar.C > tmpvar.c
147 casestat.c: $(SRC_DIR)/make.allocd $(SRC_DIR)/casestat.C
148 $(SRC_DIR)/make.allocd < $(SRC_DIR)/casestat.C > casestat.c
150 next.c: $(NEXTFILES) $(SRC_DIR)/make.next
151 $(SRC_DIR)/make.next $(NEXTFILES) > next.c
153 char.c: $(SRC_DIR)/char.tab
154 $(TABGEN) -f$(SRC_DIR)/char.tab >char.c