#!/usr/bin/make -f DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) #export DEB_BUILD_MAINT_OPTIONS = hardening=+all # ifneq (,$(findstring -flto, $(shell dpkg-buildflags --get CFLAGS))) # export DEB_CFLAGS_MAINT_APPEND = -flto-partition=none # export DEB_CXXFLAGS_MAINT_APPEND = -flto-partition=none # export DEB_LDFLAGS_MAINT_APPEND = -flto-partition=none # endif # ============================================================================== # 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 -falign-functions=4 export COMMON_APPEND += -O2 -fomit-frame-pointer -fno-tree-vectorize export COMMON_APPEND += -mfloat-abi=soft -ffast-math -fno-finite-math-only -ffunction-sections -fdata-sections # Uncomment for legacy 2000s source code or when build/runtime issues occur. export COMMON_APPEND += -fno-strict-aliasing -fno-aggressive-loop-optimizations -fno-strict-overflow 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,--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 # ------------------------------------------------------------------------------ # ============================================================================== # 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 # ------------------------------------------------------------------------------ %: dh $@ override_dh_auto_configure: dh_auto_configure -- \ --with-plugindir=/usr/lib/$(DEB_HOST_MULTIARCH)/alsa-lib \ --enable-mixer-pymods \ --disable-silent-rules \ --disable-static \ --with-softfloat override_dh_auto_build-indep: dh_auto_build $(MAKE) doc override_dh_auto_install-indep: dh_auto_install $(MAKE) -C doc install override_dh_installdocs: dh_installdocs -X.md5 -Xall_a.js -Xall_f.js -Xall_14.js -Xall_15.js override_dh_install: find debian/tmp -name '*.la' -delete dh_install -plibasound2-dev -Xtopology dh_install --remaining-packages override_dh_missing: dh_missing --fail-missing override_dh_installchangelogs: dh_installchangelogs -XChangeLog override_dh_makeshlibs: dh_makeshlibs -plibasound2t64 --add-udeb=libasound2-udeb -- -c0 dh_makeshlibs -Nlibasound2t64 -- -c0 override_dh_auto_clean: rm -rf doc/doxygen rm -f src/control/ctl_symbols_list.c \ src/control/libcontrol.la \ src/hwdep/libhwdep.la \ src/mixer/libmixer.la \ src/pcm/libpcm.la \ src/pcm/pcm_symbols_list.c \ src/rawmidi/librawmidi.la \ src/seq/libseq.la \ src/timer/libtimer.la \ src/ucm/libucm.la dh_auto_clean