From aa6d5106e7a4affcb8e30bdfb8a277e4ff11cb92 Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Fri, 30 Aug 2019 07:27:34 -0600 Subject: [PATCH] Makefile: Added support for application-specific export target. Used by nuttx/tools/mkexport.sh. --- Makefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 845517cc5..dcfbad2fa 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # apps/Makefile # # Copyright (C) 2011 Uros Platise. All rights reserved. -# Copyright (C) 2011-2014, 2018 Gregory Nutt. All rights reserved. +# Copyright (C) 2011-2014, 2018-2019 Gregory Nutt. All rights reserved. # Authors: Uros Platise # Gregory Nutt # @@ -87,7 +87,7 @@ SYMTABOBJ = $(SYMTABSRC:.c=$(OBJEXT)) # Build targets all: $(BIN) -.PHONY: import install dirlinks context context_serialize clean_context context_rest .depdirs preconfig depend clean distclean +.PHONY: import install dirlinks context context_serialize clean_context context_rest export .depdirs preconfig depend clean distclean .PRECIOUS: libapps$(LIBEXT) define MAKE_template @@ -187,6 +187,16 @@ Kconfig: preconfig: Kconfig +export: +ifneq ($(EXPORTDIR),) +ifneq ($(BUILTIN_REGISTRY),) + $(Q) mkdir -p "${EXPORTDIR}"/registry || exit 1; \ + for f in "${BUILTIN_REGISTRY}"/*.bdat "${BUILTIN_REGISTRY}"/*.pdat ; do \ + [ -f "$${f}" ] && cp -f "$${f}" "${EXPORTDIR}"/registry ; \ + done +endif +endif + .depdirs: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_depend) .depend: context Makefile .depdirs