Makefile.erik 11 KB

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