Makefile 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  1. # make iso-pascal "compiler"
  2. EMHOME = ../../..
  3. MDIR = $(EMHOME)/modules
  4. MHDIR = $(MDIR)/h
  5. PKGDIR = $(MDIR)/pkg
  6. LIBDIR = $(MDIR)/lib
  7. LLGEN = $(EMHOME)/bin/LLgen
  8. MKDEP = $(EMHOME)/bin/mkdep
  9. PRID = $(EMHOME)/bin/prid
  10. CID = $(EMHOME)/bin/cid
  11. OPR = opr
  12. CURRDIR =
  13. CC = fcc
  14. CC = cc
  15. LINT = lint
  16. MACH = sun3
  17. MALLOC = $(LIBDIR)/malloc.o
  18. EMELIB = $(LIBDIR)/libem_mes.a \
  19. $(LIBDIR)/libeme.a \
  20. $(EMHOME)/lib/em_data.a
  21. EMKLIB = $(LIBDIR)/libem_mes.a $(LIBDIR)/libemk.a
  22. MODLIB = $(LIBDIR)/libinput.a \
  23. $(LIBDIR)/libassert.a \
  24. $(LIBDIR)/liballoc.a \
  25. $(MALLOC) \
  26. $(LIBDIR)/libprint.a \
  27. $(LIBDIR)/libstring.a \
  28. $(LIBDIR)/libsystem.a
  29. EMCELIB = $(LIBDIR)/libem_mesCE.a \
  30. $(EMHOME)/lib/$(MACH)/ce.a \
  31. $(EMHOME)/lib/$(MACH)/back.a \
  32. $(LIBDIR)/libflt.a \
  33. $(LIBDIR)/libobject.a \
  34. $(EMHOME)/lib/em_data.a
  35. EMOCELIB = $(LIBDIR)/libem_mesO.a \
  36. $(LIBDIR)/libCEopt.a \
  37. $(EMHOME)/lib/$(MACH)/ce.a \
  38. $(EMHOME)/lib/$(MACH)/back.a \
  39. $(LIBDIR)/libflt.a \
  40. $(LIBDIR)/libobject.a \
  41. $(EMHOME)/lib/em_data.a
  42. LIBS = $(EMKLIB) $(MODLIB)
  43. CELIBS = $(EMCELIB) $(MODLIB)
  44. OLIBS = $(EMOCELIB) $(MODLIB)
  45. GFILES = tokenfile.g declar.g expression.g program.g statement.g
  46. LLGENOPTIONS =
  47. PROFILE =
  48. COPTIONS =
  49. INCLUDES = -I$(MHDIR) -I$(EMHOME)/h -I$(PKGDIR)
  50. OPTIM= -O
  51. CFLAGS = $(PROFILE) $(INCLUDES) $(OPTIM) $(COPTIONS) -DSTATIC=
  52. LINTFLAGS = -DSTATIC= -DNORCSID
  53. LDFLAGS = -i $(PROFILE)
  54. LSRC = declar.c expression.c program.c statement.c tokenfile.c
  55. LOBJ = declar.o expression.o program.o statement.o tokenfile.o
  56. CSRC = LLlex.c LLmessage.c body.c chk_expr.c code.c\
  57. cstoper.c def.c desig.c enter.c error.c idf.c input.c label.c\
  58. lookup.c main.c misc.c node.c options.c readwrite.c\
  59. scope.c symbol2str.c tokenname.c type.c typequiv.c progs.c
  60. COBJ = LLlex.o LLmessage.o body.o casestat.o char.o chk_expr.o code.o\
  61. cstoper.o def.o desig.o enter.o error.o idf.o input.o label.o\
  62. lookup.o main.o misc.o next.o node.o options.o readwrite.o\
  63. scope.o symbol2str.o tmpvar.o tokenname.o type.o typequiv.o progs.o
  64. OBJ = Lpars.o $(COBJ) $(LOBJ)
  65. # Keep the next entries up to date!
  66. GENCFILES= $(LSRC) Lpars.c symbol2str.c casestat.c tmpvar.c char.c next.c
  67. SRC = $(CSRC) $(GENCFILES)
  68. GENGFILES= tokenfile.g
  69. GENHFILES= Lpars.h debugcst.h density.h errout.h idfsize.h inputtype.h\
  70. numsize.h strsize.h def.h type.h desig.h scope.h node.h\
  71. target_sizes.h nocross.h
  72. HFILES= LLlex.h chk_expr.h class.h const.h debug.h def.h desig.h\
  73. f_info.h idf.h input.h main.h misc.h node.h required.h scope.h\
  74. tokenname.h type.h $(GENHFILES)
  75. #
  76. GENFILES = $(GENGFILES) $(GENCFILES) $(GENHFILES)
  77. NEXTFILES = def.H desig.H node.H scope.H type.H casestat.C tmpvar.C
  78. #EXCLEXCLEXCLEXCL
  79. all: Cfiles
  80. sh -c 'if $(CC) nmclash.c > /dev/null 2>&1 ; then make "EMHOME="$(EMHOME) $(CURRDIR)main ; else EMHOME=$(EMHOME); export EMHOME; sh Resolve main ; fi'
  81. @rm -f nmclash.o a.out
  82. Omain: Cfiles
  83. rm -f *.o
  84. sh -c 'if $(CC) nmclash.c > /dev/null 2>&1 ; then make "MACH="$(MACH) "EMHOME="$(EMHOME) "COPTIONS="-DPEEPHOLE $(CURRDIR)omain ; else MACH=$(MACH); export MACH; EMHOME=$(EMHOME); export EMHOME; ./Resolve omain ; fi'
  85. @rm -f nmclash.o a.out
  86. CEmain: Cfiles
  87. rm -f *.o
  88. sh -c 'if $(CC) nmclash.c > /dev/null 2>&1 ; then make "MACH="$(MACH) "EMHOME="$(EMHOME) "COPTIONS="-DCODE_EXPANDER $(CURRDIR)cemain ; else MACH=$(MACH); export MACH; EMHOME=$(EMHOME); export EMHOME; ./Resolve cemain ; fi'
  89. @rm -f nmclash.o a.out
  90. install: all
  91. cp $(CURRDIR)main $(EMHOME)/lib/em_pc
  92. cmp: all
  93. -cmp $(CURRDIR)main $(EMHOME)/lib/em_pc
  94. opr:
  95. make pr | $(OPR)
  96. pr:
  97. @pr Makefile Resolve Parameters $(GFILES) *.H $(HFILES) *.C $(CSRC)
  98. clean:
  99. rm -f $(OBJ) $(CURRDIR)main $(GENFILES) hfiles Cfiles LLfiles clashes \
  100. LL.output
  101. (cd .. ; rm -rf Xsrc)
  102. lint: Cfiles
  103. sh -c 'if $(CC) nmclash.c > /dev/null 2>&1 ; then make "EMHOME="$(EMHOME) Xlint ; else EMHOME=$(EMHOME); export EMHOME; sh Resolve Xlint ; fi'
  104. @rm -f nmclash.o a.out
  105. longnames: $(SRC) $(HFILES)
  106. sh -c 'if test -f longnames ; then $(PRID) -l7 longnames $? > Xlongnames ; mv Xlongnames longnames ; else $(PRID) -l7 $? > longnames ; fi'
  107. # entry points not to be used directly
  108. Cfiles: hfiles LLfiles $(GENCFILES) $(GENHFILES) Makefile
  109. echo $(SRC) $(HFILES) > Cfiles
  110. LLfiles: $(GFILES)
  111. $(LLGEN) $(LLGENOPTIONS) $(GFILES)
  112. @touch LLfiles
  113. hfiles: Parameters make.hfiles
  114. make.hfiles Parameters
  115. touch hfiles
  116. tokenfile.g: tokenname.c make.tokfile
  117. make.tokfile < tokenname.c > tokenfile.g
  118. symbol2str.c: tokenname.c make.tokcase
  119. make.tokcase < tokenname.c > symbol2str.c
  120. .SUFFIXES: .H .h
  121. .H.h:
  122. ./make.allocd < $*.H > $*.h
  123. .SUFFIXES: .C .c
  124. .C.c:
  125. ./make.allocd < $*.C > $*.c
  126. def.h: make.allocd
  127. type.h: make.allocd
  128. node.h: make.allocd
  129. scope.h: make.allocd
  130. desig.h: make.allocd
  131. casestat.c: make.allocd
  132. tmpvar.c: make.allocd
  133. next.c: $(NEXTFILES) ./make.next
  134. ./make.next $(NEXTFILES) > next.c
  135. char.c: char.tab
  136. $(EMHOME)/bin/tabgen -fchar.tab > char.c
  137. depend: Cfiles
  138. sed '/^#AUTOAUTO/,$$d' Makefile > Makefile.new
  139. echo '#AUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTO' >> Makefile.new
  140. $(MKDEP) $(SRC) |\
  141. sed 's/\.c:/\.o:/' >> Makefile.new
  142. mv Makefile Makefile.old
  143. mv Makefile.new Makefile
  144. print: $(CSRC) $(GFILES) $(HFILES) # print recently changed files
  145. pr -t $? | $(OPR)
  146. @touch print
  147. xref:
  148. ctags -x $(CSRC) $(HFILES) | sed "s/).*/)/">Xref
  149. #INCLINCLINCLINCL
  150. Xlint:
  151. $(LINT) $(INCLUDES) $(LINTFLAGS) $(SRC) \
  152. $(LIBDIR)/llib-lem_mes.ln \
  153. $(LIBDIR)/llib-lemk.ln \
  154. $(LIBDIR)/llib-linput.ln \
  155. $(LIBDIR)/llib-lassert.ln \
  156. $(LIBDIR)/llib-lalloc.ln \
  157. $(LIBDIR)/llib-lprint.ln \
  158. $(LIBDIR)/llib-lstring.ln \
  159. $(LIBDIR)/llib-lsystem.ln
  160. $(CURRDIR)main: $(OBJ) $(CURRDIR)Makefile
  161. -mv $(CURRDIR)main $(CURRDIR)main.old
  162. $(CC) $(LDFLAGS) $(OBJ) $(LIBS) -o $(CURRDIR)main
  163. -size $(CURRDIR)main.old
  164. size $(CURRDIR)main
  165. $(CURRDIR)omain: $(OBJ) #$(CURRDIR)Makefile
  166. $(CC) $(LDFLAGS) $(OBJ) $(OLIBS) -o $(CURRDIR)omain
  167. -size $(CURRDIR)omain
  168. $(CURRDIR)cemain: $(OBJ) #$(CURRDIR)Makefile
  169. $(CC) $(LDFLAGS) $(OBJ) $(CELIBS) -o $(CURRDIR)cemain
  170. -size $(CURRDIR)cemain
  171. #AUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTO
  172. LLlex.o: LLlex.h
  173. LLlex.o: Lpars.h
  174. LLlex.o: class.h
  175. LLlex.o: const.h
  176. LLlex.o: debug.h
  177. LLlex.o: debugcst.h
  178. LLlex.o: f_info.h
  179. LLlex.o: idf.h
  180. LLlex.o: idfsize.h
  181. LLlex.o: input.h
  182. LLlex.o: inputtype.h
  183. LLlex.o: main.h
  184. LLlex.o: nocross.h
  185. LLlex.o: numsize.h
  186. LLlex.o: strsize.h
  187. LLlex.o: target_sizes.h
  188. LLlex.o: type.h
  189. LLmessage.o: LLlex.h
  190. LLmessage.o: Lpars.h
  191. LLmessage.o: idf.h
  192. LLmessage.o: nocross.h
  193. LLmessage.o: target_sizes.h
  194. LLmessage.o: type.h
  195. body.o: LLlex.h
  196. body.o: chk_expr.h
  197. body.o: debug.h
  198. body.o: debugcst.h
  199. body.o: def.h
  200. body.o: desig.h
  201. body.o: idf.h
  202. body.o: main.h
  203. body.o: misc.h
  204. body.o: nocross.h
  205. body.o: node.h
  206. body.o: scope.h
  207. body.o: target_sizes.h
  208. body.o: type.h
  209. chk_expr.o: LLlex.h
  210. chk_expr.o: Lpars.h
  211. chk_expr.o: chk_expr.h
  212. chk_expr.o: const.h
  213. chk_expr.o: debug.h
  214. chk_expr.o: debugcst.h
  215. chk_expr.o: def.h
  216. chk_expr.o: idf.h
  217. chk_expr.o: main.h
  218. chk_expr.o: misc.h
  219. chk_expr.o: nocross.h
  220. chk_expr.o: node.h
  221. chk_expr.o: required.h
  222. chk_expr.o: scope.h
  223. chk_expr.o: target_sizes.h
  224. chk_expr.o: type.h
  225. code.o: LLlex.h
  226. code.o: Lpars.h
  227. code.o: debug.h
  228. code.o: debugcst.h
  229. code.o: def.h
  230. code.o: desig.h
  231. code.o: main.h
  232. code.o: misc.h
  233. code.o: nocross.h
  234. code.o: node.h
  235. code.o: required.h
  236. code.o: scope.h
  237. code.o: target_sizes.h
  238. code.o: type.h
  239. cstoper.o: LLlex.h
  240. cstoper.o: Lpars.h
  241. cstoper.o: const.h
  242. cstoper.o: debug.h
  243. cstoper.o: debugcst.h
  244. cstoper.o: nocross.h
  245. cstoper.o: node.h
  246. cstoper.o: required.h
  247. cstoper.o: target_sizes.h
  248. cstoper.o: type.h
  249. def.o: LLlex.h
  250. def.o: debug.h
  251. def.o: debugcst.h
  252. def.o: def.h
  253. def.o: idf.h
  254. def.o: main.h
  255. def.o: misc.h
  256. def.o: nocross.h
  257. def.o: node.h
  258. def.o: scope.h
  259. def.o: target_sizes.h
  260. def.o: type.h
  261. desig.o: LLlex.h
  262. desig.o: debug.h
  263. desig.o: debugcst.h
  264. desig.o: def.h
  265. desig.o: desig.h
  266. desig.o: idf.h
  267. desig.o: main.h
  268. desig.o: nocross.h
  269. desig.o: node.h
  270. desig.o: scope.h
  271. desig.o: target_sizes.h
  272. desig.o: type.h
  273. enter.o: LLlex.h
  274. enter.o: def.h
  275. enter.o: idf.h
  276. enter.o: main.h
  277. enter.o: nocross.h
  278. enter.o: node.h
  279. enter.o: scope.h
  280. enter.o: target_sizes.h
  281. enter.o: type.h
  282. error.o: LLlex.h
  283. error.o: debug.h
  284. error.o: debugcst.h
  285. error.o: errout.h
  286. error.o: f_info.h
  287. error.o: input.h
  288. error.o: inputtype.h
  289. error.o: main.h
  290. error.o: node.h
  291. idf.o: idf.h
  292. input.o: f_info.h
  293. input.o: idf.h
  294. input.o: input.h
  295. input.o: inputtype.h
  296. label.o: LLlex.h
  297. label.o: def.h
  298. label.o: idf.h
  299. label.o: main.h
  300. label.o: nocross.h
  301. label.o: node.h
  302. label.o: scope.h
  303. label.o: target_sizes.h
  304. label.o: type.h
  305. lookup.o: LLlex.h
  306. lookup.o: def.h
  307. lookup.o: idf.h
  308. lookup.o: misc.h
  309. lookup.o: nocross.h
  310. lookup.o: node.h
  311. lookup.o: scope.h
  312. lookup.o: target_sizes.h
  313. lookup.o: type.h
  314. main.o: LLlex.h
  315. main.o: Lpars.h
  316. main.o: class.h
  317. main.o: const.h
  318. main.o: debug.h
  319. main.o: debugcst.h
  320. main.o: def.h
  321. main.o: f_info.h
  322. main.o: idf.h
  323. main.o: input.h
  324. main.o: inputtype.h
  325. main.o: main.h
  326. main.o: nocross.h
  327. main.o: node.h
  328. main.o: required.h
  329. main.o: target_sizes.h
  330. main.o: tokenname.h
  331. main.o: type.h
  332. misc.o: LLlex.h
  333. misc.o: f_info.h
  334. misc.o: idf.h
  335. misc.o: main.h
  336. misc.o: misc.h
  337. misc.o: node.h
  338. node.o: LLlex.h
  339. node.o: debug.h
  340. node.o: debugcst.h
  341. node.o: nocross.h
  342. node.o: node.h
  343. node.o: target_sizes.h
  344. node.o: type.h
  345. options.o: class.h
  346. options.o: const.h
  347. options.o: idfsize.h
  348. options.o: main.h
  349. options.o: nocross.h
  350. options.o: target_sizes.h
  351. options.o: type.h
  352. readwrite.o: LLlex.h
  353. readwrite.o: debug.h
  354. readwrite.o: debugcst.h
  355. readwrite.o: def.h
  356. readwrite.o: idf.h
  357. readwrite.o: main.h
  358. readwrite.o: misc.h
  359. readwrite.o: nocross.h
  360. readwrite.o: node.h
  361. readwrite.o: scope.h
  362. readwrite.o: target_sizes.h
  363. readwrite.o: type.h
  364. scope.o: LLlex.h
  365. scope.o: debug.h
  366. scope.o: debugcst.h
  367. scope.o: def.h
  368. scope.o: idf.h
  369. scope.o: misc.h
  370. scope.o: nocross.h
  371. scope.o: node.h
  372. scope.o: scope.h
  373. scope.o: target_sizes.h
  374. scope.o: type.h
  375. symbol2str.o: Lpars.h
  376. tokenname.o: Lpars.h
  377. tokenname.o: idf.h
  378. tokenname.o: tokenname.h
  379. type.o: LLlex.h
  380. type.o: const.h
  381. type.o: debug.h
  382. type.o: debugcst.h
  383. type.o: def.h
  384. type.o: idf.h
  385. type.o: main.h
  386. type.o: nocross.h
  387. type.o: node.h
  388. type.o: scope.h
  389. type.o: target_sizes.h
  390. type.o: type.h
  391. typequiv.o: LLlex.h
  392. typequiv.o: debug.h
  393. typequiv.o: debugcst.h
  394. typequiv.o: def.h
  395. typequiv.o: nocross.h
  396. typequiv.o: node.h
  397. typequiv.o: target_sizes.h
  398. typequiv.o: type.h
  399. progs.o: LLlex.h
  400. progs.o: debug.h
  401. progs.o: debugcst.h
  402. progs.o: def.h
  403. progs.o: main.h
  404. progs.o: nocross.h
  405. progs.o: scope.h
  406. progs.o: target_sizes.h
  407. progs.o: type.h
  408. declar.o: LLlex.h
  409. declar.o: Lpars.h
  410. declar.o: chk_expr.h
  411. declar.o: debug.h
  412. declar.o: debugcst.h
  413. declar.o: def.h
  414. declar.o: idf.h
  415. declar.o: main.h
  416. declar.o: misc.h
  417. declar.o: nocross.h
  418. declar.o: node.h
  419. declar.o: scope.h
  420. declar.o: target_sizes.h
  421. declar.o: type.h
  422. expression.o: LLlex.h
  423. expression.o: Lpars.h
  424. expression.o: chk_expr.h
  425. expression.o: debug.h
  426. expression.o: debugcst.h
  427. expression.o: def.h
  428. expression.o: idf.h
  429. expression.o: main.h
  430. expression.o: misc.h
  431. expression.o: nocross.h
  432. expression.o: node.h
  433. expression.o: scope.h
  434. expression.o: target_sizes.h
  435. expression.o: type.h
  436. program.o: LLlex.h
  437. program.o: Lpars.h
  438. program.o: def.h
  439. program.o: f_info.h
  440. program.o: idf.h
  441. program.o: main.h
  442. program.o: node.h
  443. program.o: scope.h
  444. statement.o: LLlex.h
  445. statement.o: Lpars.h
  446. statement.o: chk_expr.h
  447. statement.o: def.h
  448. statement.o: desig.h
  449. statement.o: f_info.h
  450. statement.o: idf.h
  451. statement.o: main.h
  452. statement.o: misc.h
  453. statement.o: nocross.h
  454. statement.o: node.h
  455. statement.o: scope.h
  456. statement.o: target_sizes.h
  457. statement.o: type.h
  458. tokenfile.o: Lpars.h
  459. Lpars.o: Lpars.h
  460. symbol2str.o: Lpars.h
  461. casestat.o: LLlex.h
  462. casestat.o: Lpars.h
  463. casestat.o: chk_expr.h
  464. casestat.o: debug.h
  465. casestat.o: debugcst.h
  466. casestat.o: density.h
  467. casestat.o: main.h
  468. casestat.o: nocross.h
  469. casestat.o: node.h
  470. casestat.o: target_sizes.h
  471. casestat.o: type.h
  472. tmpvar.o: debug.h
  473. tmpvar.o: debugcst.h
  474. tmpvar.o: def.h
  475. tmpvar.o: main.h
  476. tmpvar.o: nocross.h
  477. tmpvar.o: scope.h
  478. tmpvar.o: target_sizes.h
  479. tmpvar.o: type.h
  480. char.o: class.h
  481. next.o: debug.h
  482. next.o: debugcst.h