From bea40821d787ca31b38d5879fbf751be1dbea622 Mon Sep 17 00:00:00 2001 From: Etienne Cordonnier Date: Fri, 3 Mar 2023 13:33:30 +0100 Subject: [PATCH 09/15] patching img2simg.mk to build in yocto environment. Changes include: Introduced an output folder which will keep all the outputs from the android-tools. Adding an include file that is setting the common flags. Changed the cppflag to include the headers from other components of android-tools Modified LDflags so that the libraries that are coming from other android-tools are searched in the output folder. Modified the build rule so that it outputs the binary to the OUT_DIR Signed-off-by: Nisha Parrakat Upstream-Status: Pending --- debian/img2simg.mk | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/debian/img2simg.mk b/debian/img2simg.mk index f1036cef..94772381 100644 --- a/debian/img2simg.mk +++ b/debian/img2simg.mk @@ -1,13 +1,15 @@ +include ../../rules_yocto.mk NAME = img2simg SOURCES = img2simg.cpp SOURCES := $(foreach source, $(SOURCES), libsparse/$(source)) CPPFLAGS += -Ilibsparse/include -Iinclude -std=gnu++17 -LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ - -Wl,-rpath-link=. \ - -L. -lsparse +LDFLAGS += -Wl,-rpath=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ + -Wl,-rpath-link=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ \ + -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ -lsparse build: $(SOURCES) - $(CXX) $^ -o libsparse/$(NAME) $(CPPFLAGS) $(LDFLAGS) + mkdir --parents $(OUT_DIR)/usr/bin + $(CXX) $^ -o $(OUT_DIR)/usr/bin/$(NAME) $(CPPFLAGS) $(LDFLAGS) clean: - $(RM) libsparse/$(NAME) + $(RM) $(OUT_DIR)/usr/bin/$(NAME) -- 2.36.1.vfs.0.0