rules 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. #!/usr/bin/make -f
  2. # debian/rules for Free Pascal
  3. # Don't load the system makefile.fpc
  4. export FPCMAKE=
  5. export FPCDIR=
  6. # Documentation type to use pdf/html
  7. DOCTYPE=pdf
  8. # Get Package version and FPC version out of changelog file
  9. PACKAGEVERSION=$(shell head -n 1 debian/changelog | awk '{ print $$2 }' | tr -d '[()]')
  10. FPCVERSION=$(shell echo $(PACKAGEVERSION) | awk -F '-' '{ print $$1 }')
  11. # Get directories
  12. PWD=$(shell pwd)
  13. BUILD_DIR=$(PWD)/debian/build
  14. INSTALL_DIR=$(PWD)/debian/tmp
  15. NEWPP=$(PWD)/compiler/ppc386
  16. export DH_COMPAT=2
  17. #export DH_VERBOSE=1
  18. ###################
  19. # Clean
  20. #
  21. clean:
  22. @echo "--- Cleaning"
  23. dh_testdir
  24. dh_testroot
  25. rm -f build-arch-stamp install-arch-stamp
  26. rm -f build-indep-stamp install-indep-stamp
  27. rm -f debian-files-stamp
  28. rm -f debian/*.files debian/*.docs debian/*.examples debian/*.postinst
  29. $(MAKE) compiler_clean
  30. $(MAKE) rtl_clean
  31. $(MAKE) utils_clean
  32. $(MAKE) fcl_clean
  33. $(MAKE) gtk_clean
  34. $(MAKE) api_clean
  35. $(MAKE) fv_clean
  36. $(MAKE) -C packages clean
  37. $(MAKE) -C docs clean
  38. dh_clean
  39. rm -f debian/control
  40. ###################
  41. # Debian files
  42. #
  43. debian-files: debian-files-stamp
  44. debian-files-stamp:
  45. @echo "--- Creating debian files"
  46. debian/fixdeb debian
  47. touch debian-files-stamp
  48. ###################
  49. # Arch packages
  50. #
  51. build-arch: build-arch-stamp
  52. build-arch-stamp: debian-files
  53. @echo "--- Building"
  54. dh_testdir
  55. # First make a new Compiler and RTL using a make cycle
  56. $(MAKE) compiler_cycle
  57. $(MAKE) utils_all PP=$(NEWPP)
  58. $(MAKE) fcl_all PP=$(NEWPP)
  59. $(MAKE) gtk_all PP=$(NEWPP)
  60. $(MAKE) api_all PP=$(NEWPP)
  61. $(MAKE) fv_all PP=$(NEWPP)
  62. $(MAKE) -C packages all PP=$(NEWPP) RELEASE=1
  63. touch build-arch-stamp
  64. install-arch: install-arch-stamp
  65. install-arch-stamp: build-arch debian-files
  66. @echo "--- Installing"
  67. dh_testdir
  68. dh_testroot
  69. dh_clean
  70. # Specify the compiler to use so installing will do correctly
  71. $(MAKE) compiler_install PP=$(NEWPP) PREFIXINSTALLDIR=$(INSTALL_DIR)/usr
  72. $(MAKE) rtl_install PP=$(NEWPP) PREFIXINSTALLDIR=$(INSTALL_DIR)/usr
  73. $(MAKE) utils_install PP=$(NEWPP) PREFIXINSTALLDIR=$(INSTALL_DIR)/usr
  74. $(MAKE) base_install PP=$(NEWPP) PREFIXINSTALLDIR=$(INSTALL_DIR)/usr
  75. $(MAKE) man_install PP=$(NEWPP) PREFIXINSTALLDIR=$(INSTALL_DIR)/usr/share
  76. $(MAKE) demo_install PP=$(NEWPP) PREFIXINSTALLDIR=$(INSTALL_DIR)/usr
  77. $(MAKE) fcl_install PP=$(NEWPP) PREFIXINSTALLDIR=$(INSTALL_DIR)/usr
  78. $(MAKE) gtk_install PP=$(NEWPP) PREFIXINSTALLDIR=$(INSTALL_DIR)/usr
  79. $(MAKE) api_install PP=$(NEWPP) PREFIXINSTALLDIR=$(INSTALL_DIR)/usr
  80. $(MAKE) fv_install PP=$(NEWPP) PREFIXINSTALLDIR=$(INSTALL_DIR)/usr
  81. $(MAKE) -C packages install PP=$(NEWPP) PREFIXINSTALLDIR=$(INSTALL_DIR)/usr
  82. touch install-arch-stamp
  83. ###################
  84. # Documentation
  85. #
  86. build-indep: build-indep-stamp
  87. build-indep-stamp: debian-files
  88. @echo "--- Building Documentation"
  89. dh_testdir
  90. $(MAKE) -C docs $(DOCTYPE)
  91. touch build-indep-stamp
  92. install-indep: install-indep-stamp
  93. install-indep-stamp: debian-files build-indep
  94. @echo "--- Installing Documentation"
  95. dh_testdir
  96. dh_testroot
  97. dh_clean
  98. $(MAKE) -C docs $(DOCTYPE)install DOCINSTALLDIR=$(INSTALL_DIR)/usr/share/doc/fpc/$(FPCVERSION)/
  99. touch install-indep-stamp
  100. ###################
  101. # Generic
  102. #
  103. build: build-arch build-indep
  104. install: install-arch install-indep
  105. binary: binary-indep binary-arch
  106. ###################
  107. # Deb building
  108. #
  109. binary-indep: build-indep install-indep debian-files
  110. @echo "--- Building: arch-indep packages"
  111. dh_testversion 2
  112. dh_testdir
  113. dh_testroot
  114. dh_installdocs -i
  115. dh_installchangelogs -i
  116. dh_movefiles -i
  117. dh_compress -i -X.pdf
  118. dh_fixperms -i
  119. dh_installdeb -i
  120. dh_gencontrol -i
  121. dh_md5sums -i
  122. dh_builddeb -i
  123. binary-arch: build-arch install-arch debian-files
  124. @echo "--- Building: arch packages"
  125. dh_testversion 2
  126. dh_testdir
  127. dh_testroot
  128. dh_installdocs -a
  129. dh_installchangelogs -a
  130. dh_undocumented -a
  131. dh_installexamples -a
  132. dh_movefiles -a
  133. dh_compress -a
  134. dh_fixperms -a
  135. dh_installdeb -a
  136. # dh_shlibdeps -a
  137. dh_gencontrol -a
  138. dh_md5sums -a
  139. dh_builddeb -a
  140. binary: binary-indep binary-arch
  141. .PHONY: build clean binary-indep binary-arch binary