From 22c7140dc170ecb26bde33fed4c9249b164f8d3c Mon Sep 17 00:00:00 2001 From: Etienne Cordonnier Date: Fri, 3 Mar 2023 13:19:08 +0100 Subject: [PATCH 06/15] libbase.mk: modifications to make it build in yocto environment 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 --- debian/libbase.mk | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/debian/libbase.mk b/debian/libbase.mk index 80da48f3..e6c3e365 100644 --- a/debian/libbase.mk +++ b/debian/libbase.mk @@ -1,3 +1,4 @@ +include ../../rules_yocto.mk NAME = libbase SOURCES = \ chrono_utils.cpp \ @@ -20,8 +21,9 @@ CPPFLAGS += -Iinclude -Ibase/include LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 build: $(SOURCES) - $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) - ln -s $(NAME).so.0 $(NAME).so + $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) + ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so + cp -r base/include/* $(OUT_DIR)/usr/include/ clean: - $(RM) $(NAME).so* + $(RM) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* -- 2.36.1.vfs.0.0