1 # $Id: proto.make,v 1.5 1994/06/24 11:31:06 ceriel Exp $
5 #PARAMS do not remove this line!
10 $(SRC_HOME)/lang/basic/src
12 TABGEN= $(UTIL_BIN)/tabgen
13 LLGEN = $(UTIL_BIN)/LLgen
17 SRC_G = $(SRC_DIR)/basic.g
19 GFILES= $(GEN_G) $(SRC_G)
23 $(SRC_DIR)/symbols.c \
24 $(SRC_DIR)/initialize.c \
25 $(SRC_DIR)/compile.c \
26 $(SRC_DIR)/parsepar.c \
27 $(SRC_DIR)/gencode.c \
32 GEN_C = basic.c Lpars.c
33 CFILES= $(SRC_C) $(GEN_C)
37 $(SRC_DIR)/symbols.h \
41 GEN_H = Lpars.h tokentab.h
42 HFILES= $(GEN_H) $(SRC_H)
45 make -f make.main main
48 @-mkdir $(TARGET_HOME)
49 @-mkdir $(TARGET_HOME)/lib.bin
50 cp main $(TARGET_HOME)/lib.bin/em_bem
53 -cmp main $(TARGET_HOME)/lib.bin/em_bem
59 @pr $(SRC_DIR)/proto.make $(SRC_DIR)/proto.main \
60 $(SRC_DIR)/maketokentab $(SRC_DIR)/basic.lex \
61 $(SRC_G) $(SRC_H) $(SRC_C)
64 make -f make.main lint
66 Cfiles: LLfiles $(GEN_C) $(GEN_H) Makefile
67 echo $(CFILES) | tr ' ' '\012' > Cfiles
68 echo $(HFILES) | tr ' ' '\012' >> Cfiles
71 CC="$(CC)" UTIL_HOME="$(UTIL_HOME)" do_resolve `cat Cfiles` > Cfiles.new
72 -if cmp -s Cfiles Cfiles.new ; then rm -f Cfiles.new ; else mv Cfiles.new Cfiles ; fi
75 # there is no file called "dependencies"; we want dependencies checked
76 # every time. This means that make.main is made every time. Oh well ...
77 # it does not take much time.
78 dependencies: resolved
79 do_deps `grep '.c$$' Cfiles`
81 make.main: dependencies make_macros lists $(SRC_DIR)/proto.main
82 rm_deps $(SRC_DIR)/proto.main | sed -e '/^.PARAMS/r make_macros' -e '/^.LISTS/r lists' > make.main
83 cat *.dep >> make.main
86 echo 'SRC_DIR=$(SRC_DIR)' > make_macros
87 echo 'UTIL_HOME=$(UTIL_HOME)' >> make_macros
88 echo 'TARGET_HOME=$(TARGET_HOME)' >> make_macros
89 echo 'CC=$(CC)' >> make_macros
90 echo 'COPTIONS=$(COPTIONS)' >> make_macros
91 echo 'LDOPTIONS=$(LDOPTIONS)' >> make_macros
92 echo 'LINT=$(LINT)' >> make_macros
93 echo 'LINTSUF=$(LINTSUF)' >> make_macros
94 echo 'LINTPREF=$(LINTPREF)' >> make_macros
95 echo 'LINTOPTIONS=$(LINTOPTIONS)' >> make_macros
96 echo 'SUF=$(SUF)' >> make_macros
97 echo 'LIBSUF=$(LIBSUF)' >> make_macros
98 echo 'CC_AND_MKDEP=$(CC_AND_MKDEP)' >> make_macros
101 echo "C_SRC = \\" > lists
102 echo $(CFILES) >> lists
103 echo "OBJ = \\" >> lists
104 echo $(CFILES) | sed -e 's|[^ ]*/||g' -e 's/\.c/.$$(SUF)/g' >> lists
107 -make -f make.main clean
108 rm -f $(GEN_C) $(GEN_G) $(GEN_H) $(GEN_L) LLfiles Cfiles LL.output
109 rm -f resolved *.dep lists make.main make_macros
112 $(LLGEN) $(LLGENOPTIONS) $(GFILES)
115 tokentab.h: Lpars.h $(SRC_DIR)/maketokentab
116 $(SRC_DIR)/maketokentab