rules 4.4 KB

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