proto.make 7.7 KB

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