Makefile 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. # - no, it's not a true makefile...
  2. # - yes, it's a .bat quick-and-dirtily converted to a makefile
  3. # :-b
  4. BIN=$(shell pwd)/../bin
  5. MERGE=perl script/merge.pl
  6. PCHMK=$(BIN)/pchmaker
  7. DAT89=$(BIN)/dat89y -e HDR
  8. O2EXT=$(BIN)/obj2ti -x
  9. PCHFILES = stdhead.pch keywords.pch estack.pch estackle.pch events.pch homescr.pch tiosdlg.pch wingraph.pch xupaki.pch #gen.pch extgraph.pch
  10. TIPCHFILES = $(patsubst %.pch,%.89y,$(PCHFILES))
  11. all: src/* srcdata/* subprojects/xupaki.pch
  12. $(RM) lex.txt *.pchsource
  13. cp src/lex.txt src/*.pchsource .
  14. $(MAKE) $(TIPCHFILES) $(PCHFILES)
  15. $(RM) lex.txt pchlog.txt *.pchsource
  16. touch all
  17. stdhead.pchsource: src/*
  18. $(MERGE) src/stdhead-light.pchmerge
  19. tiosdlg.pchsource: src/*
  20. $(MERGE) src/tiosdlg-merge.pchmerge
  21. keywords.pch: keywords.pchsource extfiles
  22. $(PCHMK) $<
  23. stdhead.pch: stdhead.pchsource extfiles
  24. $(PCHMK) $<
  25. estackle.pch: estackle.pchsource stdhead.pch extfiles
  26. $(PCHMK) -istdhead.def $<
  27. estack.pch: estack.pchsource stdhead.pch estackle.pch extfiles
  28. $(PCHMK) -istdhead.def -iestackle.def $<
  29. events.pch: events.pchsource stdhead.pch extfiles
  30. $(PCHMK) -istdhead.def $<
  31. homescr.pch: homescr.pchsource stdhead.pch extfiles
  32. $(PCHMK) -istdhead.def $<
  33. tiosdlg.pch: tiosdlg.pchsource stdhead.pch extfiles
  34. $(PCHMK) -istdhead.def $<
  35. wingraph.pch: wingraph.pchsource stdhead.pch extfiles
  36. $(PCHMK) -istdhead.def $<
  37. #gen.pch: srcdata/gen.pch
  38. # cp $< $@
  39. #extgraph.pch: srcdata/extgraph.pch
  40. # cp $< $@
  41. xupaki.pch: subprojects/xupaki.pch
  42. cp $< $@
  43. %.89y: %.pch
  44. $(DAT89) -f zheader $<
  45. clean:
  46. $(RM) lex.txt pchlog.txt *.pchsource
  47. $(RM) extfiles
  48. $(RM) -r a2ext
  49. distclean: clean
  50. scratchclean: distclean
  51. $(RM) *.pch *.89y *.def subprojects/*.pch all
  52. include ../config.mk
  53. install: all
  54. mkdir -p $(prefix)/share/gtc/include
  55. install -m 644 *.pch $(prefix)/share/gtc/include
  56. try-import-tigcc-archive:
  57. mv -f src/tigcc-archive/tigcc.a srcdata/tigcc.a&&rm -f src/tigcc-archive/*.o||true
  58. srcdata/tigcc.a: try-import-tigcc-archive
  59. extfiles: srcdata/*
  60. $(RM) -r a2ext
  61. mkdir a2ext
  62. sh -c 'cd a2ext && ar x ../srcdata/tigcc.a'
  63. cp srcdata/export.dat srcdata/*.ext srcdata/*.ref a2ext
  64. $(MAKE) -C a2ext -f ../ext.mk O2EXT="$(O2EXT)"
  65. touch extfiles
  66. subprojects/xupaki.pch: subprojects/xupaki/xupaki.pchsource subprojects/xupaki/unpack2.o
  67. $(RM) -r subprojects/xupaki/a2ext
  68. mkdir subprojects/xupaki/a2ext
  69. sh -c 'cd subprojects/xupaki/a2ext && cp ../export.dat ../*.o . && for i in *.o; do $(O2EXT) "$$i"; done'
  70. sh -c 'cd subprojects/xupaki && $(PCHMK) xupaki.pchsource && rm -f pchlog.txt xupaki.def && mv xupaki.pch ..'