mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-29 13:10:43 +01:00
251 lines
6.5 KiB
Makefile
251 lines
6.5 KiB
Makefile
#!/usr/bin/make -f
|
|
# debian/rules for Free Pascal
|
|
|
|
# Documentation type to use pdf/html
|
|
DOCTYPE=pdf
|
|
|
|
# Reset FPC and FPCDIR if it was set
|
|
FPC=
|
|
FPCDIR=
|
|
# 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
|
|
DOC_DIR=$(INSTALL_DIR)/usr/share/doc
|
|
EXAMPLE_TEMP=$(INSTALL_DIR)/usr/doc/fpc-$(FPCVERSION)/examples
|
|
# Get utils
|
|
NEWPP=$(PWD)/compiler/ppc386
|
|
# Create default options
|
|
BUILDOPTS=PP=$(NEWPP)
|
|
INSTALLOPTS=PP=$(NEWPP) INSTALL_PREFIX=$(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 debian/*.postrm
|
|
|
|
$(MAKE) compiler_distclean
|
|
$(MAKE) rtl_distclean
|
|
$(MAKE) packages_distclean
|
|
$(MAKE) fcl_distclean
|
|
$(MAKE) utils_distclean
|
|
|
|
$(MAKE) -C docs clean
|
|
|
|
-(find . -name \*.a | xargs rm)
|
|
|
|
rm -f docs/syntax.sty
|
|
|
|
dh_clean
|
|
|
|
# Cannot do that because the control-file is often needed after 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) rtl_clean rtl_smart $(BUILDOPTS)
|
|
$(MAKE) packages_base_smart $(BUILDOPTS)
|
|
$(MAKE) fcl_smart $(BUILDOPTS)
|
|
$(MAKE) packages_extra_smart $(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_distinstall $(INSTALLOPTS)
|
|
$(MAKE) rtl_distinstall $(INSTALLOPTS)
|
|
$(MAKE) fcl_distinstall $(INSTALLOPTS)
|
|
$(MAKE) packages_distinstall $(INSTALLOPTS)
|
|
$(MAKE) utils_distinstall $(INSTALLOPTS)
|
|
|
|
# Copy examples to the correct doc dir
|
|
install -d -m755 $(DOC_DIR)/fp-units-fcl/examples
|
|
install -d -m755 $(DOC_DIR)/fp-units-gtk/examples
|
|
install -d -m755 $(DOC_DIR)/fp-units-gfx/examples
|
|
install -d -m755 $(DOC_DIR)/fp-units-db/examples
|
|
install -d -m755 $(DOC_DIR)/fp-units-net/examples
|
|
install -d -m755 $(DOC_DIR)/fp-units-misc/examples
|
|
install -d -m755 $(DOC_DIR)/fp-units-base/examples
|
|
|
|
mv -f $(EXAMPLE_TEMP)/fcl $(DOC_DIR)/fp-units-fcl/examples
|
|
|
|
mv -f $(EXAMPLE_TEMP)/gtk $(DOC_DIR)/fp-units-gtk/examples
|
|
|
|
mv -f $(EXAMPLE_TEMP)/paszlib $(DOC_DIR)/fp-units-base/examples
|
|
mv -f $(EXAMPLE_TEMP)/regexpr $(DOC_DIR)/fp-units-base/examples
|
|
mv -f $(EXAMPLE_TEMP)/ncurses $(DOC_DIR)/fp-units-base/examples
|
|
|
|
mv -f $(EXAMPLE_TEMP)/forms $(DOC_DIR)/fp-units-gfx/examples
|
|
mv -f $(EXAMPLE_TEMP)/ggi $(DOC_DIR)/fp-units-gfx/examples
|
|
mv -f $(EXAMPLE_TEMP)/libgd $(DOC_DIR)/fp-units-gfx/examples
|
|
mv -f $(EXAMPLE_TEMP)/svgalib $(DOC_DIR)/fp-units-gfx/examples
|
|
mv -f $(EXAMPLE_TEMP)/opengl $(DOC_DIR)/fp-units-gfx/examples
|
|
|
|
mv -f $(EXAMPLE_TEMP)/ibase $(DOC_DIR)/fp-units-db/examples
|
|
mv -f $(EXAMPLE_TEMP)/mysql $(DOC_DIR)/fp-units-db/examples
|
|
mv -f $(EXAMPLE_TEMP)/oracle $(DOC_DIR)/fp-units-db/examples
|
|
mv -f $(EXAMPLE_TEMP)/postgres $(DOC_DIR)/fp-units-db/examples
|
|
mv -f $(EXAMPLE_TEMP)/gdbm $(DOC_DIR)/fp-units-db/examples
|
|
|
|
mv -f $(EXAMPLE_TEMP)/cmem $(DOC_DIR)/fp-units-misc/examples
|
|
mv -f $(EXAMPLE_TEMP)/gdbint $(DOC_DIR)/fp-units-misc/examples
|
|
mv -f $(EXAMPLE_TEMP)/utmp $(DOC_DIR)/fp-units-misc/examples
|
|
mv -f $(EXAMPLE_TEMP)/syslog $(DOC_DIR)/fp-units-misc/examples
|
|
|
|
mv -f $(EXAMPLE_TEMP)/inet $(DOC_DIR)/fp-units-net/examples
|
|
mv -f $(EXAMPLE_TEMP)/uncgi $(DOC_DIR)/fp-units-net/examples
|
|
|
|
# Check if all examples are removed, if not then the rmdir will fail
|
|
rmdir $(EXAMPLE_TEMP)
|
|
|
|
# Install man pages and RTL demos and whatsnew and readme
|
|
$(MAKE) man_install $(INSTALLOPTS) INSTALL_PREFIX=$(INSTALL_DIR)/usr/share
|
|
$(MAKE) demo_install $(INSTALLOPTS) INSTALL_DOCDIR=$(DOC_DIR)/fp-compiler
|
|
$(MAKE) doc_install $(INSTALLOPTS) INSTALL_DOCDIR=$(DOC_DIR)/fp-compiler
|
|
|
|
# Create fpc.cfg which is included as conffile
|
|
chmod 755 compiler/utils/samplecfg
|
|
compiler/utils/samplecfg "/usr/lib/fpc/\$$version" $(INSTALL_DIR)/etc
|
|
touch install-arch-stamp
|
|
|
|
|
|
arrange-arch: arrange-arch-stamp
|
|
arrange-arch-stamp: install-arch-stamp debian-files-stamp
|
|
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
|
|
|
|
# We need our own syntax.sty (v1.9) which is not in the current tetex and
|
|
# on ctan.org (PFV)
|
|
cp debian/syntax.sty docs
|
|
$(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_testdir
|
|
dh_testroot
|
|
dh_installdocs -i
|
|
dh_installchangelogs -i
|
|
dh_installchangelogs -pfp-docs logs/Changes.docs
|
|
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_testdir
|
|
dh_testroot
|
|
dh_installdocs -a
|
|
dh_installchangelogs -a
|
|
|
|
dh_installchangelogs -pfp-compiler logs/Changes.compiler
|
|
dh_installchangelogs -pfp-units-rtl logs/Changes.rtl
|
|
dh_installchangelogs -pfp-units-fcl logs/Changes.fcl
|
|
dh_installchangelogs -pfp-utils logs/Changes.utils
|
|
|
|
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
|