proto.make 4.9 KB

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