You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ag...@apache.org on 2020/06/29 23:52:22 UTC

[incubator-nuttx-apps] 03/04: make/import: support install nuttx binary in flat build

This is an automated email from the ASF dual-hosted git repository.

aguettouche pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit c81a1f9711faf7fe2667a14daba74b0b6ec173f7
Author: chao.an <an...@xiaomi.com>
AuthorDate: Wed Jun 24 11:14:02 2020 +0800

    make/import: support install nuttx binary in flat build
    
    Change-Id: Iaffa86ee9ebd77380424e6d4a0777262685c989f
    Signed-off-by: chao.an <an...@xiaomi.com>
---
 Makefile         |  1 +
 import/Make.defs |  2 +-
 import/Makefile  | 12 +++++++++++-
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 7d97135..29d5e09 100644
--- a/Makefile
+++ b/Makefile
@@ -120,6 +120,7 @@ install: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_install)
 import: $(MKDEP) context
 	$(Q) $(MAKE) depend TOPDIR="$(APPDIR)$(DELIM)import"
 	$(Q) $(MAKE) .import TOPDIR="$(APPDIR)$(DELIM)import"
+	$(Q) $(MAKE) -C import install TOPDIR="$(APPDIR)$(DELIM)import"
 
 endif # CONFIG_BUILD_KERNEL
 
diff --git a/import/Make.defs b/import/Make.defs
index 3f99b32..41833fa 100644
--- a/import/Make.defs
+++ b/import/Make.defs
@@ -77,7 +77,7 @@ ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
   LDLIBPATH = -L "${shell cygpath -w $(APPDIR)}" -L "${shell cygpath -w $(TOPDIR)$(DELIM)libs}"
 else
   # Linux/Cygwin-native toolchain
-  LDLIBPATH = -L $(APPDIR) -L $(TOPDIR)$(DELIM)libs
+  LDLIBPATH = -L $(TOPDIR)$(DELIM)libs
 endif
 
 # Try to get the path to libgcc.a.  Of course, this only works for GCC
diff --git a/import/Makefile b/import/Makefile
index 63eb4be..d2b18ac 100644
--- a/import/Makefile
+++ b/import/Makefile
@@ -43,7 +43,17 @@ FILES   = .config System.map User.map
 all:
 .PHONY: context depend clean distclean
 
-install:
+APPDIR = $(realpath $(CURDIR)$(DELIM)..)
+HEAD_OBJ += $(wildcard $(TOPDIR)$(DELIM)startup$(DELIM)*$(OBJEXT))
+HEAD_OBJ += $(wildcard $(APPDIR)$(DELIM)builtin$(DELIM)*$(OBJEXT))
+
+$(APPDIR)$(DELIM)nuttx$(EXEEXT): $(wildcard $(APPDIR)$(DELIM)*$(LIBEXT))
+	$(Q) echo "LD: nuttx"
+	$(Q) $(LD) --entry=__start $(LDFLAGS) -T$(LDSCRIPT) $(LIBPATHS) \
+	  $(LDLIBPATH) -L$(CURDIR)$(DELIM)scripts -o $@ $(HEAD_OBJ) \
+	  $(EXTRA_OBJS) $(LDSTARTGROUP) $^ $(LDLIBS) $(EXTRA_LIBS) $(LDENDGROUP)
+
+install: $(APPDIR)$(DELIM)nuttx$(EXEEXT)
 
 context: