proto.make 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. # $Id$
  2. # make basic compiler
  3. #PARAMS do not remove this line!
  4. UTIL_BIN = \
  5. $(UTIL_HOME)/bin
  6. SRC_DIR = \
  7. $(SRC_HOME)/lang/basic/src
  8. TABGEN= $(UTIL_BIN)/tabgen
  9. LLGEN = $(UTIL_BIN)/LLgen
  10. LLGENOPTIONS = \
  11. -v
  12. SRC_G = $(SRC_DIR)/basic.g
  13. GEN_G =
  14. GFILES= $(GEN_G) $(SRC_G)
  15. SRC_C = \
  16. $(SRC_DIR)/bem.c \
  17. $(SRC_DIR)/symbols.c \
  18. $(SRC_DIR)/initialize.c \
  19. $(SRC_DIR)/compile.c \
  20. $(SRC_DIR)/parsepar.c \
  21. $(SRC_DIR)/gencode.c \
  22. $(SRC_DIR)/util.c \
  23. $(SRC_DIR)/graph.c \
  24. $(SRC_DIR)/eval.c \
  25. $(SRC_DIR)/func.c
  26. GEN_C = basic.c Lpars.c
  27. CFILES= $(SRC_C) $(GEN_C)
  28. SRC_H = \
  29. $(SRC_DIR)/bem.h \
  30. $(SRC_DIR)/symbols.h \
  31. $(SRC_DIR)/graph.h \
  32. $(SRC_DIR)/llmess.c \
  33. $(SRC_DIR)/yylexp.c
  34. GEN_H = Lpars.h tokentab.h
  35. HFILES= $(GEN_H) $(SRC_H)
  36. all: make.main
  37. make -f make.main main
  38. install: all
  39. @-mkdir $(TARGET_HOME)
  40. @-mkdir $(TARGET_HOME)/lib.bin
  41. cp main $(TARGET_HOME)/lib.bin/em_bem
  42. cmp: all
  43. -cmp main $(TARGET_HOME)/lib.bin/em_bem
  44. opr:
  45. make pr | opr
  46. pr:
  47. @pr $(SRC_DIR)/proto.make $(SRC_DIR)/proto.main \
  48. $(SRC_DIR)/maketokentab $(SRC_DIR)/basic.lex \
  49. $(SRC_G) $(SRC_H) $(SRC_C)
  50. lint: make.main
  51. make -f make.main lint
  52. Cfiles: LLfiles $(GEN_C) $(GEN_H) Makefile
  53. echo $(CFILES) | tr ' ' '\012' > Cfiles
  54. echo $(HFILES) | tr ' ' '\012' >> Cfiles
  55. resolved: Cfiles
  56. CC="$(CC)" UTIL_HOME="$(UTIL_HOME)" do_resolve `cat Cfiles` > Cfiles.new
  57. -if cmp -s Cfiles Cfiles.new ; then rm -f Cfiles.new ; else mv Cfiles.new Cfiles ; fi
  58. touch resolved
  59. # there is no file called "dependencies"; we want dependencies checked
  60. # every time. This means that make.main is made every time. Oh well ...
  61. # it does not take much time.
  62. dependencies: resolved
  63. do_deps `grep '.c$$' Cfiles`
  64. make.main: dependencies make_macros lists $(SRC_DIR)/proto.main
  65. rm_deps $(SRC_DIR)/proto.main | sed -e '/^.PARAMS/r make_macros' -e '/^.LISTS/r lists' > make.main
  66. cat *.dep >> make.main
  67. make_macros: Makefile
  68. echo 'SRC_DIR=$(SRC_DIR)' > make_macros
  69. echo 'UTIL_HOME=$(UTIL_HOME)' >> make_macros
  70. echo 'TARGET_HOME=$(TARGET_HOME)' >> make_macros
  71. echo 'CC=$(CC)' >> make_macros
  72. echo 'COPTIONS=$(COPTIONS)' >> make_macros
  73. echo 'LDOPTIONS=$(LDOPTIONS)' >> make_macros
  74. echo 'LINT=$(LINT)' >> make_macros
  75. echo 'LINTSUF=$(LINTSUF)' >> make_macros
  76. echo 'LINTPREF=$(LINTPREF)' >> make_macros
  77. echo 'LINTOPTIONS=$(LINTOPTIONS)' >> make_macros
  78. echo 'SUF=$(SUF)' >> make_macros
  79. echo 'LIBSUF=$(LIBSUF)' >> make_macros
  80. echo 'CC_AND_MKDEP=$(CC_AND_MKDEP)' >> make_macros
  81. lists: Cfiles
  82. echo "C_SRC = \\" > lists
  83. echo $(CFILES) >> lists
  84. echo "OBJ = \\" >> lists
  85. echo $(CFILES) | sed -e 's|[^ ]*/||g' -e 's/\.c/.$$(SUF)/g' >> lists
  86. clean:
  87. -make -f make.main clean
  88. rm -f $(GEN_C) $(GEN_G) $(GEN_H) $(GEN_L) LLfiles Cfiles LL.output
  89. rm -f resolved *.dep lists make.main make_macros
  90. LLfiles: $(GFILES)
  91. $(LLGEN) $(LLGENOPTIONS) $(GFILES)
  92. @touch LLfiles
  93. tokentab.h: Lpars.h $(SRC_DIR)/maketokentab
  94. $(SRC_DIR)/maketokentab