Makefile.fpc 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. #
  2. # Makefile.fpc for running fpmake
  3. #
  4. [package]
  5. name=fpmkunit
  6. version=2.7.1
  7. [require]
  8. packages=rtl paszlib fcl-process hash
  9. [install]
  10. fpcpackage=y
  11. [default]
  12. fpcdir=../..
  13. [prerules]
  14. #Defines for bootstrapping
  15. TARGET_UNITDIRBS=units_bs/$(SOURCESUFFIX)
  16. CLEAN_FILES+=units_bs/$(SOURCESUFFIX)/fpmkunit.ppu units_bs/$(SOURCESUFFIX)/fpmkunit.rst units_bs/$(SOURCESUFFIX)/fpmkunit.o
  17. CLEAN_FILES+=units_bs/$(SOURCESUFFIX)/adler.ppu units_bs/$(SOURCESUFFIX)/adler.o units_bs/$(SOURCESUFFIX)/crc.o units_bs/$(SOURCESUFFIX)/crc.ppu
  18. CLEAN_FILES+=units_bs/$(SOURCESUFFIX)/gzio.ppu units_bs/$(SOURCESUFFIX)/gzio.o units_bs/$(SOURCESUFFIX)/infblock.o units_bs/$(SOURCESUFFIX)/infblock.ppu
  19. CLEAN_FILES+=units_bs/$(SOURCESUFFIX)/infcodes.ppu units_bs/$(SOURCESUFFIX)/infcodes.o units_bs/$(SOURCESUFFIX)/inffast.o units_bs/$(SOURCESUFFIX)/inffast.ppu
  20. CLEAN_FILES+=units_bs/$(SOURCESUFFIX)/inftrees.ppu units_bs/$(SOURCESUFFIX)/inftrees.o units_bs/$(SOURCESUFFIX)/infutil.o units_bs/$(SOURCESUFFIX)/infutil.ppu
  21. CLEAN_FILES+=units_bs/$(SOURCESUFFIX)/pipes.ppu units_bs/$(SOURCESUFFIX)/pipes.o units_bs/$(SOURCESUFFIX)/process.o units_bs/$(SOURCESUFFIX)/process.ppu units_bs/$(SOURCESUFFIX)/process.rst
  22. CLEAN_FILES+=units_bs/$(SOURCESUFFIX)/trees.ppu units_bs/$(SOURCESUFFIX)/trees.o units_bs/$(SOURCESUFFIX)/zbase.o units_bs/$(SOURCESUFFIX)/zbase.ppu units_bs/$(SOURCESUFFIX)/zbase.rst
  23. CLEAN_FILES+=units_bs/$(SOURCESUFFIX)/zdeflate.ppu units_bs/$(SOURCESUFFIX)/zdeflate.o units_bs/$(SOURCESUFFIX)/zinflate.o units_bs/$(SOURCESUFFIX)/zinflate.ppu
  24. CLEAN_FILES+=units_bs/$(SOURCESUFFIX)/zipper.ppu units_bs/$(SOURCESUFFIX)/zipper.o units_bs/$(SOURCESUFFIX)/zipper.rst units_bs/$(SOURCESUFFIX)/zstream.o units_bs/$(SOURCESUFFIX)/zstream.ppu units_bs/$(SOURCESUFFIX)/zstream.rst
  25. # Set NO_UNIT_PROCESS on hosts that do not support the process unit
  26. ifneq ($(findstring $(OS_SOURCE),os2 go32v2),)
  27. NO_UNIT_PROCESS=1
  28. endif
  29. ifdef NO_UNIT_PROCESS
  30. UNIT_PROCESS=-dNO_UNIT_PROCESS
  31. else
  32. UNIT_PROCESS=
  33. ifneq ($(findstring $(OS_SOURCE),win32 win64),)
  34. UNIT_PROCESS+=-Fi../fcl-process/src/win
  35. endif
  36. ifneq ($(findstring $(OS_SOURCE),linux freebsd darwin iphonesim netbsd openbsd solaris haiku aix),)
  37. UNIT_PROCESS+=-Fi../fcl-process/src/unix
  38. endif
  39. ifneq ($(findstring $(OS_SOURCE),os2 emx),)
  40. UNIT_PROCESS+=-Fi../fcl-process/src/os2
  41. endif
  42. UNIT_PROCESS+=-Fu../fcl-process/src -Fi../fcl-process/src/$(OS_SOURCE) -Fi../fcl-process/src/dummy
  43. endif
  44. ifdef NO_UNIT_ZIPPER
  45. UNIT_ZIPPER=-dNO_UNIT_ZIPPER
  46. else
  47. UNIT_ZIPPER=-Fu../paszlib/src -Fu../hash/src -Fi../paszlib/src
  48. endif
  49. # End of bootstrap-code
  50. FPMAKE_BIN_CLEAN=$(wildcard .$(PATHSEP)fpmake$(SRCEXEEXT))
  51. ifdef OS_TARGET
  52. FPC_TARGETOPT+=--os=$(OS_TARGET)
  53. endif
  54. ifdef CPU_TARGET
  55. FPC_TARGETOPT+=--cpu=$(CPU_TARGET)
  56. endif
  57. LOCALFPMAKE=.$(PATHSEP)fpmake$(SRCEXEEXT)
  58. [rules]
  59. .NOTPARALLEL:
  60. $(TARGET_UNITDIRBS):
  61. $(MKDIRTREE) $(TARGET_UNITDIRBS)
  62. bootstrap: $(TARGET_UNITDIRBS)
  63. $(FPCFPMAKE) src/fpmkunit.pp $(FPMAKE_SKIP_CONFIG) $(FPCOPT) $(addprefix -Fu,$(COMPILER_FPMAKE_UNITDIR)) -FU$(TARGET_UNITDIRBS) $(UNIT_ZIPPER) $(UNIT_PROCESS)
  64. fpmake: fpmake.pp
  65. $(FPCFPMAKE) fpmake.pp $(FPMAKE_SKIP_CONFIG) $(FPCOPT) $(addprefix -Fu,$(UNITDIR_FPMAKE_RTL)) $(FPCMAKEOPT) -Fu$(TARGET_UNITDIRBS)
  66. all: fpmake
  67. $(LOCALFPMAKE) compile --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) -bu
  68. smart: fpmake
  69. $(LOCALFPMAKE) compile --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) -bu -o -XX -o -CX
  70. release: fpmake
  71. $(LOCALFPMAKE) compile --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) -bu -o -dRELEASE
  72. debug: fpmake
  73. $(LOCALFPMAKE) compile --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) -bu -o -dDEBUG
  74. # If no fpmake exists and (dist)clean is called, do not try to build fpmake, it will
  75. # most often fail because the dependencies are cleared.
  76. # In case of a clean, simply do nothing
  77. ifeq ($(FPMAKE_BIN_CLEAN),)
  78. clean:
  79. -$(DELTREE) units_bs
  80. else
  81. clean:
  82. $(FPMAKE_BIN_CLEAN) clean --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC)
  83. -$(DELTREE) units_bs
  84. endif
  85. # In case of a distclean, perform an 'old'-style distclean. This to avoid problems
  86. # when the package is compiled using fpcmake prior to running this clean using fpmake
  87. ifeq ($(FPMAKE_BIN_CLEAN),)
  88. distclean: $(addsuffix _distclean,$(TARGET_DIRS)) fpc_cleanall
  89. -$(DELTREE) units_bs
  90. else
  91. distclean:
  92. ifdef inUnix
  93. { $(FPMAKE_BIN_CLEAN) distclean --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC); if [ $$? != "0" ]; then { echo Something wrong with fpmake exectable. Remove the executable and call make recursively to recover.; $(DEL) $(FPMAKE_BIN_CLEAN); $(MAKE) fpc_cleanall; }; fi; }
  94. else
  95. $(FPMAKE_BIN_CLEAN) distclean --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC)
  96. endif
  97. -$(DEL) $(LOCALFPMAKE)
  98. -$(DELTREE) units_bs
  99. endif
  100. install: fpmake
  101. ifdef UNIXHier
  102. $(LOCALFPMAKE) install --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) --unitinstalldir=$(INSTALL_UNITDIR)
  103. else
  104. $(LOCALFPMAKE) install --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) --prefix=$(INSTALL_BASEDIR) --unitinstalldir=$(INSTALL_UNITDIR)
  105. endif
  106. # distinstall also installs the example-sources
  107. distinstall: fpmake
  108. ifdef UNIXHier
  109. $(LOCALFPMAKE) install --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) --unitinstalldir=$(INSTALL_UNITDIR) -ie
  110. else
  111. $(LOCALFPMAKE) install --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) --prefix=$(INSTALL_BASEDIR) --unitinstalldir=$(INSTALL_UNITDIR) -ie
  112. endif