From ddb1daecd9b71852c672add6c7cf6009417cda91 Mon Sep 17 00:00:00 2001 From: Stepan Pressl Date: Thu, 7 Aug 2025 02:17:54 +0200 Subject: [PATCH] [EXPERIMENTAL] Makefile: EXTRA_APPS_LIBS and EXTRA_APPS_INCPATHS vars The variables are to be used to mainly by the export rule to export external libraries (.a files) and respective include paths. The exported external libraries are packed together in the libapps.a library (basically, every .o files are extracted and then packed together). Signed-off-by: Stepan Pressl --- Makefile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Makefile b/Makefile index 5a357053891..8b46595b6ad 100644 --- a/Makefile +++ b/Makefile @@ -197,6 +197,28 @@ preconfig: Kconfig export: ifneq ($(EXPORTDIR),) $(Q) mkdir -p "${EXPORTDIR}"$(DELIM)registry || exit 1; + if [ -n "${EXTRA_APPS_LIBS}" ]; then \ + mkdir -p $(APPDIR)$(DELIM)libcomb; \ + cp libapps.a $(APPDIR)$(DELIM)libcomb; \ + for l in ${EXTRA_APPS_LIBS}; do \ + echo "AR: $$(basename $${l})"; \ + cp $${l} $(APPDIR)$(DELIM)libcomb; \ + done; \ + cd $(APPDIR)$(DELIM)libcomb; \ + for l in *.a; do \ + $(AR_EXTRACT) $${l}; \ + done; \ + $(AR) libmerged.a *.o; \ + mv libmerged.a ..$(DELIM)libapps.a; \ + cd ..; \ + rm -rf $(APPDIR)$(DELIM)libcomb; \ + fi; \ + for d in ${EXTRA_APPS_INCPATHS}; do \ + if [ -d "$${d}" ]; then \ + echo "CP: $$(basename $${d})" ; \ + cp -r "$${d}" "${EXPORTDIR}"$(DELIM)include ; \ + fi \ + done ifneq ($(CONFIG_BUILD_KERNEL),y) ifneq ($(BUILTIN_REGISTRY),) for f in "${BUILTIN_REGISTRY}"$(DELIM)*.bdat "${BUILTIN_REGISTRY}"$(DELIM)*.pdat ; do \