Makefile.erik 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. # $Header$
  2. # M A K E F I L E F O R A C K C - C O M P I L E R
  3. # Machine and environ dependent definitions
  4. EM = /user1/erikb/em# # ACK tree on this machine
  5. DESTINATION = /user1/$$USER/bin# # where to put the stuff
  6. MKDEP = /user1/erikb/bin/mkdep# # dependency generator
  7. MAP =
  8. #MAP = -DInsertFile=ins_file -DInsertText=ins_text# # bug in m68k2 back end
  9. SIM = /user1/dick/bin/sim# # Dicks sim program
  10. LINT = /usr/new/lint
  11. # Libraries and EM interface definitions
  12. SYSLIB = $(EM)/modules/lib/libsystem.a
  13. EMKLIB = $(EM)/modules/lib/libemk.a
  14. EMELIB = $(EM)/modules/lib/libeme.a
  15. STRLIB = $(EM)/modules/lib/libstr.a
  16. PRTLIB = $(EM)/modules/lib/libprint.a
  17. EMMESLIB = $(EM)/modules/lib/libem_mes.a
  18. CH3LIB = $(EM)/modules/lib/libch3.a
  19. LIBS = $(CH3LIB) $(EMMESLIB) $(EMKLIB) $(PRTLIB) $(STRLIB) $(SYSLIB)
  20. ELIBS = $(CH3LIB) $(EMMESLIB) $(EMELIB) $(PRTLIB) $(STRLIB) $(SYSLIB)
  21. LIB_INCLUDES = $(EM)/modules/h
  22. EM_INCLUDES = $(EM)/h
  23. SYSLLIB = $(EM)/modules/lib/llib-lsys.ln
  24. EMKLLIB = $(EM)/modules/lib/llib-lemk.ln
  25. EMELLIB = $(EM)/modules/lib/llib-leme.ln
  26. STRLLIB = $(EM)/modules/lib/llib-lstr.ln
  27. PRTLLIB = $(EM)/modules/lib/llib-lprint.ln
  28. EMMESLLIB = $(EM)/modules/lib/llib-lmes.ln
  29. CH3LLIB = $(EM)/modules/lib/llib-lch3.ln
  30. LINTLIBS =
  31. #LINTLIBS = $(CH3LLIB) $(EMMESLLIB) $(EMKLLIB) $(PRTLLIB) $(STRLLIB) $(SYSLLIB)
  32. # Where to install the compiler and its driver
  33. CEMCOM = $(DESTINATION)/cemcom
  34. DRIVER = $(DESTINATION)/cem
  35. # What C compiler to use and how
  36. # CC = $(ACK) -.c
  37. # CC = CC
  38. # CC = /bin/cc
  39. COPTIONS =
  40. # What parser generator to use and how
  41. GEN = $(EM)/bin/LLgen
  42. GENOPTIONS = -vv
  43. # Special #defines during compilation
  44. CDEFS = $(MAP) -I$(EM_INCLUDES) -I$(LIB_INCLUDES)
  45. CFLAGS = $(CDEFS) $(COPTIONS) -O# # we cannot pass the COPTIONS to lint!
  46. # Grammar files and their objects
  47. LSRC = tokenfile.g declar.g statement.g expression.g program.g
  48. LOBJ = tokenfile.o declar.o statement.o expression.o program.o Lpars.o
  49. # Objects of hand-written C files
  50. COBJ = main.o idf.o declarator.o decspecs.o struct.o \
  51. expr.o ch7.o ch7bin.o cstoper.o arith.o \
  52. alloc.o asm.o code.o dumpidf.o error.o field.o\
  53. tokenname.o LLlex.o LLmessage.o \
  54. input.o domacro.o replace.o init.o options.o \
  55. scan.o skip.o stack.o type.o ch7mon.o label.o eval.o \
  56. switch.o storage.o ival.o conversion.o \
  57. blocks.o dataflow.o
  58. # Objects of other generated C files
  59. GOBJ = char.o symbol2str.o next.o
  60. # generated source files
  61. GSRC = char.c symbol2str.c next.c \
  62. code.h declar.h decspecs.h def.h expr.h field.h \
  63. idf.h macro.h stack.h stmt.h struct.h switch.h type.h
  64. # .h files generated by `make hfiles'; PLEASE KEEP THIS UP-TO-DATE!
  65. GHSRC = botch_free.h dataflow.h debug.h density.h errout.h \
  66. idepth.h idfsize.h ifdepth.h inputtype.h inumlength.h lapbuf.h \
  67. maxincl.h myalloc.h nobitfield.h nopp.h \
  68. nparams.h numsize.h parbufsize.h pathlength.h predefine.h \
  69. strsize.h target_sizes.h textsize.h use_tmp.h spec_arith.h static.h
  70. # Other generated files, for 'make clean' only
  71. GENERATED = tab tokenfile.g Lpars.h LLfiles LL.output lint.out \
  72. print Xref lxref hfiles cfiles
  73. # include files containing ALLOCDEF specifications
  74. NEXTFILES = code.str declar.str decspecs.str def.str expr.str field.str \
  75. idf.str macro.str stack.str stmt.str struct.str switch.str type.str
  76. .SUFFIXES: .str .h
  77. .str.h:
  78. ./make.allocd <$*.str >$*.h
  79. all: cc
  80. cc:
  81. make "CC=$(CC)" hfiles
  82. make "CC=$(CC)" LLfiles
  83. make "CC=$(CC)" main
  84. cem: cem.c
  85. $(CC) -O cem.c $(SYSLIB) -o cem
  86. lint.cem: cem.c
  87. $(LINT) -bx cem.c
  88. hfiles: ./make.hfiles Parameters
  89. ./make.hfiles Parameters
  90. @touch hfiles
  91. LLfiles: $(LSRC)
  92. $(GEN) $(GENOPTIONS) $(LSRC)
  93. @touch LLfiles
  94. tokenfile.g: tokenname.c make.tokfile
  95. <tokenname.c ./make.tokfile >tokenfile.g
  96. symbol2str.c: tokenname.c make.tokcase
  97. <tokenname.c ./make.tokcase >symbol2str.c
  98. char.c: tab char.tab
  99. tab -fchar.tab >char.c
  100. next.c: make.next $(NEXTFILES)
  101. ./make.next $(NEXTFILES) >next.c
  102. code.h: make.allocd
  103. declar.h: make.allocd
  104. decspecs.h: make.allocd
  105. def.h: make.allocd
  106. expr.h: make.allocd
  107. field.h: make.allocd
  108. idf.h: make.allocd
  109. macro.h: make.allocd
  110. stack.h: make.allocd
  111. stmt.h: make.allocd
  112. struct.h: make.allocd
  113. switch.h: make.allocd
  114. type.h: make.allocd
  115. # Objects needed for 'main'
  116. OBJ = $(COBJ) $(LOBJ) $(GOBJ)
  117. main: $(OBJ) Makefile
  118. $(CC) $(COPTIONS) $(LFLAGS) $(OBJ) $(LIBS) -o main
  119. size main
  120. emain: $(OBJ) Makefile
  121. $(CC) $(COPTIONS) $(LFLAGS) $(OBJ) $(ELIBS) -o emain
  122. size emain
  123. cfiles: hfiles LLfiles $(GSRC)
  124. @touch cfiles
  125. install: main cem
  126. cp main $(CEMCOM)
  127. cp cem $(DRIVER)
  128. print: files
  129. pr `cat files` > print
  130. tags: cfiles
  131. ctags `sources $(OBJ)`
  132. shar: files
  133. shar `cat files`
  134. listcfiles:
  135. @echo `sources $(OBJ)`
  136. listobjects:
  137. @echo $(OBJ)
  138. depend: cfiles
  139. sed '/^#AUTOAUTO/,$$d' Makefile >Makefile.new
  140. echo '#AUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTO' >>Makefile.new
  141. $(MKDEP) `sources $(OBJ)` | sed 's/\.c:/.o:/' >>Makefile.new
  142. mv Makefile Makefile.old
  143. mv Makefile.new Makefile
  144. xref:
  145. ctags -x `grep "\.[ch]" files`|sed "s/).*/)/">Xref
  146. lxref:
  147. lxref $(OBJ) -lc >lxref
  148. lint: lint.main lint.cem lint.tab
  149. lint.main: cfiles
  150. $(LINT) -bx $(CDEFS) `sources $(OBJ)` $(LINTLIBS) >lint.out
  151. cchk:
  152. cchk `sources $(COBJ)`
  153. clean:
  154. rm -f `sources $(LOBJ)` $(OBJ) $(GENERATED) $(GSRC) $(GHSRC)
  155. tab:
  156. $(CC) tab.c -o tab
  157. lint.tab:
  158. $(LINT) -abx tab.c
  159. sim: cfiles
  160. $(SIM) $(SIMFLAGS) `sources $(COBJ)` $(GSRC) $(LSRC)
  161. #AUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTO
  162. main.o: LLlex.h Lpars.h alloc.h arith.h debug.h declar.h idf.h input.h inputtype.h level.h maxincl.h myalloc.h nobitfield.h nopp.h spec_arith.h specials.h target_sizes.h tokenname.h type.h use_tmp.h
  163. idf.o: LLlex.h Lpars.h align.h alloc.h arith.h assert.h botch_free.h debug.h declar.h decspecs.h def.h idf.h idfsize.h label.h level.h nobitfield.h nopp.h sizes.h spec_arith.h specials.h stack.h storage.h struct.h type.h
  164. declarator.o: Lpars.h alloc.h arith.h botch_free.h declar.h expr.h idf.h label.h nobitfield.h nopp.h sizes.h spec_arith.h storage.h type.h
  165. decspecs.o: Lpars.h arith.h decspecs.h def.h level.h nobitfield.h spec_arith.h type.h
  166. struct.o: LLlex.h Lpars.h align.h arith.h assert.h botch_free.h debug.h def.h field.h idf.h level.h nobitfield.h nopp.h sizes.h spec_arith.h stack.h storage.h struct.h type.h
  167. expr.o: LLlex.h Lpars.h alloc.h arith.h botch_free.h declar.h decspecs.h def.h expr.h idf.h label.h level.h nobitfield.h nopp.h sizes.h spec_arith.h storage.h type.h
  168. ch7.o: Lpars.h arith.h assert.h debug.h def.h expr.h idf.h label.h nobitfield.h nopp.h spec_arith.h struct.h type.h
  169. ch7bin.o: Lpars.h arith.h botch_free.h expr.h idf.h label.h nobitfield.h nopp.h spec_arith.h storage.h struct.h type.h
  170. cstoper.o: Lpars.h arith.h assert.h debug.h expr.h idf.h label.h nobitfield.h nopp.h sizes.h spec_arith.h target_sizes.h type.h
  171. arith.o: Lpars.h alloc.h arith.h botch_free.h expr.h field.h idf.h label.h mes.h nobitfield.h nopp.h spec_arith.h storage.h type.h
  172. alloc.o: alloc.h assert.h debug.h myalloc.h
  173. code.o: LLlex.h Lpars.h alloc.h arith.h assert.h atw.h botch_free.h code.h dataflow.h debug.h declar.h decspecs.h def.h expr.h idf.h label.h level.h mes.h nobitfield.h nopp.h sizes.h spec_arith.h specials.h stack.h stmt.h storage.h type.h use_tmp.h
  174. dumpidf.o: Lpars.h arith.h debug.h def.h expr.h field.h idf.h label.h nobitfield.h nopp.h spec_arith.h stack.h static.h struct.h type.h
  175. error.o: LLlex.h arith.h debug.h errout.h expr.h label.h nopp.h spec_arith.h tokenname.h use_tmp.h
  176. field.o: Lpars.h arith.h assert.h code.h debug.h expr.h field.h idf.h label.h nobitfield.h nopp.h sizes.h spec_arith.h type.h
  177. tokenname.o: LLlex.h Lpars.h arith.h idf.h nopp.h spec_arith.h tokenname.h
  178. LLlex.o: LLlex.h Lpars.h alloc.h arith.h assert.h class.h debug.h def.h idf.h idfsize.h input.h nopp.h numsize.h sizes.h spec_arith.h strsize.h
  179. LLmessage.o: LLlex.h Lpars.h alloc.h arith.h idf.h nopp.h spec_arith.h
  180. input.o: LLlex.h alloc.h arith.h assert.h debug.h idepth.h input.h inputtype.h interface.h nopp.h pathlength.h spec_arith.h static.h
  181. domacro.o: LLlex.h Lpars.h alloc.h arith.h assert.h botch_free.h class.h debug.h idf.h idfsize.h ifdepth.h input.h interface.h macro.h nopp.h nparams.h parbufsize.h spec_arith.h storage.h textsize.h
  182. replace.o: LLlex.h alloc.h arith.h assert.h class.h debug.h idf.h input.h interface.h macro.h nopp.h pathlength.h spec_arith.h static.h strsize.h
  183. init.o: alloc.h class.h idf.h interface.h macro.h nopp.h predefine.h
  184. options.o: align.h arith.h class.h idf.h idfsize.h macro.h maxincl.h nobitfield.h nopp.h sizes.h spec_arith.h storage.h use_tmp.h
  185. scan.o: class.h idf.h input.h interface.h lapbuf.h macro.h nopp.h nparams.h
  186. skip.o: LLlex.h arith.h class.h input.h interface.h nopp.h spec_arith.h
  187. stack.o: Lpars.h alloc.h arith.h botch_free.h debug.h def.h idf.h level.h mes.h nobitfield.h nopp.h spec_arith.h stack.h storage.h struct.h type.h use_tmp.h
  188. type.o: Lpars.h align.h alloc.h arith.h def.h idf.h nobitfield.h nopp.h sizes.h spec_arith.h storage.h type.h
  189. ch7mon.o: Lpars.h arith.h botch_free.h def.h expr.h idf.h label.h nobitfield.h nopp.h spec_arith.h storage.h type.h
  190. label.o: Lpars.h arith.h def.h idf.h label.h level.h nobitfield.h nopp.h spec_arith.h type.h
  191. eval.o: Lpars.h align.h arith.h assert.h atw.h code.h dataflow.h debug.h def.h expr.h idf.h label.h level.h mes.h nobitfield.h nopp.h sizes.h spec_arith.h stack.h type.h
  192. switch.o: Lpars.h arith.h assert.h botch_free.h code.h debug.h density.h expr.h idf.h label.h nobitfield.h nopp.h spec_arith.h storage.h switch.h type.h
  193. storage.o: alloc.h assert.h botch_free.h debug.h storage.h
  194. ival.o: Lpars.h align.h arith.h assert.h class.h debug.h def.h expr.h field.h idf.h label.h level.h nobitfield.h nopp.h sizes.h spec_arith.h struct.h type.h
  195. conversion.o: Lpars.h arith.h nobitfield.h sizes.h spec_arith.h type.h
  196. blocks.o: arith.h atw.h sizes.h spec_arith.h
  197. dataflow.o: dataflow.h
  198. tokenfile.o: Lpars.h
  199. declar.o: LLlex.h Lpars.h arith.h debug.h declar.h decspecs.h def.h expr.h field.h idf.h label.h nobitfield.h nopp.h sizes.h spec_arith.h storage.h struct.h type.h
  200. statement.o: LLlex.h Lpars.h arith.h botch_free.h code.h debug.h def.h expr.h idf.h label.h nobitfield.h nopp.h spec_arith.h stack.h storage.h type.h
  201. expression.o: LLlex.h Lpars.h arith.h expr.h idf.h label.h nobitfield.h nopp.h spec_arith.h type.h
  202. program.o: LLlex.h Lpars.h alloc.h arith.h code.h declar.h decspecs.h def.h expr.h idf.h label.h nobitfield.h nopp.h spec_arith.h type.h
  203. Lpars.o: Lpars.h
  204. char.o: class.h
  205. symbol2str.o: Lpars.h