libcrypto_utils.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 and header to the OUT_DIR Signed-off-by: Nisha Parrakat --- git/system/core/debian/libcrypto_utils.mk 2021-04-30 14:18:54.071379767 +0200 +++ git/system/core/debian/libcrypto_utils.mk 2021-04-30 14:22:46.179047308 +0200 @@ -1,15 +1,17 @@ +include ../../rules_yocto.mk NAME:= libcrypto_utils SOURCES := android_pubkey.c SOURCES := $(foreach source, $(SOURCES), libcrypto_utils/$(source)) -CPPFLAGS += -Ilibcrypto_utils/include -Iinclude +CPPFLAGS += -Ilibcrypto_utils/include -Iinclude -I$(OUT_DIR)/usr/include LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ - -L/usr/lib/$(DEB_HOST_MULTIARCH)/android \ + -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ -lcrypto -Wl,-z,defs build: $(SOURCES) - $(CC) $^ -o $(NAME).so.0 $(CPPFLAGS) $(LDFLAGS) - ln -s $(NAME).so.0 $(NAME).so + $(CC) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CPPFLAGS) $(LDFLAGS) + ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so + cp -r libcrypto_utils/include/* $(OUT_DIR)/usr/include/ clean: - $(RM) $(NAME).so* + $(RM) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so*