proto.make 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. # $Id$
  2. # make Modula-2 compiler
  3. #PARAMS do not remove this line!
  4. UTIL_BIN = \
  5. $(UTIL_HOME)/bin
  6. SRC_DIR = \
  7. $(SRC_HOME)/lang/m2/comp
  8. FSRC_DIR = \
  9. $(SRC_HOME)/fast/f_m2
  10. TABGEN= $(UTIL_BIN)/tabgen
  11. LLGEN = $(UTIL_BIN)/LLgen
  12. LLGENOPTIONS = \
  13. -v
  14. SRC_G = $(SRC_DIR)/program.g $(SRC_DIR)/declar.g \
  15. $(SRC_DIR)/expression.g $(SRC_DIR)/statement.g
  16. GEN_G = tokenfile.g
  17. GFILES= $(GEN_G) $(SRC_G)
  18. SRC_C = $(SRC_DIR)/LLlex.c $(SRC_DIR)/LLmessage.c $(SRC_DIR)/error.c \
  19. $(SRC_DIR)/main.c $(SRC_DIR)/tokenname.c $(SRC_DIR)/idf.c \
  20. $(SRC_DIR)/input.c $(SRC_DIR)/type.c $(SRC_DIR)/def.c \
  21. $(SRC_DIR)/misc.c $(SRC_DIR)/enter.c $(SRC_DIR)/defmodule.c \
  22. $(SRC_DIR)/typequiv.c $(SRC_DIR)/node.c $(SRC_DIR)/cstoper.c \
  23. $(SRC_DIR)/chk_expr.c $(SRC_DIR)/options.c $(SRC_DIR)/walk.c \
  24. $(SRC_DIR)/desig.c $(SRC_DIR)/code.c $(SRC_DIR)/lookup.c \
  25. $(SRC_DIR)/Version.c $(SRC_DIR)/stab.c
  26. GEN_C = tokenfile.c program.c declar.c expression.c statement.c \
  27. symbol2str.c char.c Lpars.c casestat.c tmpvar.c scope.c next.c
  28. CFILES= $(SRC_C) $(GEN_C)
  29. SRC_H = $(SRC_DIR)/LLlex.h $(SRC_DIR)/chk_expr.h $(SRC_DIR)/class.h \
  30. $(SRC_DIR)/debug.h $(SRC_DIR)/desig.h $(SRC_DIR)/f_info.h \
  31. $(SRC_DIR)/idf.h $(SRC_DIR)/input.h $(SRC_DIR)/main.h \
  32. $(SRC_DIR)/misc.h $(SRC_DIR)/scope.h $(SRC_DIR)/standards.h \
  33. $(SRC_DIR)/tokenname.h $(SRC_DIR)/walk.h $(SRC_DIR)/warning.h \
  34. $(SRC_DIR)/SYSTEM.h
  35. GEN_H = errout.h idfsize.h numsize.h strsize.h target_sizes.h bigresult.h \
  36. inputtype.h density.h squeeze.h nocross.h nostrict.h def.h debugcst.h \
  37. type.h Lpars.h node.h strict3rd.h real.h use_insert.h dbsymtab.h \
  38. uns_arith.h def.h type.h node.h real.h
  39. HFILES= $(GEN_H) $(SRC_H)
  40. NEXTFILES = \
  41. $(SRC_DIR)/def.H $(SRC_DIR)/type.H $(SRC_DIR)/node.H $(SRC_DIR)/real.H \
  42. $(SRC_DIR)/scope.C $(SRC_DIR)/tmpvar.C $(SRC_DIR)/casestat.C
  43. all: make.main
  44. make -f make.main main
  45. install: all
  46. cp main $(TARGET_HOME)/lib.bin/m2_ce
  47. cmp: all
  48. -cmp main $(TARGET_HOME)/lib.bin/m2_ce
  49. opr:
  50. make pr | opr
  51. pr:
  52. @pr $(FSRC_DIR)/proto.make $(FSRC_DIR)/proto.main \
  53. $(FSRC_DIR)/Parameters
  54. lint: make.main
  55. make -f make.main lint
  56. Cfiles: hfiles LLfiles $(GEN_C) $(GEN_H) Makefile
  57. echo $(CFILES) | tr ' ' '\012' > Cfiles
  58. echo $(HFILES) | tr ' ' '\012' >> Cfiles
  59. resolved: Cfiles
  60. CC="$(CC)" UTIL_HOME="$(UTIL_HOME)" do_resolve `cat Cfiles` > Cfiles.new
  61. -if cmp -s Cfiles Cfiles.new ; then rm -f Cfiles.new ; else mv Cfiles.new Cfiles ; fi
  62. touch resolved
  63. # there is no file called "dependencies"; we want dependencies checked
  64. # every time. This means that make.main is made every time. Oh well ...
  65. # it does not take much time.
  66. dependencies: resolved
  67. do_deps `grep '.c$$' Cfiles`
  68. make.main: dependencies make_macros lists $(FSRC_DIR)/proto.main
  69. rm_deps $(FSRC_DIR)/proto.main | sed -e '/^.PARAMS/r make_macros' -e '/^.LISTS/r lists' > make.main
  70. cat *.dep >> make.main
  71. make_macros: Makefile
  72. echo 'SRC_DIR=$(SRC_DIR)' > make_macros
  73. echo 'UTIL_HOME=$(UTIL_HOME)' >> make_macros
  74. echo 'TARGET_HOME=$(TARGET_HOME)' >> make_macros
  75. echo 'CC=$(CC)' >> make_macros
  76. echo 'COPTIONS=$(COPTIONS) -DPEEPHOLE' >> make_macros
  77. echo 'LDOPTIONS=$(LDOPTIONS)' >> make_macros
  78. echo 'LINT=$(LINT)' >> make_macros
  79. echo 'LINTOPTIONS=$(LINTOPTIONS)' >> make_macros
  80. echo 'LINTSUF=$(LINTSUF)' >> make_macros
  81. echo 'LINTPREF=$(LINTPREF)' >> make_macros
  82. echo 'SUF=$(SUF)' >> make_macros
  83. echo 'LIBSUF=$(LIBSUF)' >> make_macros
  84. echo 'CC_AND_MKDEP=$(CC_AND_MKDEP)' >> make_macros
  85. echo 'MACH=$(MACH)' >> make_macros
  86. lists: Cfiles
  87. echo "C_SRC = \\" > lists
  88. echo $(CFILES) >> lists
  89. echo "OBJ = \\" >> lists
  90. echo $(CFILES) | sed -e 's|[^ ]*/||g' -e 's/\.c/.$$(SUF)/g' >> lists
  91. clean:
  92. -make -f make.main clean
  93. rm -f $(GEN_C) $(GEN_G) $(GEN_H) hfiles LLfiles Cfiles LL.output
  94. rm -f resolved *.dep lists make.main make_macros
  95. LLfiles: $(GFILES)
  96. $(LLGEN) $(LLGENOPTIONS) $(GFILES)
  97. @touch LLfiles
  98. hfiles: $(FSRC_DIR)/Parameters $(SRC_DIR)/make.hfiles
  99. $(SRC_DIR)/make.hfiles $(FSRC_DIR)/Parameters
  100. touch hfiles
  101. tokenfile.g: $(SRC_DIR)/tokenname.c $(SRC_DIR)/make.tokfile
  102. $(SRC_DIR)/make.tokfile <$(SRC_DIR)/tokenname.c >tokenfile.g
  103. symbol2str.c: $(SRC_DIR)/tokenname.c $(SRC_DIR)/make.tokcase
  104. $(SRC_DIR)/make.tokcase <$(SRC_DIR)/tokenname.c >symbol2str.c
  105. def.h: $(SRC_DIR)/make.allocd $(SRC_DIR)/def.H
  106. $(SRC_DIR)/make.allocd < $(SRC_DIR)/def.H > def.h
  107. type.h: $(SRC_DIR)/make.allocd $(SRC_DIR)/type.H
  108. $(SRC_DIR)/make.allocd < $(SRC_DIR)/type.H > type.h
  109. real.h: $(SRC_DIR)/make.allocd $(SRC_DIR)/real.H
  110. $(SRC_DIR)/make.allocd < $(SRC_DIR)/real.H > real.h
  111. node.h: $(SRC_DIR)/make.allocd $(SRC_DIR)/node.H
  112. $(SRC_DIR)/make.allocd < $(SRC_DIR)/node.H > node.h
  113. scope.c: $(SRC_DIR)/make.allocd $(SRC_DIR)/scope.C
  114. $(SRC_DIR)/make.allocd < $(SRC_DIR)/scope.C > scope.c
  115. tmpvar.c: $(SRC_DIR)/make.allocd $(SRC_DIR)/tmpvar.C
  116. $(SRC_DIR)/make.allocd < $(SRC_DIR)/tmpvar.C > tmpvar.c
  117. casestat.c: $(SRC_DIR)/make.allocd $(SRC_DIR)/casestat.C
  118. $(SRC_DIR)/make.allocd < $(SRC_DIR)/casestat.C > casestat.c
  119. next.c: $(NEXTFILES) $(SRC_DIR)/make.next
  120. $(SRC_DIR)/make.next $(NEXTFILES) > next.c
  121. char.c: $(SRC_DIR)/char.tab
  122. $(TABGEN) -f$(SRC_DIR)/char.tab >char.c