Makefile.fpc 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #
  2. # Makefile.fpc for running fpmake
  3. #
  4. [package]
  5. name=chm
  6. version=2.7.1
  7. [require]
  8. packages=rtl fpmkunit
  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. # By default COMPILER_TARGETDIR is set to '.'. This is passed in the -FE parameter to the compiler
  23. # which leads to executables being placed into the wrong directory by the compiler.
  24. ifdef PACKAGEDIR_MAIN
  25. COMPILER_TARGETDIR=$(PACKAGEDIR_MAIN)/bin/$(TARGETSUFFIX)
  26. else
  27. COMPILER_TARGETDIR=bin/$(TARGETSUFFIX)
  28. endif
  29. [rules]
  30. .NOTPARALLEL:
  31. fpmake: fpmake.pp
  32. $(FPCFPMAKE) fpmake.pp $(FPMAKE_SKIP_CONFIG) $(FPCOPT) $(addprefix -Fu,$(COMPILER_FPMAKE_UNITDIR)) $(FPCMAKEOPT)
  33. all: fpmake
  34. $(LOCALFPMAKE) compile --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) -bu
  35. smart: fpmake
  36. $(LOCALFPMAKE) compile --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) -bu -o -XX -o -CX
  37. release: fpmake
  38. $(LOCALFPMAKE) compile --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) -bu -o -dRELEASE
  39. debug: fpmake
  40. $(LOCALFPMAKE) compile --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) -bu -o -dDEBUG
  41. # If no fpmake exists and (dist)clean is called, do not try to build fpmake, it will
  42. # most often fail because the dependencies are cleared.
  43. # In case of a clean, simply do nothing
  44. ifeq ($(FPMAKE_BIN_CLEAN),)
  45. clean:
  46. else
  47. clean:
  48. $(FPMAKE_BIN_CLEAN) clean --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC)
  49. endif
  50. # In case of a distclean, perform an 'old'-style distclean. This to avoid problems
  51. # when the package is compiled using fpcmake prior to running this clean using fpmake
  52. ifeq ($(FPMAKE_BIN_CLEAN),)
  53. distclean: $(addsuffix _distclean,$(TARGET_DIRS)) fpc_cleanall
  54. else
  55. distclean:
  56. ifdef inUnix
  57. { $(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; }
  58. else
  59. $(FPMAKE_BIN_CLEAN) distclean --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC)
  60. endif
  61. -$(DEL) $(LOCALFPMAKE)
  62. endif
  63. install: fpmake
  64. ifdef UNIXHier
  65. $(LOCALFPMAKE) install --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) --unitinstalldir=$(INSTALL_UNITDIR)
  66. else
  67. $(LOCALFPMAKE) install --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) --prefix=$(INSTALL_BASEDIR) --unitinstalldir=$(INSTALL_UNITDIR)
  68. endif
  69. # distinstall also installs the example-sources
  70. distinstall: fpmake
  71. ifdef UNIXHier
  72. $(LOCALFPMAKE) install --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) --unitinstalldir=$(INSTALL_UNITDIR) -ie
  73. else
  74. $(LOCALFPMAKE) install --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) --prefix=$(INSTALL_BASEDIR) --unitinstalldir=$(INSTALL_UNITDIR) -ie
  75. endif