proto.make 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. # $Id$
  2. # make C compiler
  3. #PARAMS do not remove this line!
  4. UTIL_BIN = \
  5. $(UTIL_HOME)/bin
  6. SRC_DIR = \
  7. $(SRC_HOME)/lang/cem/cemcom
  8. FSRC_DIR = \
  9. $(SRC_HOME)/fast/f_c
  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 $(SRC_DIR)/ival.g
  16. GEN_G = tokenfile.g
  17. GFILES= $(GEN_G) $(SRC_G)
  18. SRC_C = \
  19. $(SRC_DIR)/Version.c \
  20. $(SRC_DIR)/LLlex.c \
  21. $(SRC_DIR)/LLmessage.c \
  22. $(SRC_DIR)/arith.c \
  23. $(SRC_DIR)/asm.c \
  24. $(SRC_DIR)/blocks.c \
  25. $(SRC_DIR)/ch7.c \
  26. $(SRC_DIR)/ch7bin.c \
  27. $(SRC_DIR)/ch7mon.c \
  28. $(SRC_DIR)/code.c \
  29. $(SRC_DIR)/conversion.c \
  30. $(SRC_DIR)/cstoper.c \
  31. $(SRC_DIR)/dataflow.c \
  32. $(SRC_DIR)/declarator.c \
  33. $(SRC_DIR)/decspecs.c \
  34. $(SRC_DIR)/domacro.c \
  35. $(SRC_DIR)/dumpidf.c \
  36. $(SRC_DIR)/error.c \
  37. $(SRC_DIR)/eval.c \
  38. $(SRC_DIR)/expr.c \
  39. $(SRC_DIR)/field.c \
  40. $(SRC_DIR)/idf.c \
  41. $(SRC_DIR)/init.c \
  42. $(SRC_DIR)/input.c \
  43. $(SRC_DIR)/l_comment.c \
  44. $(SRC_DIR)/l_ev_ord.c \
  45. $(SRC_DIR)/l_lint.c \
  46. $(SRC_DIR)/l_misc.c \
  47. $(SRC_DIR)/l_outdef.c \
  48. $(SRC_DIR)/l_states.c \
  49. $(SRC_DIR)/label.c \
  50. $(SRC_DIR)/main.c \
  51. $(SRC_DIR)/options.c \
  52. $(SRC_DIR)/replace.c \
  53. $(SRC_DIR)/scan.c \
  54. $(SRC_DIR)/skip.c \
  55. $(SRC_DIR)/stack.c \
  56. $(SRC_DIR)/struct.c \
  57. $(SRC_DIR)/switch.c \
  58. $(SRC_DIR)/tokenname.c \
  59. $(SRC_DIR)/type.c \
  60. $(SRC_DIR)/util.c \
  61. $(SRC_DIR)/stab.c
  62. GEN_C = tokenfile.c program.c declar.c expression.c statement.c ival.c \
  63. symbol2str.c char.c Lpars.c next.c
  64. CFILES= $(SRC_C) $(GEN_C)
  65. SRC_H = \
  66. $(SRC_DIR)/LLlex.h \
  67. $(SRC_DIR)/align.h \
  68. $(SRC_DIR)/arith.h \
  69. $(SRC_DIR)/assert.h \
  70. $(SRC_DIR)/atw.h \
  71. $(SRC_DIR)/class.h \
  72. $(SRC_DIR)/decspecs.h \
  73. $(SRC_DIR)/file_info.h \
  74. $(SRC_DIR)/input.h \
  75. $(SRC_DIR)/interface.h \
  76. $(SRC_DIR)/l_class.h \
  77. $(SRC_DIR)/l_comment.h \
  78. $(SRC_DIR)/l_em.h \
  79. $(SRC_DIR)/l_lint.h \
  80. $(SRC_DIR)/label.h \
  81. $(SRC_DIR)/level.h \
  82. $(SRC_DIR)/mes.h \
  83. $(SRC_DIR)/sizes.h \
  84. $(SRC_DIR)/specials.h \
  85. $(SRC_DIR)/tokenname.h
  86. GEN_H = botch_free.h dataflow.h debug.h density.h errout.h \
  87. idfsize.h ifdepth.h inputtype.h lint.h \
  88. nobitfield.h nopp.h nocross.h \
  89. nparams.h numsize.h parbufsize.h pathlength.h Lpars.h \
  90. strsize.h target_sizes.h textsize.h use_tmp.h spec_arith.h static.h \
  91. regcount.h \
  92. code.h declar.h decspecs.h def.h expr.h field.h estack.h util.h \
  93. idf.h macro.h stmt.h struct.h switch.h type.h l_brace.h l_state.h \
  94. l_outdef.h stack.h lapbuf.h noRoption.h nofloat.h dbsymtab.h
  95. HFILES= $(GEN_H) $(SRC_H)
  96. NEXTFILES = \
  97. $(SRC_DIR)/code.str \
  98. $(SRC_DIR)/declar.str \
  99. $(SRC_DIR)/decspecs.str \
  100. $(SRC_DIR)/def.str \
  101. $(SRC_DIR)/expr.str \
  102. $(SRC_DIR)/field.str \
  103. $(SRC_DIR)/estack.str \
  104. $(SRC_DIR)/util.str \
  105. $(SRC_DIR)/idf.str \
  106. $(SRC_DIR)/macro.str \
  107. $(SRC_DIR)/stack.str \
  108. $(SRC_DIR)/stmt.str \
  109. $(SRC_DIR)/struct.str \
  110. $(SRC_DIR)/switch.str \
  111. $(SRC_DIR)/type.str \
  112. $(SRC_DIR)/l_brace.str \
  113. $(SRC_DIR)/l_state.str \
  114. $(SRC_DIR)/l_outdef.str
  115. all: make.main
  116. make -f make.main main
  117. install: all
  118. cp main $(TARGET_HOME)/lib.bin/c_ce
  119. cmp: all
  120. -cmp main $(TARGET_HOME)/lib.bin/c_ce
  121. opr:
  122. make pr | opr
  123. pr:
  124. @pr $(FSRC_DIR)/proto.make $(FSRC_DIR)/proto.main \
  125. $(FSRC_DIR)/Parameters
  126. lint: make.main
  127. make -f make.main lint
  128. Cfiles: hfiles LLfiles $(GEN_C) $(GEN_H) Makefile
  129. echo $(CFILES) | tr ' ' '\012' > Cfiles
  130. echo $(HFILES) | tr ' ' '\012' >> Cfiles
  131. resolved: Cfiles
  132. CC="$(CC)" UTIL_HOME="$(UTIL_HOME)" do_resolve `cat Cfiles` > Cfiles.new
  133. -if cmp -s Cfiles Cfiles.new ; then rm -f Cfiles.new ; else mv Cfiles.new Cfiles ; fi
  134. touch resolved
  135. # there is no file called "dependencies"; we want dependencies checked
  136. # every time. This means that make.main is made every time. Oh well ...
  137. # it does not take much time.
  138. dependencies: resolved
  139. do_deps `grep '.c$$' Cfiles`
  140. make.main: dependencies make_macros lists $(FSRC_DIR)/proto.main
  141. rm_deps $(FSRC_DIR)/proto.main | sed -e '/^.PARAMS/r make_macros' -e '/^.LISTS/r lists' > make.main
  142. cat *.dep >> make.main
  143. make_macros: Makefile
  144. echo 'SRC_DIR=$(SRC_DIR)' > make_macros
  145. echo 'UTIL_HOME=$(UTIL_HOME)' >> make_macros
  146. echo 'TARGET_HOME=$(TARGET_HOME)' >> make_macros
  147. echo 'CC=$(CC)' >> make_macros
  148. echo 'COPTIONS=$(COPTIONS) -DPEEPHOLE' >> make_macros
  149. echo 'LDOPTIONS=$(LDOPTIONS)' >> make_macros
  150. echo 'LINT=$(LINT)' >> make_macros
  151. echo 'LINTSUF=$(LINTSUF)' >> make_macros
  152. echo 'LINTPREF=$(LINTPREF)' >> make_macros
  153. echo 'LINTOPTIONS=$(LINTOPTIONS)' >> make_macros
  154. echo 'SUF=$(SUF)' >> make_macros
  155. echo 'LIBSUF=$(LIBSUF)' >> make_macros
  156. echo 'CC_AND_MKDEP=$(CC_AND_MKDEP)' >> make_macros
  157. echo 'MACH=$(MACH)' >> make_macros
  158. lists: Cfiles
  159. echo "C_SRC = \\" > lists
  160. echo $(CFILES) >> lists
  161. echo "OBJ = \\" >> lists
  162. echo $(CFILES) | sed -e 's|[^ ]*/||g' -e 's/\.c/.$$(SUF)/g' >> lists
  163. clean:
  164. -make -f make.main clean
  165. rm -f $(GEN_C) $(GEN_G) $(GEN_H) hfiles LLfiles Cfiles LL.output
  166. rm -f resolved *.dep lists make.main make_macros
  167. LLfiles: $(GFILES)
  168. $(LLGEN) $(LLGENOPTIONS) $(GFILES)
  169. @touch LLfiles
  170. hfiles: $(FSRC_DIR)/Parameters $(SRC_DIR)/make.hfiles
  171. $(SRC_DIR)/make.hfiles $(FSRC_DIR)/Parameters
  172. touch hfiles
  173. tokenfile.g: $(SRC_DIR)/tokenname.c $(SRC_DIR)/make.tokfile
  174. $(SRC_DIR)/make.tokfile <$(SRC_DIR)/tokenname.c >tokenfile.g
  175. symbol2str.c: $(SRC_DIR)/tokenname.c $(SRC_DIR)/make.tokcase
  176. $(SRC_DIR)/make.tokcase <$(SRC_DIR)/tokenname.c >symbol2str.c
  177. code.h: $(SRC_DIR)/code.str $(SRC_DIR)/make.allocd
  178. $(SRC_DIR)/make.allocd < $(SRC_DIR)/code.str > code.h
  179. declar.h: $(SRC_DIR)/declar.str $(SRC_DIR)/make.allocd
  180. $(SRC_DIR)/make.allocd < $(SRC_DIR)/declar.str > declar.h
  181. def.h: $(SRC_DIR)/def.str $(SRC_DIR)/make.allocd
  182. $(SRC_DIR)/make.allocd < $(SRC_DIR)/def.str > def.h
  183. expr.h: $(SRC_DIR)/expr.str $(SRC_DIR)/make.allocd
  184. $(SRC_DIR)/make.allocd < $(SRC_DIR)/expr.str > expr.h
  185. field.h: $(SRC_DIR)/field.str $(SRC_DIR)/make.allocd
  186. $(SRC_DIR)/make.allocd < $(SRC_DIR)/field.str > field.h
  187. estack.h: $(SRC_DIR)/estack.str $(SRC_DIR)/make.allocd
  188. $(SRC_DIR)/make.allocd < $(SRC_DIR)/estack.str > estack.h
  189. util.h: $(SRC_DIR)/util.str $(SRC_DIR)/make.allocd
  190. $(SRC_DIR)/make.allocd < $(SRC_DIR)/util.str > util.h
  191. decspecs.h: $(SRC_DIR)/decspecs.str $(SRC_DIR)/make.allocd
  192. $(SRC_DIR)/make.allocd < $(SRC_DIR)/decspecs.str > decspecs.h
  193. idf.h: $(SRC_DIR)/idf.str $(SRC_DIR)/make.allocd
  194. $(SRC_DIR)/make.allocd < $(SRC_DIR)/idf.str > idf.h
  195. macro.h: $(SRC_DIR)/macro.str $(SRC_DIR)/make.allocd
  196. $(SRC_DIR)/make.allocd < $(SRC_DIR)/macro.str > macro.h
  197. stack.h: $(SRC_DIR)/stack.str $(SRC_DIR)/make.allocd
  198. $(SRC_DIR)/make.allocd < $(SRC_DIR)/stack.str > stack.h
  199. stmt.h: $(SRC_DIR)/stmt.str $(SRC_DIR)/make.allocd
  200. $(SRC_DIR)/make.allocd < $(SRC_DIR)/stmt.str > stmt.h
  201. struct.h: $(SRC_DIR)/struct.str $(SRC_DIR)/make.allocd
  202. $(SRC_DIR)/make.allocd < $(SRC_DIR)/struct.str > struct.h
  203. switch.h: $(SRC_DIR)/switch.str $(SRC_DIR)/make.allocd
  204. $(SRC_DIR)/make.allocd < $(SRC_DIR)/switch.str > switch.h
  205. type.h: $(SRC_DIR)/type.str $(SRC_DIR)/make.allocd
  206. $(SRC_DIR)/make.allocd < $(SRC_DIR)/type.str > type.h
  207. l_brace.h: $(SRC_DIR)/l_brace.str $(SRC_DIR)/make.allocd
  208. $(SRC_DIR)/make.allocd < $(SRC_DIR)/l_brace.str > l_brace.h
  209. l_state.h: $(SRC_DIR)/l_state.str $(SRC_DIR)/make.allocd
  210. $(SRC_DIR)/make.allocd < $(SRC_DIR)/l_state.str > l_state.h
  211. l_outdef.h: $(SRC_DIR)/l_outdef.str $(SRC_DIR)/make.allocd
  212. $(SRC_DIR)/make.allocd < $(SRC_DIR)/l_outdef.str > l_outdef.h
  213. next.c: $(NEXTFILES) $(SRC_DIR)/make.next
  214. $(SRC_DIR)/make.next $(NEXTFILES) > next.c
  215. char.c: $(SRC_DIR)/char.tab
  216. $(TABGEN) -f$(SRC_DIR)/char.tab >char.c