#!/usr/bin/make -f # ============================================================================== # ARMv5 (Brainux) Switchable Optimization Template # Please add this below `#!/usr/bin/make -f`. # ============================================================================== # ------------------------------------------------------------------------------ # [1] Basic flags (base optimizations applied even during test builds) # ------------------------------------------------------------------------------ export COMMON_APPEND = -march=armv5tej -mtune=arm926ej-s -marm -O3 -fomit-frame-pointer -fstrict-aliasing -fno-tree-vectorize -fno-aggressive-loop-optimizations -fno-strict-overflow -mfloat-abi=soft -ffast-math -fno-finite-math-only -ffunction-sections -fdata-sections -falign-functions=2 export COMMON_APPEND += export DEB_CXXFLAGS_MAINT_APPEND = $(COMMON_APPEND) -std=gnu++11 -Wno-template-id-cdtor MY_CFLGS_BASE = $(COMMON_APPEND) -std=gnu11 -Wno-implicit-function-declaration 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 comment out, 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=max 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_CFLGS_BASE) # ------------------------------------------------------------------------------ #export DEB_CFLAGS_MAINT_APPEND=-O3 -march=armv5te -mtune=arm926ej-s -fomit-frame-pointer -fstrict-aliasing -mfloat-abi=soft -ffast-math -O3 -falign-functions=2 -ffunction-sections -fdata-sections -flto #export DEB_CXXFLAGS_MAINT_APPEND=$(DEB_CFLAGS_MAINT_APPEND) #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--gc-sections -flto %: dh $@ --with autotools_dev override_dh_auto_clean: # Generate the minimal config.mak required for "make distclean" test -f config.mak || echo "RM_REC := rm -f -r" > config.mak dh_auto_clean override_dh_clean: dh_clean tags override_dh_auto_configure: ./configure --prefix=/usr --disable-debugger --disable-cheats --disable-gl override_dh_auto_install: dh_auto_install # This is also installed as the upstream changelog rm $(CURDIR)/debian/stella/usr/share/doc/stella/Changes.txt # This is overridden by the copyright file rm $(CURDIR)/debian/stella/usr/share/doc/stella/License.txt