Makefile.fpc 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. #
  2. # Makefile.fpc for running fpmake
  3. #
  4. [package]
  5. name=fcl-process
  6. version=2.7.1
  7. [require]
  8. packages=rtl
  9. [install]
  10. fpcpackage=y
  11. [default]
  12. fpcdir=../..
  13. [prerules]
  14. FPMAKE_BIN_CLEAN=$(wildcard .$(PATHSEP)fpmake$(SRCEXEEXT))
  15. ifdef OS_TARGET
  16. FPC_TARGETOPT+=--os=$(OS_TARGET)
  17. endif
  18. ifdef CPU_TARGET
  19. FPC_TARGETOPT+=--cpu=$(CPU_TARGET)
  20. endif
  21. LOCALFPMAKE=.$(PATHSEP)fpmake$(SRCEXEEXT)
  22. # Adding a dependency on fpmkunit is not possbile due to an infinite loop. So
  23. # the fpmkunit-searchpath is added here:
  24. PACKAGEDIR_FPMKUNIT:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fpmkunit/Makefile.fpc,$(PACKAGESDIR))))))
  25. ifneq ($(PACKAGEDIR_FPMKUNIT),)
  26. ifneq ($(wildcard $(PACKAGEDIR_FPMKUNIT)/units_bs/$(SOURCESUFFIX)),)
  27. UNITDIR_FPMAKE_FPMKUNIT=$(PACKAGEDIR_FPMKUNIT)/units_bs/$(SOURCESUFFIX)
  28. else
  29. UNITDIR_FPMAKE_FPMKUNIT=$(PACKAGEDIR_FPMKUNIT)
  30. endif
  31. ifdef CHECKDEPEND
  32. $(PACKAGEDIR_FPMKUNIT)/$(FPCMADE):
  33. $(MAKE) -C $(PACKAGEDIR_FPMKUNIT) $(FPCMADE)
  34. override ALLDEPENDENCIES+=$(PACKAGEDIR_FPMKUNIT)/$(FPCMADE)
  35. endif
  36. else
  37. PACKAGEDIR_FPMKUNIT=
  38. UNITDIR_FPMKUNIT:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /fpmkunit/Package.fpc,$(UNITSDIR)))))
  39. ifneq ($(UNITDIR_FPMKUNIT),)
  40. UNITDIR_FPMKUNIT:=$(firstword $(UNITDIR_FPMKUNIT))
  41. else
  42. UNITDIR_FPMKUNIT=
  43. endif
  44. endif
  45. ifdef UNITDIR_FPMAKE_FPMKUNIT
  46. override COMPILER_FPMAKE_UNITDIR+=$(UNITDIR_FPMAKE_FPMKUNIT)
  47. endif
  48. [rules]
  49. # Do not pass the Makefile's unit and binary target locations. fpmake uses it's own.
  50. override FPCOPT:=$(filter-out -FU%,$(FPCOPT))
  51. override FPCOPT:=$(filter-out -FE%,$(FPCOPT))
  52. # Compose general fpmake-parameters
  53. ifdef FPMAKEOPT
  54. FPMAKE_OPT+=$(FPMAKEOPT)
  55. endif
  56. FPMAKE_OPT+=--localunitdir=../..
  57. FPMAKE_OPT+=--globalunitdir=..
  58. FPMAKE_OPT+=$(FPC_TARGETOPT)
  59. FPMAKE_OPT+=$(addprefix -o ,$(FPCOPT))
  60. FPMAKE_OPT+=--compiler=$(FPC)
  61. FPMAKE_OPT+=-bu
  62. .NOTPARALLEL:
  63. fpmake: fpmake.pp
  64. $(FPCFPMAKE) fpmake.pp $(FPMAKE_SKIP_CONFIG) $(addprefix -Fu,$(COMPILER_FPMAKE_UNITDIR)) $(FPCMAKEOPT) $(OPT)
  65. all: fpmake
  66. $(LOCALFPMAKE) compile $(FPMAKE_OPT)
  67. smart: fpmake
  68. $(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -XX -o -CX
  69. release: fpmake
  70. $(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -dRELEASE
  71. debug: fpmake
  72. $(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -dDEBUG
  73. # If no fpmake exists and (dist)clean is called, do not try to build fpmake, it will
  74. # most often fail because the dependencies are cleared.
  75. # In case of a clean, simply do nothing
  76. ifeq ($(FPMAKE_BIN_CLEAN),)
  77. clean:
  78. else
  79. clean:
  80. $(FPMAKE_BIN_CLEAN) clean $(FPMAKE_OPT)
  81. endif
  82. # In case of a distclean, perform an 'old'-style distclean. This to avoid problems
  83. # when the package is compiled using fpcmake prior to running this clean using fpmake
  84. ifeq ($(FPMAKE_BIN_CLEAN),)
  85. distclean: $(addsuffix _distclean,$(TARGET_DIRS)) fpc_cleanall
  86. else
  87. distclean:
  88. ifdef inUnix
  89. { $(FPMAKE_BIN_CLEAN) distclean $(FPMAKE_OPT); 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; }
  90. else
  91. $(FPMAKE_BIN_CLEAN) distclean $(FPMAKE_OPT)
  92. endif
  93. -$(DEL) $(LOCALFPMAKE)
  94. endif
  95. cleanall: distclean
  96. install: fpmake
  97. ifdef UNIXHier
  98. $(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) --unitinstalldir=$(INSTALL_UNITDIR)
  99. else
  100. $(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_BASEDIR) --unitinstalldir=$(INSTALL_UNITDIR)
  101. endif
  102. # distinstall also installs the example-sources
  103. distinstall: fpmake
  104. ifdef UNIXHier
  105. $(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) --unitinstalldir=$(INSTALL_UNITDIR) -ie
  106. else
  107. $(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_BASEDIR) --unitinstalldir=$(INSTALL_UNITDIR) -ie
  108. endif
  109. zipinstall: fpmake
  110. $(LOCALFPMAKE) zipinstall $(FPMAKE_OPT)