Makefile.fpc 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #
  2. # Makefile.fpc for running fpmake
  3. #
  4. [package]
  5. name=fcl-net
  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. [rules]
  23. fpmake: fpmake.pp
  24. $(FPCFPMAKE) fpmake.pp $(FPMAKE_SKIP_CONFIG) $(addprefix -Fu,$(COMPILER_FPMAKE_UNITDIR))
  25. all: fpmake
  26. $(LOCALFPMAKE) compile --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC)
  27. smart: fpmake
  28. $(LOCALFPMAKE) compile --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) -o -XX -o -CX
  29. release: fpmake
  30. $(LOCALFPMAKE) compile --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) -o -dRELEASE
  31. debug: fpmake
  32. $(LOCALFPMAKE) compile --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) -o -dDEBUG
  33. # If no fpmake exists and (dist)clean is called, do not try to build fpmake, it will
  34. # most often fail because the dependencies are cleared.
  35. # In case of a clean, simply do nothing
  36. ifeq ($(FPMAKE_BIN_CLEAN),)
  37. clean:
  38. else
  39. clean:
  40. $(FPMAKE_BIN_CLEAN) clean --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC)
  41. endif
  42. # In case of a distclean, perform an 'old'-style distclean. This to avoid problems
  43. # when the package is compiled using fpcmake prior to running this clean using fpmake
  44. ifeq ($(FPMAKE_BIN_CLEAN),)
  45. distclean: $(addsuffix _distclean,$(TARGET_DIRS)) fpc_cleanall
  46. else
  47. distclean:
  48. ifdef inUnix
  49. { $(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; }
  50. else
  51. $(FPMAKE_BIN_CLEAN) distclean --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC)
  52. endif
  53. -$(DEL) $(LOCALFPMAKE)
  54. endif
  55. install: fpmake
  56. ifdef UNIXHier
  57. $(LOCALFPMAKE) install --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) --prefix=$(INSTALL_PREFIX) --unitinstalldir=$(INSTALL_UNITDIR)
  58. else
  59. $(LOCALFPMAKE) install --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) --prefix=$(INSTALL_BASEDIR) --unitinstalldir=$(INSTALL_UNITDIR)
  60. endif
  61. # distinstall also installs the example-sources
  62. distinstall: fpmake
  63. ifdef UNIXHier
  64. $(LOCALFPMAKE) install --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) --prefix=$(INSTALL_PREFIX) --unitinstalldir=$(INSTALL_UNITDIR) -ie
  65. else
  66. $(LOCALFPMAKE) install --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) --prefix=$(INSTALL_BASEDIR) --unitinstalldir=$(INSTALL_UNITDIR) -ie
  67. endif