From 65ddf7ea7daae721b2d331164155542820ed3e33 Mon Sep 17 00:00:00 2001 From: Etienne Cordonnier Date: Fri, 3 Mar 2023 13:36:58 +0100 Subject: [PATCH 12/15] patching libsparse.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/libsparse.mk | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/debian/libsparse.mk b/debian/libsparse.mk index de280def..64caa45f 100644 --- a/debian/libsparse.mk +++ b/debian/libsparse.mk @@ -1,3 +1,4 @@ +include ../../rules_yocto.mk NAME = libsparse SOURCES = \ backed_block.cpp \ @@ -18,16 +19,16 @@ LDFLAGS += \ -shared -Wl,-soname,$(NAME).so.0 \ -lz \ -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ - -L. \ + -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ \ -lbase build: $(COBJECTS) $(CXXOBJECTS) - $(CXX) $^ -o $(NAME).so.0 $(LDFLAGS) - ln -s $(NAME).so.0 $(NAME).so + $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(LDFLAGS) + ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so clean: - $(RM) $(CXXOBJECTS) $(COBJECTS) $(NAME).so* + $(RM) $(CXXOBJECTS) $(COBJECTS) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* $(COBJECTS): %.o: %.c $(CC) $< -o $@ $(CFLAGS) $(CPPFLAGS) -- 2.36.1.vfs.0.0