Makefile 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. # MAKEFILE FOR (STAND_ALONE) CEM PREPROCESSOR
  2. EMHOME=../..
  3. MODULES=$(EMHOME)/modules
  4. MODULESLIB=$(MODULES)/lib
  5. BIN=$(EMHOME)/lib
  6. MANDIR=$(EMHOME)/man
  7. # Some paths
  8. # Libraries
  9. SYSLIB = $(MODULESLIB)/libsystem.a
  10. STRLIB = $(MODULESLIB)/libstring.a
  11. PRTLIB = $(MODULESLIB)/libprint.a
  12. ALLOCLIB = $(MODULESLIB)/liballoc.a
  13. ASSERTLIB = $(MODULESLIB)/libassert.a
  14. MALLOC = $(MODULESLIB)/malloc.o
  15. LIBS = $(PRTLIB) $(STRLIB) $(ALLOCLIB) $(MALLOC) $(ASSERTLIB) $(SYSLIB)
  16. LIB_INCLUDES = -I$(MODULES)/h -I$(MODULES)/pkg
  17. # Where to install the preprocessor
  18. CEMPP = $(BIN)/cpp
  19. # What C compiler to use and how
  20. CC = cc
  21. COPTIONS =
  22. LDFLAGS =
  23. # What parser generator to use and how
  24. GEN = $(EMHOME)/bin/LLgen
  25. GENOPTIONS =
  26. # Special #defines during compilation
  27. CDEFS = $(LIB_INCLUDES)
  28. CFLAGS = $(CDEFS) $(COPTIONS) -O# # we cannot pass the COPTIONS to lint!
  29. # Grammar files and their objects
  30. LSRC = tokenfile.g expression.g
  31. LCSRC = tokenfile.c expression.c Lpars.c
  32. LOBJ = tokenfile.o expression.o Lpars.o
  33. # Objects of hand-written C files
  34. CSRC = LLlex.c LLmessage.c ch7bin.c ch7mon.c domacro.c \
  35. error.c idf.c init.c input.c main.c options.c Version.c \
  36. preprocess.c replace.c scan.c skip.c tokenname.c next.c expr.c
  37. COBJ = LLlex.o LLmessage.o ch7bin.o ch7mon.o domacro.o \
  38. error.o idf.o init.o input.o main.o options.o Version.o \
  39. preprocess.o replace.o scan.o skip.o tokenname.o next.o expr.o
  40. PRFILES = Makefile Parameters \
  41. make.hfiles make.tokcase make.tokfile LLlex.h bits.h file_info.h \
  42. idf.h input.h interface.h macro.h \
  43. class.h char.tab expression.g $(CSRC)
  44. # Objects of other generated C files
  45. GOBJ = char.o symbol2str.o
  46. # generated source files
  47. GSRC = char.c symbol2str.c
  48. # .h files generated by `make hfiles'; PLEASE KEEP THIS UP-TO-DATE!
  49. GHSRC = errout.h idfsize.h ifdepth.h lapbuf.h \
  50. nparams.h numsize.h obufsize.h \
  51. parbufsize.h pathlength.h strsize.h textsize.h \
  52. botch_free.h debug.h inputtype.h dobits.h line_prefix.h
  53. # Other generated files, for 'make clean' only
  54. GENERATED = tokenfile.g Lpars.h LLfiles LL.output lint.out \
  55. Xref hfiles cfiles charoffset.h
  56. all: cc
  57. cc: hfiles LLfiles
  58. make "EMHOME="$(EMHOME) cpp
  59. hfiles: Parameters char.c charoffset.h
  60. ./make.hfiles Parameters
  61. @touch hfiles
  62. charoffset.h char.c: char.tab
  63. $(EMHOME)/bin/tabgen -fchar.tab > char.c
  64. LLfiles: $(LSRC)
  65. $(GEN) $(GENOPTIONS) $(LSRC)
  66. @touch LLfiles
  67. tokenfile.g: tokenname.c make.tokfile
  68. <tokenname.c ./make.tokfile >tokenfile.g
  69. symbol2str.c: tokenname.c make.tokcase
  70. <tokenname.c ./make.tokcase >symbol2str.c
  71. # Objects needed for 'cpp'
  72. OBJ = $(COBJ) $(LOBJ) $(GOBJ)
  73. SRC = $(CSRC) $(LCSRC) $(GSRC)
  74. cpp: $(OBJ) Makefile
  75. $(CC) $(COPTIONS) $(LDFLAGS) $(OBJ) $(LIBS) -o cpp
  76. -size cpp
  77. cfiles: hfiles LLfiles $(GSRC)
  78. @touch cfiles
  79. install: all
  80. rm -f $(CEMPP)
  81. cp cpp $(CEMPP)
  82. rm -f $(MANDIR)/cpp.6
  83. cp cpp.6 $(MANDIR)/cpp.6
  84. cmp: all
  85. -cmp cpp $(CEMPP)
  86. -cmp cpp.6 $(MANDIR)/cpp.6
  87. pr:
  88. @pr $(PRFILES)
  89. opr:
  90. make pr | opr
  91. tags: cfiles
  92. ctags $(SRC)
  93. depend: cfiles
  94. sed '/^#AUTOAUTO/,$$d' Makefile >Makefile.new
  95. echo '#AUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTO' >>Makefile.new
  96. $(EMHOME)/bin/mkdep $(SRC) | \
  97. sed 's/\.c:/.o:/' >>Makefile.new
  98. mv Makefile Makefile.old
  99. mv Makefile.new Makefile
  100. xref:
  101. ctags -x `grep "\.[ch]" Files`|sed "s/).*/)/">Xref
  102. lint: cfiles
  103. lint -bx $(CDEFS) $(SRC) >lint.out
  104. clean:
  105. rm -f $(LCSRC) $(OBJ) $(GENERATED) $(GSRC) $(GHSRC) cpp Out
  106. #AUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTO
  107. LLlex.o: LLlex.h
  108. LLlex.o: Lpars.h
  109. LLlex.o: bits.h
  110. LLlex.o: charoffset.h
  111. LLlex.o: class.h
  112. LLlex.o: dobits.h
  113. LLlex.o: file_info.h
  114. LLlex.o: idf.h
  115. LLlex.o: idfsize.h
  116. LLlex.o: input.h
  117. LLlex.o: inputtype.h
  118. LLlex.o: numsize.h
  119. LLlex.o: strsize.h
  120. LLmessage.o: LLlex.h
  121. LLmessage.o: Lpars.h
  122. LLmessage.o: file_info.h
  123. ch7bin.o: Lpars.h
  124. ch7mon.o: Lpars.h
  125. domacro.o: LLlex.h
  126. domacro.o: Lpars.h
  127. domacro.o: bits.h
  128. domacro.o: botch_free.h
  129. domacro.o: charoffset.h
  130. domacro.o: class.h
  131. domacro.o: debug.h
  132. domacro.o: dobits.h
  133. domacro.o: file_info.h
  134. domacro.o: idf.h
  135. domacro.o: idfsize.h
  136. domacro.o: ifdepth.h
  137. domacro.o: input.h
  138. domacro.o: inputtype.h
  139. domacro.o: interface.h
  140. domacro.o: macro.h
  141. domacro.o: nparams.h
  142. domacro.o: parbufsize.h
  143. domacro.o: textsize.h
  144. error.o: LLlex.h
  145. error.o: errout.h
  146. error.o: file_info.h
  147. idf.o: idf.h
  148. init.o: charoffset.h
  149. init.o: class.h
  150. init.o: idf.h
  151. init.o: interface.h
  152. init.o: macro.h
  153. input.o: file_info.h
  154. input.o: input.h
  155. input.o: inputtype.h
  156. main.o: file_info.h
  157. main.o: idf.h
  158. main.o: idfsize.h
  159. main.o: macro.h
  160. options.o: charoffset.h
  161. options.o: class.h
  162. options.o: idf.h
  163. options.o: idfsize.h
  164. options.o: macro.h
  165. preprocess.o: LLlex.h
  166. preprocess.o: bits.h
  167. preprocess.o: charoffset.h
  168. preprocess.o: class.h
  169. preprocess.o: dobits.h
  170. preprocess.o: file_info.h
  171. preprocess.o: idf.h
  172. preprocess.o: idfsize.h
  173. preprocess.o: input.h
  174. preprocess.o: inputtype.h
  175. preprocess.o: line_prefix.h
  176. preprocess.o: obufsize.h
  177. replace.o: LLlex.h
  178. replace.o: charoffset.h
  179. replace.o: class.h
  180. replace.o: debug.h
  181. replace.o: file_info.h
  182. replace.o: idf.h
  183. replace.o: input.h
  184. replace.o: inputtype.h
  185. replace.o: interface.h
  186. replace.o: macro.h
  187. replace.o: pathlength.h
  188. replace.o: textsize.h
  189. scan.o: charoffset.h
  190. scan.o: class.h
  191. scan.o: file_info.h
  192. scan.o: idf.h
  193. scan.o: input.h
  194. scan.o: inputtype.h
  195. scan.o: interface.h
  196. scan.o: lapbuf.h
  197. scan.o: macro.h
  198. scan.o: nparams.h
  199. skip.o: LLlex.h
  200. skip.o: charoffset.h
  201. skip.o: class.h
  202. skip.o: file_info.h
  203. skip.o: input.h
  204. skip.o: inputtype.h
  205. tokenname.o: LLlex.h
  206. tokenname.o: Lpars.h
  207. tokenname.o: file_info.h
  208. tokenname.o: idf.h
  209. next.o: debug.h
  210. expr.o: Lpars.h
  211. tokenfile.o: Lpars.h
  212. expression.o: LLlex.h
  213. expression.o: Lpars.h
  214. expression.o: file_info.h
  215. Lpars.o: Lpars.h
  216. char.o: charoffset.h
  217. char.o: class.h
  218. symbol2str.o: Lpars.h