123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204 |
- #!/usr/bin/make -f
- # debian/rules for Free Pascal
- # Don't use the system FPCDIR
- export FPCDIR=
- # Documentation type to use pdf/html
- DOCTYPE=pdf
- # Get Package version and FPC version out of changelog file
- PACKAGEVERSION:=$(shell head -n 1 debian/changelog | awk '{ print $$2 }' | tr -d '[()]')
- FPCVERSION:=$(shell echo $(PACKAGEVERSION) | awk -F '-' '{ print $$1 }')
- # Get directories
- PWD:=$(shell pwd)
- BUILD_DIR=$(PWD)/debian/build
- INSTALL_DIR=$(PWD)/debian/tmp
- NEWPP=$(PWD)/compiler/ppc386
- NEWPPUFILES=$(PWD)/utils/ppufiles
- BUILDOPTS=PP=$(NEWPP)
- INSTALLOPTS=PP=$(NEWPP) PPUFILES=$(NEWPPUFILES) PREFIXINSTALLDIR=$(INSTALL_DIR)/usr
- export DH_COMPAT=2
- # export DH_VERBOSE=1
- ###################
- # Clean
- #
- clean:
- @echo "--- Cleaning"
- dh_testdir
- dh_testroot
- rm -f build-arch-stamp install-arch-stamp arrange-arch-stamp
- rm -f build-indep-stamp install-indep-stamp
- rm -f debian-files-stamp
- rm -f debian/*.files debian/*.docs debian/*.examples debian/*.postinst
- $(MAKE) compiler_distclean
- $(MAKE) rtl_distclean
- $(MAKE) fcl_distclean
- $(MAKE) api_distclean
- $(MAKE) utils_distclean
- $(MAKE) packages_distclean
- $(MAKE) -C docs clean
- dh_clean
- # Cannot do that because the control-file is often needed afetr a cleanup
- # rm -f debian/control
- ###################
- # Debian files
- #
- debian-files: debian-files-stamp
- debian-files-stamp:
- @echo "--- Creating debian files"
- bash debian/fixdeb debian
- touch debian-files-stamp
- ###################
- # Arch packages
- #
- build-arch: build-arch-stamp
- build-arch-stamp: debian-files-stamp
- @echo "--- Building"
- dh_testdir
- # First make a new Compiler and RTL using a make cycle
- $(MAKE) compiler_cycle
- $(MAKE) fcl_all $(BUILDOPTS)
- $(MAKE) api_all $(BUILDOPTS)
- $(MAKE) packages_all $(BUILDOPTS)
- $(MAKE) utils_all $(BUILDOPTS)
- touch build-arch-stamp
- install-arch: install-arch-stamp
- install-arch-stamp: build-arch-stamp debian-files-stamp
- @echo "--- Installing"
- dh_testdir
- dh_testroot
- dh_clean -k
- # Specify the compiler to use so installing will use the correct versioned dir
- $(MAKE) compiler_install $(INSTALLOPTS)
- $(MAKE) rtl_install $(INSTALLOPTS)
- $(MAKE) fcl_install $(INSTALLOPTS)
- $(MAKE) api_install $(INSTALLOPTS)
- $(MAKE) utils_install $(INSTALLOPTS)
- $(MAKE) packages_install $(INSTALLOPTS)
- $(MAKE) man_install $(INSTALLOPTS) PREFIXINSTALLDIR=$(INSTALL_DIR)/usr/share
- $(MAKE) demo_install $(INSTALLOPTS) DOCINSTALLDIR=$(INSTALL_DIR)/usr/share/doc/fp-compiler
- $(MAKE) doc_install $(INSTALLOPTS) DOCINSTALLDIR=$(INSTALL_DIR)/usr/share/doc/fp-compiler
- $(MAKE) -C packages/gtk installexamples $(INSTALLOPTS) DOCINSTALLDIR=$(INSTALL_DIR)/usr/share/doc/fp-units-gtk
- touch install-arch-stamp
- arrange-arch: arrange-arch-stamp
- arrange-arch-stamp: install-arch-stamp debian-files-stamp
- dh_testversion 2
- dh_testdir
- dh_testroot
- dh_movefiles -a
- touch arrange-arch-stamp
- ###################
- # Documentation
- #
- build-indep: build-indep-stamp
- build-indep-stamp: debian-files-stamp
- @echo "--- Building Documentation"
- dh_testdir
- $(MAKE) -C docs $(DOCTYPE)
- touch build-indep-stamp
- install-indep: install-indep-stamp
- install-indep-stamp: debian-files build-indep
- @echo "--- Installing Documentation"
- dh_testdir
- dh_testroot
- dh_clean -k
- $(MAKE) -C docs $(DOCTYPE)install DOCINSTALLDIR=$(INSTALL_DIR)/usr/share/doc/fpc/$(FPCVERSION)/
- touch install-indep-stamp
- ###################
- # Generic
- #
- build: build-arch build-indep
- install: install-arch install-indep
- binary: binary-indep binary-arch
- ###################
- # Deb building
- #
- binary-indep: build-indep install-indep debian-files
- @echo "--- Building: arch-indep packages"
- dh_testversion 2
- dh_testdir
- dh_testroot
- dh_installdocs -i
- dh_installchangelogs -i
- dh_movefiles -i
- dh_compress -i -X.pdf
- dh_fixperms -i
- dh_installdeb -i
- dh_gencontrol -i
- dh_md5sums -i
- dh_builddeb -i
- binary-arch: build-arch arrange-arch debian-files
- @echo "--- Building: arch packages"
- dh_testversion 2
- dh_testdir
- dh_testroot
- dh_installdocs -a
- dh_installchangelogs -a
- dh_installchangelogs -pfp-compiler logs/Changes.compiler
- dh_installchangelogs -pfp-rtl logs/Changes.rtl
- dh_installchangelogs -pfp-utils logs/Changes.utils
- dh_installchangelogs -pfp-units-fcl logs/Changes.fcl
- dh_installchangelogs -pfp-units-api logs/Changes.api
- # dh_installchangelogs -pfp-units-fv logs/Changes.fv
- dh_undocumented -a
- dh_installexamples -a
- dh_compress -a
- dh_fixperms -a
- dh_installdeb -a
- # dh_shlibdeps -a
- dh_gencontrol -a
- dh_md5sums -a
- dh_builddeb -a
- .PHONY: build clean binary debian-files \
- build-arch install-arch binary-arch \
- binary-indep
|