summaryrefslogtreecommitdiff
path: root/nuttx/Makefile
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-04-02 19:04:44 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-04-02 19:04:44 +0000
commitf5d629b65b9588ddae1333f06aa392083c284949 (patch)
tree01e8e16f655b7738037330adbef3120df72bfb3f /nuttx/Makefile
parentc3e496ad6e836db85c8c8fa7118aa9ed8b99ded3 (diff)
downloadpx4-nuttx-f5d629b65b9588ddae1333f06aa392083c284949.tar.gz
px4-nuttx-f5d629b65b9588ddae1333f06aa392083c284949.tar.bz2
px4-nuttx-f5d629b65b9588ddae1333f06aa392083c284949.zip
Add SAM3U kernel build logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3456 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/Makefile')
-rw-r--r--nuttx/Makefile17
1 files changed, 14 insertions, 3 deletions
diff --git a/nuttx/Makefile b/nuttx/Makefile
index 635e3d71d..dea43c109 100644
--- a/nuttx/Makefile
+++ b/nuttx/Makefile
@@ -339,7 +339,9 @@ syscall/libproxies$(LIBEXT): context
# (archive); some modification to this Makefile would be required if
# CONFIG_PASS1_OBJECT is an archive.
-pass1:
+pass1deps: context depend $(USERLIBS)
+
+pass1: pass1deps
ifeq ($(CONFIG_BUILD_2PASS),y)
@if [ -z "$(CONFIG_PASS1_OBJECT)" ]; then \
echo "ERROR: CONFIG_PASS1_OBJECT not defined"; \
@@ -357,10 +359,12 @@ ifeq ($(CONFIG_BUILD_2PASS),y)
echo "ERROR: No Makefile in CONFIG_PASS1_BUILDIR"; \
exit 1; \
fi
- @$(MAKE) -C $(CONFIG_PASS1_BUILDIR) TOPDIR="$(TOPDIR)" LINKLIBS="$(NUTTXLIBS)" "$(ARCH_SRC)/$(CONFIG_PASS1_OBJECT)"
+ @$(MAKE) -C $(CONFIG_PASS1_BUILDIR) TOPDIR="$(TOPDIR)" LINKLIBS="$(NUTTXLIBS)" USERLIBS="$(USERLIBS)" "$(ARCH_SRC)/$(CONFIG_PASS1_OBJECT)"
endif
-$(BIN): context depend $(NUTTXLIBS) $(USERLIBS) pass1
+pass2deps: context depend $(NUTTXLIBS)
+
+pass2: pass2deps
@$(MAKE) -C $(ARCH_SRC) TOPDIR="$(TOPDIR)" EXTRA_OBJS="$(EXTRA_OBJS)" LINKLIBS="$(NUTTXLIBS)" $(BIN)
@if [ -w /tftpboot ] ; then \
cp -f $(TOPDIR)/$@ /tftpboot/$@.${CONFIG_ARCH}; \
@@ -381,6 +385,13 @@ ifeq ($(CONFIG_RAW_BINARY),y)
@$(OBJCOPY) $(OBJCOPYARGS) -O binary $(NUTTX)$(EXEEXT) $(NUTTX)$(EXEEXT).bin
endif
+# In the normal case, all pass1 and pass2 dependencies are created then pass1
+# and pass2 targets are built. However, in some cases, you may need to build
+# pass1 depenencies and pass1 first, then build pass2 dependencies and pass2.
+# in that case, execute 'make pass1 pass2' from the command line.
+
+$(BIN): pass1deps pass2deps pass1 pass2
+
# This is a helper target that will rebuild NuttX and download it to the
# target system in one step. It will generate an error an error if the
# DOWNLOAD command is not defined in platform Make.defs file.