#!/usr/bin/make -f include /usr/share/dpkg/architecture.mk include /usr/share/dpkg/pkg-info.mk export DEB_HOST_MULTIARCH # Security Hardening export DEB_BUILD_MAINT_OPTIONS = hardening=+all export DEB_CFLAGS_MAINT_APPEND = -fPIC export DEB_CXXFLAGS_MAINT_APPEND = -fPIC export DEB_CPPFLAGS_MAINT_APPEND = -DNDEBUG -UDEBUG -I/usr/include/android export DEB_LDFLAGS_MAINT_APPEND = -fPIC export DEB_VERSION # https://android.googlesource.com/platform/development/+/refs/tags/android-10.0.0_r36/sdk/plat_tools_source.prop_template export PLATFORM_TOOLS_VERSION = 28.0.2 ifneq (, $(shell which clang)) export CC=clang export CXX=clang++ endif COMPONENTS = \ libbacktrace.so \ libbase.so \ libcutils.so \ liblog.so \ libsparse.so \ libutils.so \ libziparchive.so \ libcrypto_utils.so \ simg2img \ img2simg \ append2simg \ simg2simg ifeq ($(findstring stage1,$(DEB_VERSION)),) COMPONENTS += adb/adb libadb.so fastboot/fastboot libnativebridge.so libnativeloader.so endif # Whatever depends on BoringSSL must be disabled on MIPS NON_MIPS_COMPONENTS = adb/adb libadb.so libcrypto_utils.so fastboot/fastboot ifneq ($(filter mips mipsel mips64el,$(DEB_HOST_ARCH)),) COMPONENTS := $(filter-out $(NON_MIPS_COMPONENTS),$(COMPONENTS)) endif # Most components only support ARM, x86 and MIPS, but some can be built # on all architectures. COMPONENTS_ANY_ARCH = \ append2simg \ img2simg \ libbase.so \ libcutils.so \ liblog.so \ libsparse.so \ simg2img \ simg2simg ifeq ($(filter amd64 i386 armel armhf arm64 mips mipsel mips64el,$(DEB_HOST_ARCH)),) COMPONENTS := $(filter $(COMPONENTS_ANY_ARCH), $(COMPONENTS)) endif lib%.so: debian/lib%.mk dh_auto_build --buildsystem=makefile -- -f $< debian/%.1: debian/%.1.md pandoc --standalone --from=markdown-smart --to=man --output=$@ $< libadb.so: debian/libadb.mk libcutils.so libbase.so libcrypto_utils.so dh_auto_build --buildsystem=makefile -- -f $< libbacktrace.so: debian/libbacktrace.mk libcutils.so libbase.so liblog.so dh_auto_build --buildsystem=makefile -- -f $< libbase.so: debian/libbase.mk liblog.so dh_auto_build --buildsystem=makefile -- -f $< libcutils.so: debian/libcutils.mk liblog.so libbase.so dh_auto_build --buildsystem=makefile -- -f $< libutils.so: debian/libutils.mk liblog.so libcutils.so libbacktrace.so dh_auto_build --buildsystem=makefile -- -f $< libziparchive: debian/libziparchive.mk liblog.so libbase.so dh_auto_build --buildsystem=makefile -- -f $< adb/adb: debian/adb.mk libadb.so libcutils.so libbase.so debian/adb.1 dh_auto_build --buildsystem=makefile -- -f $< fastboot/fastboot: debian/fastboot.mk libziparchive.so libsparse.so libbase.so libcutils.so libadb.so debian/fastboot.1 dh_auto_build --buildsystem=makefile -- -f $< simg2img: debian/simg2img.mk libbase.so libsparse.so dh_auto_build --buildsystem=makefile -- -f $< simg2simg: debian/simg2simg.mk libbase.so libsparse.so dh_auto_build --buildsystem=makefile -- -f $< img2simg: debian/img2simg.mk libbase.so libsparse.so dh_auto_build --buildsystem=makefile -- -f $< append2simg: debian/append2simg.mk libbase.so libsparse.so dh_auto_build --buildsystem=makefile -- -f $< libnativebridge.so: debian/libnativebridge.mk liblog.so dh_auto_build --buildsystem=makefile -- --file=$< libnativeloader.so: debian/libnativeloader.mk libnativebridge.so libbase.so dh_auto_build --buildsystem=makefile -- --file=$< %: dh $@ --with bash-completion override_dh_auto_build-arch: $(COMPONENTS) override_dh_auto_clean: dh_auto_clean $(foreach component,$(COMPONENTS),make clean -f debian/$(component:.so=).mk;) $(RM) debian/*.1 adb/adb fastboot/fastboot override_dh_shlibdeps: dh_shlibdeps -l/usr/lib/$(DEB_HOST_MULTIARCH)/android