Makefile 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  1. # make iso-pascal "compiler"
  2. EMHOME = ../../..
  3. MHDIR = $(EMHOME)/modules/h
  4. PKGDIR = $(EMHOME)/modules/pkg
  5. LIBDIR = $(EMHOME)/modules/lib
  6. OBJECTCODE = $(LIBDIR)/libemk.a $(EMHOME)/lib/em_data.a
  7. LLGEN = $(EMHOME)/bin/LLgen
  8. MKDEP = $(EMHOME)/bin/mkdep
  9. CURRDIR = .
  10. CC = fcc
  11. PRINTER = vu45
  12. INCLUDES = -I$(MHDIR) -I$(EMHOME)/h -I$(PKGDIR)
  13. GFILES = tokenfile.g declar.g expression.g program.g statement.g
  14. LLGENOPTIONS =
  15. PROFILE =
  16. CFLAGS = $(PROFILE) $(INCLUDES) -DSTATIC=
  17. LINTFLAGS = -DSTATIC=
  18. MALLOC = $(LIBDIR)/malloc.o
  19. LFLAGS = $(PROFILE)
  20. LSRC = declar.c expression.c program.c statement.c tokenfile.c
  21. LOBJ = declar.o expression.o program.o statement.o tokenfile.o
  22. CSRC = LLlex.c LLmessage.c body.c chk_expr.c code.c\
  23. cstoper.c def.c desig.c enter.c error.c idf.c input.c label.c\
  24. lookup.c main.c misc.c node.c options.c readwrite.c\
  25. scope.c symbol2str.c tokenname.c type.c typequiv.c progs.c
  26. COBJ = LLlex.o LLmessage.o body.o casestat.o char.o chk_expr.o code.o\
  27. cstoper.o def.o desig.o enter.o error.o idf.o input.o label.o\
  28. lookup.o main.o misc.o next.o node.o options.o readwrite.o\
  29. scope.o symbol2str.o tmpvar.o tokenname.o type.o typequiv.o progs.o
  30. OBJ = Lpars.o $(COBJ) $(LOBJ)
  31. # Keep the next entries up to date!
  32. GENCFILES= Lpars.c declar.c expression.c program.c statement.c\
  33. tokenfile.c symbol2str.c casestat.c tmpvar.c char.c next.c
  34. SRC = Lpars.c $(CSRC) $(GENCFILES)
  35. GENGFILES= tokenfile.g
  36. GENHFILES= Lpars.h debugcst.h density.h errout.h idfsize.h inputtype.h\
  37. numsize.h strsize.h def.h type.h desig.h scope.h node.h\
  38. target_sizes.h
  39. HFILES= LLlex.h chk_expr.h class.h const.h debug.h def.h desig.h\
  40. f_info.h idf.h input.h main.h misc.h node.h required.h scope.h\
  41. tokenname.h type.h $(GENHFILES)
  42. #
  43. GENFILES = $(GENGFILES) $(GENCFILES) $(GENHFILES)
  44. NEXTFILES = def.H desig.H node.H scope.H type.H casestat.C tmpvar.C
  45. #EXCLEXCLEXCLEXCL
  46. all: Cfiles
  47. make $(CURRDIR)/main
  48. clean:
  49. rm -f *.o main $(GENFILES) hfiles Cfiles LLfiles
  50. # entry points not to be used directly
  51. Cfiles: hfiles LLfiles $(GENCFILES) $(GENHFILES) Makefile
  52. echo $(SRC) $(HFILES) > Cfiles
  53. LLfiles: $(GFILES)
  54. $(LLGEN) $(LLGENOPTIONS) $(GFILES)
  55. @touch LLfiles
  56. hfiles: Parameters make.hfiles
  57. make.hfiles Parameters
  58. touch hfiles
  59. lint: Cfiles
  60. lint $(INCLUDES) $(LINTFLAGS) $(SRC)
  61. tokenfile.g: tokenname.c make.tokfile
  62. make.tokfile < tokenname.c > tokenfile.g
  63. symbol2str.c: tokenname.c make.tokcase
  64. make.tokcase < tokenname.c > symbol2str.c
  65. .SUFFIXES: .H .h
  66. .H.h:
  67. ./make.allocd < $*.H > $*.h
  68. .SUFFIXES: .C .c
  69. .C.c:
  70. ./make.allocd < $*.C > $*.c
  71. def.h: make.allocd
  72. type.h: make.allocd
  73. node.h: make.allocd
  74. scope.h: make.allocd
  75. desig.h: make.allocd
  76. casestat.c: make.allocd
  77. tmpvar.c: make.allocd
  78. next.c: $(NEXTFILES) ./make.next
  79. ./make.next $(NEXTFILES) > next.c
  80. char.c: char.tab
  81. $(EMHOME)/bin/tabgen -fchar.tab > char.c
  82. depend:
  83. sed '/^#AUTOAUTO/,$$d' Makefile > Makefile.new
  84. echo '#AUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTO' >> Makefile.new
  85. $(MKDEP) $(SRC) |\
  86. sed 's/\.c:/\.o:/' >> Makefile.new
  87. mv Makefile Makefile.old
  88. mv Makefile.new Makefile
  89. print: $(CSRC) $(GFILES) $(HFILES) # print recently changed files
  90. pr -t $? | rpr $(PRINTER)
  91. @touch print
  92. xref:
  93. ctags -x $(CSRC) $(HFILES) | sed "s/).*/)/">Xref
  94. #INCLINCLINCLINCL
  95. $(CURRDIR)/main: $(OBJ)
  96. -mv main main.old
  97. $(CC) $(LFLAGS) $(OBJ) $(LIBDIR)/libem_mes.a $(OBJECTCODE) $(LIBDIR)/libinput.a $(LIBDIR)/liballoc.a $(MALLOC) $(LIBDIR)/libassert.a $(LIBDIR)/libprint.a $(LIBDIR)/libstring.a $(LIBDIR)/libsystem.a -o $(CURRDIR)/main
  98. size $(CURRDIR)/main.old
  99. size $(CURRDIR)/main
  100. #AUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTO
  101. Lpars.o: Lpars.h
  102. LLlex.o: LLlex.h
  103. LLlex.o: Lpars.h
  104. LLlex.o: class.h
  105. LLlex.o: const.h
  106. LLlex.o: debug.h
  107. LLlex.o: debugcst.h
  108. LLlex.o: f_info.h
  109. LLlex.o: idf.h
  110. LLlex.o: idfsize.h
  111. LLlex.o: input.h
  112. LLlex.o: inputtype.h
  113. LLlex.o: main.h
  114. LLlex.o: numsize.h
  115. LLlex.o: strsize.h
  116. LLlex.o: type.h
  117. LLmessage.o: LLlex.h
  118. LLmessage.o: Lpars.h
  119. LLmessage.o: idf.h
  120. LLmessage.o: type.h
  121. body.o: LLlex.h
  122. body.o: chk_expr.h
  123. body.o: debug.h
  124. body.o: debugcst.h
  125. body.o: def.h
  126. body.o: desig.h
  127. body.o: idf.h
  128. body.o: main.h
  129. body.o: node.h
  130. body.o: scope.h
  131. body.o: type.h
  132. casestat.o: LLlex.h
  133. casestat.o: Lpars.h
  134. casestat.o: chk_expr.h
  135. casestat.o: debug.h
  136. casestat.o: debugcst.h
  137. casestat.o: density.h
  138. casestat.o: main.h
  139. casestat.o: node.h
  140. casestat.o: type.h
  141. char.o: class.h
  142. chk_expr.o: LLlex.h
  143. chk_expr.o: Lpars.h
  144. chk_expr.o: chk_expr.h
  145. chk_expr.o: const.h
  146. chk_expr.o: debug.h
  147. chk_expr.o: debugcst.h
  148. chk_expr.o: def.h
  149. chk_expr.o: idf.h
  150. chk_expr.o: main.h
  151. chk_expr.o: misc.h
  152. chk_expr.o: node.h
  153. chk_expr.o: required.h
  154. chk_expr.o: scope.h
  155. chk_expr.o: type.h
  156. code.o: LLlex.h
  157. code.o: Lpars.h
  158. code.o: debug.h
  159. code.o: debugcst.h
  160. code.o: def.h
  161. code.o: desig.h
  162. code.o: main.h
  163. code.o: node.h
  164. code.o: required.h
  165. code.o: scope.h
  166. code.o: type.h
  167. cstoper.o: LLlex.h
  168. cstoper.o: Lpars.h
  169. cstoper.o: const.h
  170. cstoper.o: debug.h
  171. cstoper.o: debugcst.h
  172. cstoper.o: node.h
  173. cstoper.o: required.h
  174. cstoper.o: target_sizes.h
  175. cstoper.o: type.h
  176. def.o: LLlex.h
  177. def.o: debug.h
  178. def.o: debugcst.h
  179. def.o: def.h
  180. def.o: idf.h
  181. def.o: main.h
  182. def.o: misc.h
  183. def.o: node.h
  184. def.o: scope.h
  185. def.o: type.h
  186. desig.o: LLlex.h
  187. desig.o: debug.h
  188. desig.o: debugcst.h
  189. desig.o: def.h
  190. desig.o: desig.h
  191. desig.o: main.h
  192. desig.o: node.h
  193. desig.o: scope.h
  194. desig.o: type.h
  195. enter.o: LLlex.h
  196. enter.o: def.h
  197. enter.o: idf.h
  198. enter.o: main.h
  199. enter.o: node.h
  200. enter.o: scope.h
  201. enter.o: type.h
  202. error.o: LLlex.h
  203. error.o: debug.h
  204. error.o: debugcst.h
  205. error.o: errout.h
  206. error.o: f_info.h
  207. error.o: input.h
  208. error.o: inputtype.h
  209. error.o: main.h
  210. error.o: node.h
  211. idf.o: idf.h
  212. input.o: f_info.h
  213. input.o: idf.h
  214. input.o: input.h
  215. input.o: inputtype.h
  216. label.o: LLlex.h
  217. label.o: def.h
  218. label.o: idf.h
  219. label.o: main.h
  220. label.o: node.h
  221. label.o: scope.h
  222. label.o: type.h
  223. lookup.o: LLlex.h
  224. lookup.o: def.h
  225. lookup.o: idf.h
  226. lookup.o: misc.h
  227. lookup.o: node.h
  228. lookup.o: scope.h
  229. lookup.o: type.h
  230. main.o: LLlex.h
  231. main.o: Lpars.h
  232. main.o: const.h
  233. main.o: debug.h
  234. main.o: debugcst.h
  235. main.o: def.h
  236. main.o: f_info.h
  237. main.o: idf.h
  238. main.o: input.h
  239. main.o: inputtype.h
  240. main.o: main.h
  241. main.o: node.h
  242. main.o: required.h
  243. main.o: tokenname.h
  244. main.o: type.h
  245. misc.o: LLlex.h
  246. misc.o: f_info.h
  247. misc.o: idf.h
  248. misc.o: main.h
  249. misc.o: misc.h
  250. misc.o: node.h
  251. next.o: debug.h
  252. next.o: debugcst.h
  253. node.o: LLlex.h
  254. node.o: debug.h
  255. node.o: debugcst.h
  256. node.o: node.h
  257. node.o: type.h
  258. options.o: class.h
  259. options.o: const.h
  260. options.o: idfsize.h
  261. options.o: main.h
  262. options.o: type.h
  263. readwrite.o: LLlex.h
  264. readwrite.o: debug.h
  265. readwrite.o: debugcst.h
  266. readwrite.o: def.h
  267. readwrite.o: main.h
  268. readwrite.o: node.h
  269. readwrite.o: scope.h
  270. readwrite.o: type.h
  271. scope.o: LLlex.h
  272. scope.o: debug.h
  273. scope.o: debugcst.h
  274. scope.o: def.h
  275. scope.o: idf.h
  276. scope.o: misc.h
  277. scope.o: node.h
  278. scope.o: scope.h
  279. scope.o: type.h
  280. symbol2str.o: Lpars.h
  281. tmpvar.o: debug.h
  282. tmpvar.o: debugcst.h
  283. tmpvar.o: def.h
  284. tmpvar.o: main.h
  285. tmpvar.o: scope.h
  286. tmpvar.o: type.h
  287. tokenname.o: Lpars.h
  288. tokenname.o: idf.h
  289. tokenname.o: tokenname.h
  290. type.o: LLlex.h
  291. type.o: const.h
  292. type.o: debug.h
  293. type.o: debugcst.h
  294. type.o: def.h
  295. type.o: idf.h
  296. type.o: main.h
  297. type.o: node.h
  298. type.o: scope.h
  299. type.o: target_sizes.h
  300. type.o: type.h
  301. typequiv.o: LLlex.h
  302. typequiv.o: debug.h
  303. typequiv.o: debugcst.h
  304. typequiv.o: def.h
  305. typequiv.o: node.h
  306. typequiv.o: type.h
  307. progs.o: LLlex.h
  308. progs.o: debug.h
  309. progs.o: debugcst.h
  310. progs.o: def.h
  311. progs.o: main.h
  312. progs.o: scope.h
  313. progs.o: type.h
  314. declar.o: LLlex.h
  315. declar.o: Lpars.h
  316. declar.o: chk_expr.h
  317. declar.o: def.h
  318. declar.o: idf.h
  319. declar.o: main.h
  320. declar.o: misc.h
  321. declar.o: node.h
  322. declar.o: scope.h
  323. declar.o: type.h
  324. expression.o: LLlex.h
  325. expression.o: Lpars.h
  326. expression.o: chk_expr.h
  327. expression.o: debug.h
  328. expression.o: debugcst.h
  329. expression.o: def.h
  330. expression.o: main.h
  331. expression.o: node.h
  332. expression.o: scope.h
  333. expression.o: type.h
  334. program.o: LLlex.h
  335. program.o: Lpars.h
  336. program.o: def.h
  337. program.o: main.h
  338. program.o: node.h
  339. program.o: scope.h
  340. statement.o: LLlex.h
  341. statement.o: Lpars.h
  342. statement.o: chk_expr.h
  343. statement.o: def.h
  344. statement.o: desig.h
  345. statement.o: idf.h
  346. statement.o: main.h
  347. statement.o: node.h
  348. statement.o: scope.h
  349. statement.o: type.h
  350. tokenfile.o: Lpars.h