#!/usr/bin/make -f # # This is free software; see the GNU General Public Licence # version 2 or later for copying conditions. There is NO warranty. # ============================================================================== # ARMv5 (Brainux) Switchable Optimization Template for Debian Rules file. # Please add this below `#!/usr/bin/make -f` # or add this above `include /usr/share/dpkg/default.mk`. # ============================================================================== # ------------------------------------------------------------------------------ # [1] Basic flags (base optimizations applied even during test builds) # ------------------------------------------------------------------------------ export COMMON_APPEND = -march=armv5tej -mtune=arm926ej-s -marm export COMMON_APPEND += -O3 -fomit-frame-pointer -fno-tree-vectorize -fno-strict-overflow #export COMMON_APPEND += -fno-strict-aliasing -fno-aggressive-loop-optimizations export COMMON_APPEND += -mfloat-abi=soft -ffast-math -fno-finite-math-only -ffunction-sections -fdata-sections -falign-functions=4 export COMMON_APPEND += MY_CFLAGS_BASE = $(COMMON_APPEND) -Wno-error=implicit-function-declaration -Wno-error=int-conversion export DEB_CXXFLAGS_MAINT_APPEND+= $(COMMON_APPEND) -fpermissive export DEB_LDFLAGS_MAINT_APPEND += -lm -Wl,--gc-sections -Wl,-s -Wl,--as-needed export DEB_BUILD_MAINT_OPTIONS += hardening=+bindnow # ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------ # [2] Ultra-powerful finalization flag (Resource-intensive; for LTO production use) # When performing a build check (test), # please comment out the six lines below by adding a "#" at the beginning of each. # When enabling these lines (uncommenting), please execute the following command beforehand. # $ mkdir -p ~/target_tmp # ------------------------------------------------------------------------------ export TMPDIR =$(HOME)/target_tmp export TMP =$(HOME)/target_tmp export TEMP =$(HOME)/target_tmp export DEB_CXXFLAGS_MAINT_APPEND += -Wno-odr export DEB_LDFLAGS_MAINT_APPEND += -flto-partition=balanced export DEB_BUILD_MAINT_OPTIONS += optimize=+lto # ------------------------------------------------------------------------------ include /usr/share/dpkg/architecture.mk include /usr/share/dpkg/pkg-info.mk #export DEB_BUILD_MAINT_OPTIONS = hardening=+all # ============================================================================== # Please add this below `include /usr/share/dpkg/default.mk`. # ============================================================================== # ------------------------------------------------------------------------------ # [3] Final assignment (*Must be placed at the very end) # ------------------------------------------------------------------------------ export DEB_CFLAGS_MAINT_APPEND += $(MY_CFLAGS_BASE) # ------------------------------------------------------------------------------ # [4] Compatibility settings for building legacy source code with GCC 14+ # - Forces C11/C++11 standards to allow old syntax stricter in newer compilers. # - Suppresses C++20-specific template/constructor warnings and errors. # ------------------------------------------------------------------------------ #export DEB_CFLAGS_MAINT_APPEND += -std=gnu11 #export DEB_CXXFLAGS_MAINT_APPEND += -std=gnu++11 -Wno-template-id-cdtor # ------------------------------------------------------------------------------ # Always abort if there are any problems with the symbols file. DPKG_GENSYMBOLS_CHECK_LEVEL = 0 export DPKG_GENSYMBOLS_CHECK_LEVEL dep_ver := $(shell echo $(DEB_VERSION_UPSTREAM) | cut -d '.' -f -2) udeb_dir := debian/udeb udeb_builddir := $(udeb_dir)/build udeb_installdir := $(udeb_dir)/install configure_flags := --without-harfbuzz udeb_configure_flags := $(configure_flags) --without-brotli --without-bzip2 --without-librsvg doc_dir := debian/freetype2-doc/usr/share/doc/libfreetype-dev %: dh $@ override_dh_autoreconf: dh_autoreconf ./autogen.sh override_dh_auto_configure: ifeq (,$(filter noudeb,$(DEB_BUILD_PROFILES))) dh_auto_configure --builddir=$(udeb_builddir) -- $(udeb_configure_flags) endif dh_auto_configure -- $(configure_flags) override_dh_auto_build: ifeq (,$(filter noudeb,$(DEB_BUILD_PROFILES))) dh_auto_build --builddir=$(udeb_builddir) endif dh_auto_build ifeq (,$(filter pkg.freetype.nodemos,$(DEB_BUILD_PROFILES))) dh_auto_build --sourcedir=ft2demos -- TOP_DIR=$(CURDIR) endif override_dh_auto_install: ifeq (,$(filter noudeb,$(DEB_BUILD_PROFILES))) dh_auto_install --builddir=$(udeb_builddir) --destdir=$(udeb_installdir) endif dh_auto_install ifeq (,$(filter pkg.freetype.nodemos,$(DEB_BUILD_PROFILES))) dh_auto_install --sourcedir=ft2demos -- TOP_DIR=$(CURDIR) endif override_dh_install: ifeq (,$(filter noudeb,$(DEB_BUILD_PROFILES))) dh_install -p libfreetype6-udeb --sourcedir=$(udeb_installdir) endif sed -i -e '/dependency_libs/s/'.*'//' debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libfreetype.la dh_install --remaining-packages override_dh_installdocs-indep: dh_installdocs -p freetype2-doc --doc-main-package=libfreetype-dev \ -Xreference/sitemap.xml.gz -Xreference/assets/images cp docs/CHANGES $(doc_dir)/NEWS cp src/pcf/README $(doc_dir)/pcf/ sed -i 's@\.\./\.\./js@js@' \ $(doc_dir)/documentation.html \ $(doc_dir)/ft2faq.html \ $(doc_dir)/index.html \ $(doc_dir)/design/*.html \ $(doc_dir)/glyphs/*.html \ $(doc_dir)/tutorial/*.html sed -i '/gstatic/d' $(doc_dir)/reference/*.html sed -i '/googleapis/d' $(doc_dir)/reference/*.html sed -i '/assets\/javascripts/d' $(doc_dir)/reference/*.html override_dh_installchangelogs: dh_installchangelogs -p freetype2-demos ft2demos/ChangeLog dh_installchangelogs --remaining-packages override_dh_makeshlibs: dh_makeshlibs -V 'libfreetype6 (>= $(dep_ver))' --add-udeb=libfreetype6-udeb override_dh_auto_clean: dh_auto_clean --sourcedir=ft2demos -- TOP_DIR=$(CURDIR) dh_auto_clean rm -rf $(udeb_dir) objs/.libs