#!/usr/bin/make -f include /usr/share/dpkg/architecture.mk include /usr/share/dpkg/pkg-info.mk ## Security Hardening # disable LTO for now as the package uses clang. See #1015353 export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=-lto export DEB_CFLAGS_MAINT_APPEND = -fPIC -gdwarf-4 export DEB_CXXFLAGS_MAINT_APPEND = -fPIC -gdwarf-4 export DEB_LDFLAGS_MAINT_APPEND = -fPIC export DEB_CPPFLAGS_MAINT_APPEND = -DNDEBUG -UDEBUG \ -I/usr/include/android \ -fmessage-length=0 \ -fno-exceptions \ -fno-strict-aliasing \ -no-canonical-prefixes \ ifneq (, $(shell which lld)) export DEB_LDFLAGS_MAINT_APPEND += -fuse-ld=lld -Wl,--build-id=sha1 endif export DEB_HOST_MULTIARCH ifneq (, $(shell which clang)) export CC=clang export CXX=clang++ export DEB_CPPFLAGS_MAINT_APPEND += \ -Wno-c99-designator \ -Wno-gnu-designator \ -Wno-gnu-folding-constant \ endif COMPONENTS = debian/out/dmtracedump MAN_COMPONENTS = debian/out/dmtracedump.1 # MIPS is left out because ART only supports MIPSr6 while Debian is by default MIPSr2 ifneq ($(filter amd64 i386 armhf arm64,$(DEB_HOST_ARCH)),) COMPONENTS += debian/out/dexdump debian/out/dexlist MAN_COMPONENTS += debian/out/dexdump.1 debian/out/dexlist.1 COMPONENTS += debian/out/libdexfile_external.so debian/out/libdexfile_support.so endif debian/out/lib%.so: debian/lib%.mk dh_auto_build --buildsystem=makefile -- --file=$< debian/out/dmtracedump: debian/dmtracedump.mk dh_auto_build --buildsystem=makefile -- --file=$< debian/out/dexlist: debian/dexlist.mk debian/out/libart.so debian/out/libdexfile_support.so debian/out/libsigchain.so debian/out/libnativeloader.so dh_auto_build --buildsystem=makefile -- --file=$< debian/out/dexdump: debian/dexdump.mk debian/out/dexlist debian/out/libdexfile_external.so dh_auto_build --buildsystem=makefile -- --file=$< debian/out/libnativeloader.so: debian/libnativeloader.mk debian/out/libnativebridge.so dh_auto_build --buildsystem=makefile -- --file=$< debian/out/libart.so: debian/libart.mk debian/out/asm_defines.h dh_auto_build --buildsystem=makefile -- --file=$< # Only for debug purpose to build standalone object debian/out/asm_defines.h debian/out/operator_out.cc: debian/libart.mk dh_auto_build --buildsystem=makefile -- --file=$< $@ debian/out/mterp.S: debian/libart.mk debian/out/asm_defines.h dh_auto_build --buildsystem=makefile -- --file=$< $@ runtime/%.o libartbase/%.o libdexfile/%.o debian/out/%.o: debian/libart.mk dh_auto_build --buildsystem=makefile -- --file=$< $@ debian/out/%.1: debian/out/% help2man -N -n "Dex Tool" --no-discard-stderr --version-string="$(DEB_VERSION)" \ -o $@ $< %: dh $@ override_dh_auto_build: $(COMPONENTS) $(MAN_COMPONENTS) override_dh_auto_clean: dh_auto_clean make clean --file=debian/libart.mk ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) override_dh_auto_test-arch: debian/out/dmtracedump 2>&1 | grep 'Turn on HTML output' ifneq ($(filter amd64 i386 armhf arm64,$(DEB_HOST_ARCH)),) LD_LIBRARY_PATH=debian/out debian/out/dexdump -h 2>&1 | grep dexfile LD_LIBRARY_PATH=debian/out debian/out/dexlist -h 2>&1 | grep dexfile endif endif override_dh_gencontrol: dh_gencontrol dh_gencontrol -pandroid-libnativebridge -- -v1:$(DEB_VERSION) dh_gencontrol -pandroid-libnativeloader -- -v1:$(DEB_VERSION) dh_gencontrol -pdmtracedump -- -v1:$(DEB_VERSION) override_dh_shlibdeps: dh_shlibdeps -l/usr/lib/$(DEB_HOST_MULTIARCH)/android