Skip to content

Commit 51d2942

Browse files
committed
[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 <[email protected]>
1 parent d334c5e commit 51d2942

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Makefile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,28 @@ preconfig: Kconfig
197197
export:
198198
ifneq ($(EXPORTDIR),)
199199
$(Q) mkdir -p "${EXPORTDIR}"$(DELIM)registry || exit 1;
200+
if [ -n "${EXTRA_APPS_LIBS}" ]; then \
201+
mkdir -p $(APPDIR)$(DELIM)libcomb; \
202+
cp libapps.a $(APPDIR)$(DELIM)libcomb; \
203+
for l in ${EXTRA_APPS_LIBS}; do \
204+
echo "AR: $${l}"; \
205+
cp $${l} $(APPDIR)$(DELIM)libcomb; \
206+
done; \
207+
cd $(APPDIR)$(DELIM)libcomb; \
208+
for l in *.a; do \
209+
ar x $${l}; \
210+
done; \
211+
ar rcs libmerged.a *.o; \
212+
mv libmerged.a ..$(DELIM)libapps.a; \
213+
cd ..; \
214+
rm -rf $(APPDIR)$(DELIM)libcomb; \
215+
fi; \
216+
for d in ${EXTRA_APPS_INCPATHS}; do \
217+
if [ -d "$${d}" ]; then \
218+
echo "CP: $${d}" ; \
219+
cp -r "$${d}" "${EXPORTDIR}"$(DELIM)include ; \
220+
fi \
221+
done
200222
ifneq ($(CONFIG_BUILD_KERNEL),y)
201223
ifneq ($(BUILTIN_REGISTRY),)
202224
for f in "${BUILTIN_REGISTRY}"$(DELIM)*.bdat "${BUILTIN_REGISTRY}"$(DELIM)*.pdat ; do \

0 commit comments

Comments
 (0)