make/import: support install nuttx binary in flat build

Change-Id: Iaffa86ee9ebd77380424e6d4a0777262685c989f
Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
chao.an 2020-06-24 11:14:02 +08:00 committed by Abdelatif Guettouche
parent 10d596cb8e
commit c81a1f9711
3 changed files with 13 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -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: