proto.make 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. # $Id$
  2. #PARAMS do not remove this line!
  3. SRC_DIR = $(SRC_HOME)/util/cpp
  4. MODULES=$(TARGET_HOME)/modules
  5. UMODULES=$(UTIL_HOME)/modules
  6. MODULESLIB=$(MODULES)/lib
  7. UMODULESLIB=$(UMODULES)/lib
  8. BIN=$(TARGET_HOME)/lib.bin
  9. # Libraries
  10. SYSLIB = $(MODULESLIB)/libsystem.$(LIBSUF)
  11. STRLIB = $(MODULESLIB)/libstring.$(LIBSUF)
  12. PRTLIB = $(MODULESLIB)/libprint.$(LIBSUF)
  13. ALLOCLIB = $(MODULESLIB)/liballoc.$(LIBSUF)
  14. ASSERTLIB = $(MODULESLIB)/libassert.$(LIBSUF)
  15. MALLOC = $(MODULESLIB)/malloc.$(SUF)
  16. LIBS = $(PRTLIB) $(STRLIB) $(ALLOCLIB) $(MALLOC) $(ASSERTLIB) $(SYSLIB)
  17. LINTLIBS = \
  18. $(UMODULESLIB)/$(LINTPREF)print.$(LINTSUF) \
  19. $(UMODULESLIB)/$(LINTPREF)string.$(LINTSUF) \
  20. $(UMODULESLIB)/$(LINTPREF)alloc.$(LINTSUF) \
  21. $(UMODULESLIB)/$(LINTPREF)assert.$(LINTSUF) \
  22. $(UMODULESLIB)/$(LINTPREF)system.$(LINTSUF)
  23. INCLUDES = -I$(MODULES)/h -I$(MODULES)/pkg -I. -I$(SRC_DIR)
  24. CFLAGS = $(INCLUDES) $(COPTIONS)
  25. LDFLAGS = $(LDOPTIONS)
  26. LINTFLAGS = $(INCLUDES) $(LINTOPTIONS)
  27. # Where to install the preprocessor
  28. CEMPP = $(BIN)/cpp
  29. # Grammar files and their objects
  30. LSRC = tokenfile.g $(SRC_DIR)/expression.g
  31. LCSRC = tokenfile.c expression.c Lpars.c
  32. LOBJ = tokenfile.$(SUF) expression.$(SUF) Lpars.$(SUF)
  33. # Objects of hand-written C files
  34. CSRC = $(SRC_DIR)/LLlex.c $(SRC_DIR)/LLmessage.c $(SRC_DIR)/ch7bin.c \
  35. $(SRC_DIR)/ch7mon.c $(SRC_DIR)/domacro.c $(SRC_DIR)/error.c \
  36. $(SRC_DIR)/idf.c $(SRC_DIR)/init.c $(SRC_DIR)/input.c \
  37. $(SRC_DIR)/main.c $(SRC_DIR)/options.c \
  38. $(SRC_DIR)/preprocess.c $(SRC_DIR)/replace.c $(SRC_DIR)/scan.c \
  39. $(SRC_DIR)/skip.c $(SRC_DIR)/tokenname.c $(SRC_DIR)/next.c \
  40. $(SRC_DIR)/expr.c
  41. COBJ = LLlex.$(SUF) LLmessage.$(SUF) ch7bin.$(SUF) ch7mon.$(SUF) \
  42. domacro.$(SUF) error.$(SUF) idf.$(SUF) init.$(SUF) input.$(SUF) \
  43. main.$(SUF) options.$(SUF) \
  44. preprocess.$(SUF) replace.$(SUF) scan.$(SUF) skip.$(SUF) \
  45. tokenname.$(SUF) next.$(SUF) expr.$(SUF)
  46. PRFILES = $(SRC_DIR)/proto.make $(SRC_DIR)/Parameters \
  47. $(SRC_DIR)/make.hfiles $(SRC_DIR)/make.tokcase $(SRC_DIR)/make.tokfile \
  48. $(SRC_DIR)/LLlex.h $(SRC_DIR)/bits.h $(SRC_DIR)/file_info.h \
  49. $(SRC_DIR)/idf.h $(SRC_DIR)/input.h $(SRC_DIR)/interface.h \
  50. $(SRC_DIR)/macro.h \
  51. $(SRC_DIR)/class.h $(SRC_DIR)/char.tab $(SRC_DIR)/expression.g $(CSRC)
  52. # Objects of other generated C files
  53. GOBJ = char.$(SUF) symbol2str.$(SUF)
  54. # generated source files
  55. GSRC = char.c symbol2str.c
  56. # .h files generated by `make hfiles'; PLEASE KEEP THIS UP-TO-DATE!
  57. GHSRC = errout.h idfsize.h ifdepth.h lapbuf.h \
  58. nparams.h numsize.h obufsize.h \
  59. parbufsize.h pathlength.h strsize.h textsize.h \
  60. botch_free.h debug.h inputtype.h dobits.h line_prefix.h
  61. # Other generated files, for 'make clean' only
  62. GENERATED = tokenfile.g Lpars.h LLfiles LL.output lint.out \
  63. Xref hfiles cfiles
  64. all: cc
  65. cc: hfiles LLfiles
  66. make cpp
  67. hfiles: Parameters char.c
  68. $(SRC_DIR)/make.hfiles Parameters
  69. @touch hfiles
  70. Parameters: $(SRC_DIR)/Parameters
  71. cp $(SRC_DIR)/Parameters Parameters
  72. char.c: $(SRC_DIR)/char.tab
  73. tabgen -f$(SRC_DIR)/char.tab > char.c
  74. LLfiles: $(LSRC)
  75. LLgen $(LLGENOPTIONS) $(LSRC)
  76. @touch LLfiles
  77. tokenfile.g: $(SRC_DIR)/tokenname.c $(SRC_DIR)/make.tokfile
  78. <$(SRC_DIR)/tokenname.c $(SRC_DIR)/make.tokfile >tokenfile.g
  79. symbol2str.c: $(SRC_DIR)/tokenname.c $(SRC_DIR)/make.tokcase
  80. <$(SRC_DIR)/tokenname.c $(SRC_DIR)/make.tokcase >symbol2str.c
  81. # Objects needed for 'cpp'
  82. OBJ = $(COBJ) $(LOBJ) $(GOBJ)
  83. SRC = $(CSRC) $(LCSRC) $(GSRC)
  84. cpp: $(OBJ)
  85. $(CC) $(LDFLAGS) $(OBJ) $(LIBS) -o cpp
  86. cfiles: hfiles LLfiles $(GSRC)
  87. @touch cfiles
  88. install: all
  89. cp cpp $(CEMPP)
  90. if [ $(DO_MACHINE_INDEP) = y ] ; \
  91. then mk_manpage $(SRC_DIR)/cpp.6 $(TARGET_HOME) ; \
  92. fi
  93. cmp: all
  94. -cmp cpp $(CEMPP)
  95. pr:
  96. @pr $(PRFILES)
  97. opr:
  98. make pr | opr
  99. tags: cfiles
  100. ctags $(SRC)
  101. depend: cfiles
  102. rm_deps Makefile >Makefile.new
  103. for i in $(SRC) ; do \
  104. echo "`basename $$i .c`.$$(SUF): $$i" >> Makefile.new ; \
  105. echo ' $$(CC) -c $$(CFLAGS)' $$i >> Makefile.new ; \
  106. $(UTIL_HOME)/lib.bin/cpp -d $(INCLUDES) $$i | sed "s/^/`basename $$i .c`.$$(SUF): /" >> Makefile.new ; \
  107. done
  108. mv Makefile Makefile.old
  109. mv Makefile.new Makefile
  110. lint: cfiles
  111. $(LINT) $(LINTFLAGS) $(INCLUDES) $(SRC) $(LINTLIBS)
  112. clean:
  113. rm -f $(LCSRC) $(OBJ) $(GENERATED) $(GSRC) $(GHSRC) cpp Out
  114. # do not remove the next line. It is used for generating dependencies.
  115. #DEPENDENCIES
  116. LLlex.$(SUF): $(SRC_DIR)/LLlex.c
  117. $(CC) -c $(CFLAGS) $(SRC_DIR)/LLlex.c
  118. LLlex.$(SUF): ./dobits.h
  119. LLlex.$(SUF): $(SRC_DIR)/bits.h
  120. LLlex.$(SUF): $(SRC_DIR)/class.h
  121. LLlex.$(SUF): ./Lpars.h
  122. LLlex.$(SUF): $(SRC_DIR)/file_info.h
  123. LLlex.$(SUF): $(TARGET_HOME)/modules/h/em_arith.h
  124. LLlex.$(SUF): $(SRC_DIR)/LLlex.h
  125. LLlex.$(SUF): $(TARGET_HOME)/modules/pkg/idf_pkg.spec
  126. LLlex.$(SUF): $(SRC_DIR)/idf.h
  127. LLlex.$(SUF): $(TARGET_HOME)/modules/pkg/inp_pkg.spec
  128. LLlex.$(SUF): ./inputtype.h
  129. LLlex.$(SUF): $(SRC_DIR)/input.h
  130. LLlex.$(SUF): $(TARGET_HOME)/modules/h/alloc.h
  131. LLlex.$(SUF): ./strsize.h
  132. LLlex.$(SUF): ./numsize.h
  133. LLlex.$(SUF): ./idfsize.h
  134. LLmessage.$(SUF): $(SRC_DIR)/LLmessage.c
  135. $(CC) -c $(CFLAGS) $(SRC_DIR)/LLmessage.c
  136. LLmessage.$(SUF): ./Lpars.h
  137. LLmessage.$(SUF): $(SRC_DIR)/file_info.h
  138. LLmessage.$(SUF): $(TARGET_HOME)/modules/h/em_arith.h
  139. LLmessage.$(SUF): $(SRC_DIR)/LLlex.h
  140. ch7bin.$(SUF): $(SRC_DIR)/ch7bin.c
  141. $(CC) -c $(CFLAGS) $(SRC_DIR)/ch7bin.c
  142. ch7bin.$(SUF): $(TARGET_HOME)/modules/h/em_arith.h
  143. ch7bin.$(SUF): ./Lpars.h
  144. ch7mon.$(SUF): $(SRC_DIR)/ch7mon.c
  145. $(CC) -c $(CFLAGS) $(SRC_DIR)/ch7mon.c
  146. ch7mon.$(SUF): $(TARGET_HOME)/modules/h/em_arith.h
  147. ch7mon.$(SUF): ./Lpars.h
  148. domacro.$(SUF): $(SRC_DIR)/domacro.c
  149. $(CC) -c $(CFLAGS) $(SRC_DIR)/domacro.c
  150. domacro.$(SUF): ./dobits.h
  151. domacro.$(SUF): $(SRC_DIR)/bits.h
  152. domacro.$(SUF): $(SRC_DIR)/macro.h
  153. domacro.$(SUF): $(SRC_DIR)/class.h
  154. domacro.$(SUF): $(TARGET_HOME)/modules/h/alloc.h
  155. domacro.$(SUF): $(TARGET_HOME)/modules/h/assert.h
  156. domacro.$(SUF): ./idfsize.h
  157. domacro.$(SUF): ./textsize.h
  158. domacro.$(SUF): ./parbufsize.h
  159. domacro.$(SUF): ./nparams.h
  160. domacro.$(SUF): ./botch_free.h
  161. domacro.$(SUF): ./ifdepth.h
  162. domacro.$(SUF): $(TARGET_HOME)/modules/pkg/inp_pkg.spec
  163. domacro.$(SUF): ./inputtype.h
  164. domacro.$(SUF): $(SRC_DIR)/input.h
  165. domacro.$(SUF): $(TARGET_HOME)/modules/pkg/idf_pkg.spec
  166. domacro.$(SUF): $(SRC_DIR)/idf.h
  167. domacro.$(SUF): ./debug.h
  168. domacro.$(SUF): ./Lpars.h
  169. domacro.$(SUF): $(SRC_DIR)/file_info.h
  170. domacro.$(SUF): $(TARGET_HOME)/modules/h/em_arith.h
  171. domacro.$(SUF): $(SRC_DIR)/LLlex.h
  172. domacro.$(SUF): $(SRC_DIR)/interface.h
  173. error.$(SUF): $(SRC_DIR)/error.c
  174. $(CC) -c $(CFLAGS) $(SRC_DIR)/error.c
  175. error.$(SUF): $(SRC_DIR)/file_info.h
  176. error.$(SUF): $(TARGET_HOME)/modules/h/em_arith.h
  177. error.$(SUF): $(SRC_DIR)/LLlex.h
  178. error.$(SUF): ./errout.h
  179. error.$(SUF): $(TARGET_HOME)/modules/h/system.h
  180. idf.$(SUF): $(SRC_DIR)/idf.c
  181. $(CC) -c $(CFLAGS) $(SRC_DIR)/idf.c
  182. idf.$(SUF): $(TARGET_HOME)/modules/h/alloc.h
  183. idf.$(SUF): $(TARGET_HOME)/modules/pkg/idf_pkg.body
  184. idf.$(SUF): $(TARGET_HOME)/modules/pkg/idf_pkg.spec
  185. idf.$(SUF): $(SRC_DIR)/idf.h
  186. init.$(SUF): $(SRC_DIR)/init.c
  187. $(CC) -c $(CFLAGS) $(SRC_DIR)/init.c
  188. init.$(SUF): $(SRC_DIR)/interface.h
  189. init.$(SUF): $(TARGET_HOME)/modules/pkg/idf_pkg.spec
  190. init.$(SUF): $(SRC_DIR)/idf.h
  191. init.$(SUF): $(SRC_DIR)/macro.h
  192. init.$(SUF): $(SRC_DIR)/class.h
  193. init.$(SUF): $(TARGET_HOME)/modules/h/alloc.h
  194. init.$(SUF): $(TARGET_HOME)/modules/h/system.h
  195. input.$(SUF): $(SRC_DIR)/input.c
  196. $(CC) -c $(CFLAGS) $(SRC_DIR)/input.c
  197. input.$(SUF): $(TARGET_HOME)/modules/h/system.h
  198. input.$(SUF): $(TARGET_HOME)/modules/h/alloc.h
  199. input.$(SUF): $(TARGET_HOME)/modules/pkg/inp_pkg.body
  200. input.$(SUF): $(TARGET_HOME)/modules/pkg/inp_pkg.spec
  201. input.$(SUF): ./inputtype.h
  202. input.$(SUF): $(SRC_DIR)/input.h
  203. input.$(SUF): $(SRC_DIR)/file_info.h
  204. main.$(SUF): $(SRC_DIR)/main.c
  205. $(CC) -c $(CFLAGS) $(SRC_DIR)/main.c
  206. main.$(SUF): $(SRC_DIR)/macro.h
  207. main.$(SUF): $(TARGET_HOME)/modules/pkg/idf_pkg.spec
  208. main.$(SUF): $(SRC_DIR)/idf.h
  209. main.$(SUF): ./idfsize.h
  210. main.$(SUF): $(SRC_DIR)/file_info.h
  211. main.$(SUF): $(TARGET_HOME)/modules/h/system.h
  212. main.$(SUF): $(TARGET_HOME)/modules/h/assert.h
  213. main.$(SUF): $(TARGET_HOME)/modules/h/em_arith.h
  214. main.$(SUF): $(TARGET_HOME)/modules/h/alloc.h
  215. options.$(SUF): $(SRC_DIR)/options.c
  216. $(CC) -c $(CFLAGS) $(SRC_DIR)/options.c
  217. options.$(SUF): $(TARGET_HOME)/modules/pkg/idf_pkg.spec
  218. options.$(SUF): $(SRC_DIR)/idf.h
  219. options.$(SUF): $(SRC_DIR)/macro.h
  220. options.$(SUF): $(SRC_DIR)/class.h
  221. options.$(SUF): ./idfsize.h
  222. options.$(SUF): $(TARGET_HOME)/modules/h/alloc.h
  223. preprocess.$(SUF): $(SRC_DIR)/preprocess.c
  224. $(CC) -c $(CFLAGS) $(SRC_DIR)/preprocess.c
  225. preprocess.$(SUF): ./line_prefix.h
  226. preprocess.$(SUF): ./dobits.h
  227. preprocess.$(SUF): $(SRC_DIR)/bits.h
  228. preprocess.$(SUF): ./idfsize.h
  229. preprocess.$(SUF): $(TARGET_HOME)/modules/pkg/idf_pkg.spec
  230. preprocess.$(SUF): $(SRC_DIR)/idf.h
  231. preprocess.$(SUF): $(SRC_DIR)/class.h
  232. preprocess.$(SUF): $(SRC_DIR)/file_info.h
  233. preprocess.$(SUF): $(TARGET_HOME)/modules/h/em_arith.h
  234. preprocess.$(SUF): $(SRC_DIR)/LLlex.h
  235. preprocess.$(SUF): ./obufsize.h
  236. preprocess.$(SUF): $(TARGET_HOME)/modules/pkg/inp_pkg.spec
  237. preprocess.$(SUF): ./inputtype.h
  238. preprocess.$(SUF): $(SRC_DIR)/input.h
  239. preprocess.$(SUF): $(TARGET_HOME)/modules/h/system.h
  240. replace.$(SUF): $(SRC_DIR)/replace.c
  241. $(CC) -c $(CFLAGS) $(SRC_DIR)/replace.c
  242. replace.$(SUF): $(SRC_DIR)/interface.h
  243. replace.$(SUF): $(SRC_DIR)/class.h
  244. replace.$(SUF): $(SRC_DIR)/file_info.h
  245. replace.$(SUF): $(TARGET_HOME)/modules/h/em_arith.h
  246. replace.$(SUF): $(SRC_DIR)/LLlex.h
  247. replace.$(SUF): $(SRC_DIR)/macro.h
  248. replace.$(SUF): $(TARGET_HOME)/modules/pkg/inp_pkg.spec
  249. replace.$(SUF): ./inputtype.h
  250. replace.$(SUF): $(SRC_DIR)/input.h
  251. replace.$(SUF): $(TARGET_HOME)/modules/pkg/idf_pkg.spec
  252. replace.$(SUF): $(SRC_DIR)/idf.h
  253. replace.$(SUF): $(TARGET_HOME)/modules/h/assert.h
  254. replace.$(SUF): $(TARGET_HOME)/modules/h/alloc.h
  255. replace.$(SUF): ./textsize.h
  256. replace.$(SUF): ./pathlength.h
  257. replace.$(SUF): ./debug.h
  258. scan.$(SUF): $(SRC_DIR)/scan.c
  259. $(CC) -c $(CFLAGS) $(SRC_DIR)/scan.c
  260. scan.$(SUF): $(SRC_DIR)/file_info.h
  261. scan.$(SUF): $(SRC_DIR)/interface.h
  262. scan.$(SUF): $(SRC_DIR)/macro.h
  263. scan.$(SUF): $(TARGET_HOME)/modules/pkg/idf_pkg.spec
  264. scan.$(SUF): $(SRC_DIR)/idf.h
  265. scan.$(SUF): $(SRC_DIR)/class.h
  266. scan.$(SUF): $(TARGET_HOME)/modules/pkg/inp_pkg.spec
  267. scan.$(SUF): ./inputtype.h
  268. scan.$(SUF): $(SRC_DIR)/input.h
  269. scan.$(SUF): ./nparams.h
  270. scan.$(SUF): ./lapbuf.h
  271. skip.$(SUF): $(SRC_DIR)/skip.c
  272. $(CC) -c $(CFLAGS) $(SRC_DIR)/skip.c
  273. skip.$(SUF): $(TARGET_HOME)/modules/pkg/inp_pkg.spec
  274. skip.$(SUF): ./inputtype.h
  275. skip.$(SUF): $(SRC_DIR)/input.h
  276. skip.$(SUF): $(SRC_DIR)/class.h
  277. skip.$(SUF): $(SRC_DIR)/file_info.h
  278. skip.$(SUF): $(TARGET_HOME)/modules/h/em_arith.h
  279. skip.$(SUF): $(SRC_DIR)/LLlex.h
  280. tokenname.$(SUF): $(SRC_DIR)/tokenname.c
  281. $(CC) -c $(CFLAGS) $(SRC_DIR)/tokenname.c
  282. tokenname.$(SUF): ./Lpars.h
  283. tokenname.$(SUF): $(SRC_DIR)/file_info.h
  284. tokenname.$(SUF): $(TARGET_HOME)/modules/h/em_arith.h
  285. tokenname.$(SUF): $(SRC_DIR)/LLlex.h
  286. tokenname.$(SUF): $(TARGET_HOME)/modules/pkg/idf_pkg.spec
  287. tokenname.$(SUF): $(SRC_DIR)/idf.h
  288. next.$(SUF): $(SRC_DIR)/next.c
  289. $(CC) -c $(CFLAGS) $(SRC_DIR)/next.c
  290. next.$(SUF): ./debug.h
  291. expr.$(SUF): $(SRC_DIR)/expr.c
  292. $(CC) -c $(CFLAGS) $(SRC_DIR)/expr.c
  293. expr.$(SUF): ./Lpars.h
  294. tokenfile.$(SUF): tokenfile.c
  295. $(CC) -c $(CFLAGS) tokenfile.c
  296. tokenfile.$(SUF): Lpars.h
  297. expression.$(SUF): expression.c
  298. $(CC) -c $(CFLAGS) expression.c
  299. expression.$(SUF): $(SRC_DIR)/file_info.h
  300. expression.$(SUF): $(TARGET_HOME)/modules/h/em_arith.h
  301. expression.$(SUF): $(SRC_DIR)/LLlex.h
  302. expression.$(SUF): Lpars.h
  303. Lpars.$(SUF): Lpars.c
  304. $(CC) -c $(CFLAGS) Lpars.c
  305. Lpars.$(SUF): Lpars.h
  306. char.$(SUF): char.c
  307. $(CC) -c $(CFLAGS) char.c
  308. char.$(SUF): $(SRC_DIR)/class.h
  309. symbol2str.$(SUF): symbol2str.c
  310. $(CC) -c $(CFLAGS) symbol2str.c
  311. symbol2str.$(SUF): Lpars.h