123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266 |
- # $Id$
- # make C compiler
- #PARAMS do not remove this line!
- UTIL_BIN = \
- $(UTIL_HOME)/bin
- SRC_DIR = \
- $(SRC_HOME)/lang/cem/cemcom
- TABGEN= $(UTIL_BIN)/tabgen
- LLGEN = $(UTIL_BIN)/LLgen
- LLGENOPTIONS = \
- -n
- SRC_G = $(SRC_DIR)/program.g $(SRC_DIR)/declar.g \
- $(SRC_DIR)/expression.g $(SRC_DIR)/statement.g $(SRC_DIR)/ival.g
- GEN_G = tokenfile.g
- GFILES= $(GEN_G) $(SRC_G)
- SRC_C = \
- $(SRC_DIR)/LLlex.c \
- $(SRC_DIR)/LLmessage.c \
- $(SRC_DIR)/arith.c \
- $(SRC_DIR)/asm.c \
- $(SRC_DIR)/blocks.c \
- $(SRC_DIR)/ch7.c \
- $(SRC_DIR)/ch7bin.c \
- $(SRC_DIR)/ch7mon.c \
- $(SRC_DIR)/code.c \
- $(SRC_DIR)/conversion.c \
- $(SRC_DIR)/cstoper.c \
- $(SRC_DIR)/dataflow.c \
- $(SRC_DIR)/declarator.c \
- $(SRC_DIR)/decspecs.c \
- $(SRC_DIR)/domacro.c \
- $(SRC_DIR)/dumpidf.c \
- $(SRC_DIR)/error.c \
- $(SRC_DIR)/eval.c \
- $(SRC_DIR)/expr.c \
- $(SRC_DIR)/field.c \
- $(SRC_DIR)/idf.c \
- $(SRC_DIR)/init.c \
- $(SRC_DIR)/input.c \
- $(SRC_DIR)/l_comment.c \
- $(SRC_DIR)/l_ev_ord.c \
- $(SRC_DIR)/l_lint.c \
- $(SRC_DIR)/l_misc.c \
- $(SRC_DIR)/l_outdef.c \
- $(SRC_DIR)/l_states.c \
- $(SRC_DIR)/label.c \
- $(SRC_DIR)/main.c \
- $(SRC_DIR)/options.c \
- $(SRC_DIR)/replace.c \
- $(SRC_DIR)/scan.c \
- $(SRC_DIR)/skip.c \
- $(SRC_DIR)/stack.c \
- $(SRC_DIR)/struct.c \
- $(SRC_DIR)/switch.c \
- $(SRC_DIR)/tokenname.c \
- $(SRC_DIR)/type.c \
- $(SRC_DIR)/util.c \
- $(SRC_DIR)/stab.c
- GEN_C = tokenfile.c program.c declar.c expression.c statement.c ival.c \
- symbol2str.c char.c Lpars.c next.c Lncor.c
- CFILES= $(SRC_C) $(GEN_C)
- SRC_H = \
- $(SRC_DIR)/LLlex.h \
- $(SRC_DIR)/align.h \
- $(SRC_DIR)/arith.h \
- $(SRC_DIR)/assert.h \
- $(SRC_DIR)/atw.h \
- $(SRC_DIR)/class.h \
- $(SRC_DIR)/decspecs.h \
- $(SRC_DIR)/file_info.h \
- $(SRC_DIR)/input.h \
- $(SRC_DIR)/interface.h \
- $(SRC_DIR)/l_class.h \
- $(SRC_DIR)/l_comment.h \
- $(SRC_DIR)/l_em.h \
- $(SRC_DIR)/l_lint.h \
- $(SRC_DIR)/label.h \
- $(SRC_DIR)/level.h \
- $(SRC_DIR)/mes.h \
- $(SRC_DIR)/sizes.h \
- $(SRC_DIR)/specials.h \
- $(SRC_DIR)/tokenname.h
- GEN_H = botch_free.h dataflow.h debug.h density.h errout.h \
- idfsize.h ifdepth.h inputtype.h lint.h \
- nobitfield.h nopp.h nocross.h \
- nparams.h numsize.h parbufsize.h pathlength.h Lpars.h \
- strsize.h target_sizes.h textsize.h use_tmp.h spec_arith.h static.h \
- regcount.h \
- code.h declar.h decspecs.h def.h expr.h field.h estack.h util.h \
- idf.h macro.h stmt.h struct.h switch.h type.h l_brace.h l_state.h \
- l_outdef.h stack.h lapbuf.h noRoption.h nofloat.h dbsymtab.h
- HFILES= $(GEN_H) $(SRC_H)
- NEXTFILES = \
- $(SRC_DIR)/code.str \
- $(SRC_DIR)/declar.str \
- $(SRC_DIR)/decspecs.str \
- $(SRC_DIR)/def.str \
- $(SRC_DIR)/expr.str \
- $(SRC_DIR)/field.str \
- $(SRC_DIR)/estack.str \
- $(SRC_DIR)/util.str \
- $(SRC_DIR)/idf.str \
- $(SRC_DIR)/macro.str \
- $(SRC_DIR)/stack.str \
- $(SRC_DIR)/stmt.str \
- $(SRC_DIR)/struct.str \
- $(SRC_DIR)/switch.str \
- $(SRC_DIR)/type.str \
- $(SRC_DIR)/l_brace.str \
- $(SRC_DIR)/l_state.str \
- $(SRC_DIR)/l_outdef.str
- all: make.main
- make -f make.main main
- install: all
- cp main $(TARGET_HOME)/lib.bin/em_cemcom
- if [ $(DO_MACHINE_INDEP) = y ] ; \
- then cp $(SRC_DIR)/cemcom.1 em_cemcom.6 ; \
- mk_manpage em_cemcom.6 $(TARGET_HOME) ; \
- rm -f em_cemcom.6 ; \
- fi
- cmp: all
- -cmp main $(TARGET_HOME)/lib.bin/em_cemcom
- opr:
- make pr | opr
- pr:
- @pr $(SRC_DIR)/proto.make $(SRC_DIR)/proto.main Parameters \
- $(SRC_DIR)/char.tab $(SRC_G) $(SRC_H) $(NEXTFILES) $(SRC_C)
- lint: make.main
- make -f make.main lint
- Cfiles: hfiles LLfiles $(GEN_C) $(GEN_H) Makefile
- echo $(CFILES) | tr ' ' '\012' > Cfiles
- echo $(HFILES) | tr ' ' '\012' >> Cfiles
- resolved: Cfiles
- CC="$(CC)" UTIL_HOME="$(UTIL_HOME)" do_resolve `cat Cfiles` > Cfiles.new
- -if cmp -s Cfiles Cfiles.new ; then rm -f Cfiles.new ; else mv Cfiles.new Cfiles ; fi
- touch resolved
- # there is no file called "dependencies"; we want dependencies checked
- # every time. This means that make.main is made every time. Oh well ...
- # it does not take much time.
- dependencies: resolved
- do_deps `grep '.c$$' Cfiles`
- make.main: dependencies make_macros lists $(SRC_DIR)/proto.main
- rm_deps $(SRC_DIR)/proto.main | sed -e '/^.PARAMS/r make_macros' -e '/^.LISTS/r lists' > make.main
- cat *.dep >> make.main
- make_macros: Makefile
- echo 'SRC_DIR=$(SRC_DIR)' > make_macros
- echo 'UTIL_HOME=$(UTIL_HOME)' >> make_macros
- echo 'TARGET_HOME=$(TARGET_HOME)' >> make_macros
- echo 'CC=$(CC)' >> make_macros
- echo 'COPTIONS=$(COPTIONS)' >> make_macros
- echo 'LDOPTIONS=$(LDOPTIONS)' >> make_macros
- echo 'LINT=$(LINT)' >> make_macros
- echo 'LINTSUF=$(LINTSUF)' >> make_macros
- echo 'LINTPREF=$(LINTPREF)' >> make_macros
- echo 'LINTOPTIONS=$(LINTOPTIONS)' >> make_macros
- echo 'SUF=$(SUF)' >> make_macros
- echo 'LIBSUF=$(LIBSUF)' >> make_macros
- echo 'CC_AND_MKDEP=$(CC_AND_MKDEP)' >> make_macros
- lists: Cfiles
- echo "C_SRC = \\" > lists
- echo $(CFILES) >> lists
- echo "OBJ = \\" >> lists
- echo $(CFILES) | sed -e 's|[^ ]*/||g' -e 's/\.c/.$$(SUF)/g' >> lists
- clean:
- -make -f make.main clean
- rm -f $(GEN_C) $(GEN_G) $(GEN_H) hfiles LLfiles Cfiles LL.output
- rm -f resolved *.dep lists make.main make_macros
- LLfiles: $(GFILES)
- $(LLGEN) $(LLGENOPTIONS) $(GFILES)
- @touch LLfiles
- @if [ -f Lncor.c ] ; then : ; else touch Lncor.c ; fi
- hfiles: Parameters $(SRC_DIR)/make.hfiles
- $(SRC_DIR)/make.hfiles Parameters
- touch hfiles
- tokenfile.g: $(SRC_DIR)/tokenname.c $(SRC_DIR)/make.tokfile
- $(SRC_DIR)/make.tokfile <$(SRC_DIR)/tokenname.c >tokenfile.g
- symbol2str.c: $(SRC_DIR)/tokenname.c $(SRC_DIR)/make.tokcase
- $(SRC_DIR)/make.tokcase <$(SRC_DIR)/tokenname.c >symbol2str.c
- code.h: $(SRC_DIR)/code.str $(SRC_DIR)/make.allocd
- $(SRC_DIR)/make.allocd < $(SRC_DIR)/code.str > code.h
- declar.h: $(SRC_DIR)/declar.str $(SRC_DIR)/make.allocd
- $(SRC_DIR)/make.allocd < $(SRC_DIR)/declar.str > declar.h
- def.h: $(SRC_DIR)/def.str $(SRC_DIR)/make.allocd
- $(SRC_DIR)/make.allocd < $(SRC_DIR)/def.str > def.h
- expr.h: $(SRC_DIR)/expr.str $(SRC_DIR)/make.allocd
- $(SRC_DIR)/make.allocd < $(SRC_DIR)/expr.str > expr.h
- field.h: $(SRC_DIR)/field.str $(SRC_DIR)/make.allocd
- $(SRC_DIR)/make.allocd < $(SRC_DIR)/field.str > field.h
- estack.h: $(SRC_DIR)/estack.str $(SRC_DIR)/make.allocd
- $(SRC_DIR)/make.allocd < $(SRC_DIR)/estack.str > estack.h
- util.h: $(SRC_DIR)/util.str $(SRC_DIR)/make.allocd
- $(SRC_DIR)/make.allocd < $(SRC_DIR)/util.str > util.h
- decspecs.h: $(SRC_DIR)/decspecs.str $(SRC_DIR)/make.allocd
- $(SRC_DIR)/make.allocd < $(SRC_DIR)/decspecs.str > decspecs.h
- idf.h: $(SRC_DIR)/idf.str $(SRC_DIR)/make.allocd
- $(SRC_DIR)/make.allocd < $(SRC_DIR)/idf.str > idf.h
- macro.h: $(SRC_DIR)/macro.str $(SRC_DIR)/make.allocd
- $(SRC_DIR)/make.allocd < $(SRC_DIR)/macro.str > macro.h
- stack.h: $(SRC_DIR)/stack.str $(SRC_DIR)/make.allocd
- $(SRC_DIR)/make.allocd < $(SRC_DIR)/stack.str > stack.h
- stmt.h: $(SRC_DIR)/stmt.str $(SRC_DIR)/make.allocd
- $(SRC_DIR)/make.allocd < $(SRC_DIR)/stmt.str > stmt.h
- struct.h: $(SRC_DIR)/struct.str $(SRC_DIR)/make.allocd
- $(SRC_DIR)/make.allocd < $(SRC_DIR)/struct.str > struct.h
- switch.h: $(SRC_DIR)/switch.str $(SRC_DIR)/make.allocd
- $(SRC_DIR)/make.allocd < $(SRC_DIR)/switch.str > switch.h
- type.h: $(SRC_DIR)/type.str $(SRC_DIR)/make.allocd
- $(SRC_DIR)/make.allocd < $(SRC_DIR)/type.str > type.h
- l_brace.h: $(SRC_DIR)/l_brace.str $(SRC_DIR)/make.allocd
- $(SRC_DIR)/make.allocd < $(SRC_DIR)/l_brace.str > l_brace.h
- l_state.h: $(SRC_DIR)/l_state.str $(SRC_DIR)/make.allocd
- $(SRC_DIR)/make.allocd < $(SRC_DIR)/l_state.str > l_state.h
- l_outdef.h: $(SRC_DIR)/l_outdef.str $(SRC_DIR)/make.allocd
- $(SRC_DIR)/make.allocd < $(SRC_DIR)/l_outdef.str > l_outdef.h
- next.c: $(NEXTFILES) $(SRC_DIR)/make.next
- $(SRC_DIR)/make.next $(NEXTFILES) > next.c
- char.c: $(SRC_DIR)/char.tab
- $(TABGEN) -f$(SRC_DIR)/char.tab >char.c
|