summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-09-04 13:31:34 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-09-04 13:31:34 -0600
commit23d6f51d4032133ed41ae5ccff887242d21a7609 (patch)
tree25fe79622978f206de14fa9559399c3925e64581
parentb4ddd5c4d15cdb22e036721ff513e93c01b6f619 (diff)
downloadnuttx-23d6f51d4032133ed41ae5ccff887242d21a7609.tar.gz
nuttx-23d6f51d4032133ed41ae5ccff887242d21a7609.tar.bz2
nuttx-23d6f51d4032133ed41ae5ccff887242d21a7609.zip
The 'make export' target needs to bundle up the user C startup file (crt0), not the kernel head object
-rw-r--r--nuttx/arch/arm/src/Makefile9
-rw-r--r--nuttx/arch/arm/src/a1x/Make.defs4
-rw-r--r--nuttx/arch/arm/src/armv7-a/crt0.c10
-rw-r--r--nuttx/arch/arm/src/sama5/Make.defs4
-rw-r--r--nuttx/arch/avr/src/Makefile7
-rw-r--r--nuttx/arch/hc/src/Makefile7
-rw-r--r--nuttx/arch/mips/src/Makefile7
-rw-r--r--nuttx/arch/rgmp/src/Makefile4
-rw-r--r--nuttx/arch/sh/src/Makefile7
-rw-r--r--nuttx/arch/sim/src/Makefile4
-rw-r--r--nuttx/arch/x86/src/Makefile7
-rw-r--r--nuttx/arch/z16/src/Makefile9
-rw-r--r--nuttx/arch/z80/src/Makefile.sdccl7
-rw-r--r--nuttx/arch/z80/src/Makefile.sdccw7
-rw-r--r--nuttx/arch/z80/src/Makefile.zdsiil9
-rw-r--r--nuttx/arch/z80/src/Makefile.zdsiiw8
-rwxr-xr-xnuttx/tools/mkexport.sh4
17 files changed, 69 insertions, 45 deletions
diff --git a/nuttx/arch/arm/src/Makefile b/nuttx/arch/arm/src/Makefile
index c4fcb4c6c..70fac87d6 100644
--- a/nuttx/arch/arm/src/Makefile
+++ b/nuttx/arch/arm/src/Makefile
@@ -1,7 +1,7 @@
############################################################################
# arch/arm/src/Makefile
#
-# Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
+# Copyright (C) 2007-2009, 2011-2012, 2014 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@@ -85,6 +85,7 @@ endif
# The "head" object
HEAD_OBJ = $(HEAD_ASRC:.S=$(OBJEXT))
+STARTUP_OBJS ?= $(HEAD_OBJ)
# Flat build or kernel-mode objects
@@ -188,10 +189,10 @@ endif
# Note that there may not be a head object if layout is handled
# by the linker configuration.
-export_head: board/libboard$(LIBEXT) $(HEAD_OBJ)
-ifneq ($(HEAD_OBJ),)
+export_startup: board/libboard$(LIBEXT) $(STARTUP_OBJS)
+ifneq ($(STARTUP_OBJS),)
$(Q) if [ -d "$(EXPORT_DIR)/startup" ]; then \
- cp -f $(HEAD_OBJ) "$(EXPORT_DIR)/startup"; \
+ cp -f $(STARTUP_OBJS) "$(EXPORT_DIR)/startup/."; \
else \
echo "$(EXPORT_DIR)/startup does not exist"; \
exit 1; \
diff --git a/nuttx/arch/arm/src/a1x/Make.defs b/nuttx/arch/arm/src/a1x/Make.defs
index c06e3a6c8..98972d872 100644
--- a/nuttx/arch/arm/src/a1x/Make.defs
+++ b/nuttx/arch/arm/src/a1x/Make.defs
@@ -38,6 +38,10 @@
HEAD_ASRC = arm_vectortab.S
+ifeq ($(CONFIG_BUILD_KERNEL),y)
+STARTUP_OBJS = crt0$(OBJEXT)
+endif
+
# Force the start-up logic to be at the beginning of the .text to simplify
# debug.
diff --git a/nuttx/arch/arm/src/armv7-a/crt0.c b/nuttx/arch/arm/src/armv7-a/crt0.c
index 8b661708e..2127ab2ed 100644
--- a/nuttx/arch/arm/src/armv7-a/crt0.c
+++ b/nuttx/arch/arm/src/armv7-a/crt0.c
@@ -40,6 +40,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
+#include <stdlib.h>
#include <nuttx/addrenv.h>
@@ -57,7 +58,7 @@
* Public Function Prototypes
****************************************************************************/
-extern main_t main;
+int main(int argc, char *argv[]);
/****************************************************************************
* Private Functions
@@ -100,8 +101,9 @@ static void sig_trampoline(void)
" blx ip\n" /* Call the signal handler */
" pop {r2}\n" /* Recover LR in R2 */
" mov lr, r2\n" /* Restore LR */
- " mov r0, #4\n" /* SYS_signal_handler_return
+ " mov r0, #4\n" /* SYS_signal_handler_return */
" svc #0x900001\n" /* Return from the signal handler */
+ );
}
#endif
@@ -138,7 +140,7 @@ void _start(int argc, FAR char *argv[])
* that is visible to the RTOS.
*/
- ADDRENV_DATA_RESERVE->ar_sigtramp = (addrenv_sigtramp_t)sig_trampoline;
+ ARCH_DATA_RESERVE->ar_sigtramp = (addrenv_sigtramp_t)sig_trampoline;
#endif
/* Call C++ constructors */
@@ -147,7 +149,7 @@ void _start(int argc, FAR char *argv[])
/* Call the main() entry point passing argc and argv. */
- ret = main(argc, argc);
+ ret = main(argc, argv);
/* Call exit() if/when the main() returns */
diff --git a/nuttx/arch/arm/src/sama5/Make.defs b/nuttx/arch/arm/src/sama5/Make.defs
index 241bb6a60..c07fcc81a 100644
--- a/nuttx/arch/arm/src/sama5/Make.defs
+++ b/nuttx/arch/arm/src/sama5/Make.defs
@@ -38,6 +38,10 @@
HEAD_ASRC = arm_vectortab.S
+ifeq ($(CONFIG_BUILD_KERNEL),y)
+STARTUP_OBJS = crt0$(OBJEXT)
+endif
+
# Force the start-up logic to be at the beginning of the .text to simplify
# debug.
diff --git a/nuttx/arch/avr/src/Makefile b/nuttx/arch/avr/src/Makefile
index 2220bbfde..a3f288efb 100644
--- a/nuttx/arch/avr/src/Makefile
+++ b/nuttx/arch/avr/src/Makefile
@@ -1,7 +1,7 @@
############################################################################
# arch/avr/src/Makefile
#
-# Copyright (C) 2010-2012 Gregory Nutt. All rights reserved.
+# Copyright (C) 2010-2012, 2014 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@@ -72,6 +72,7 @@ CXXFLAGS += $(INCLUDES)
AFLAGS += $(INCLUDES)
HEAD_OBJ = $(HEAD_ASRC:.S=$(OBJEXT))
+STARTUP_OBJS ?= $(HEAD_OBJ)
ASRCS = $(CHIP_ASRCS) $(CMN_ASRCS)
AOBJS = $(ASRCS:.S=$(OBJEXT))
@@ -147,9 +148,9 @@ endif
# This is part of the top-level export target
-export_head: board/libboard$(LIBEXT) $(HEAD_OBJ)
+export_startup: board/libboard$(LIBEXT) $(STARTUP_OBJS)
$(Q) if [ -d "$(EXPORT_DIR)/startup" ]; then \
- cp -f $(HEAD_OBJ) "$(EXPORT_DIR)/startup"; \
+ cp -f $(STARTUP_OBJS) "$(EXPORT_DIR)/startup"; \
else \
echo "$(EXPORT_DIR)/startup does not exist"; \
exit 1; \
diff --git a/nuttx/arch/hc/src/Makefile b/nuttx/arch/hc/src/Makefile
index d1ce2e205..eaccee174 100644
--- a/nuttx/arch/hc/src/Makefile
+++ b/nuttx/arch/hc/src/Makefile
@@ -1,7 +1,7 @@
############################################################################
# arch/hc/src/Makefile
#
-# Copyright (C) 2009, 2011-2012 Gregory Nutt. All rights reserved.
+# Copyright (C) 2009, 2011-2012, 2014 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@@ -68,6 +68,7 @@ endif
endif
HEAD_OBJ = $(HEAD_ASRC:.S=$(OBJEXT))
+STARTUP_OBJS ?= $(HEAD_OBJ)
ASRCS = $(CHIP_ASRCS) $(CMN_ASRCS)
AOBJS = $(ASRCS:.S=$(OBJEXT))
@@ -142,9 +143,9 @@ endif
# This is part of the top-level export target
-export_head: board/libboard$(LIBEXT) $(HEAD_OBJ)
+export_startup: board/libboard$(LIBEXT) $(STARTUP_OBJS)
$(Q) if [ -d "$(EXPORT_DIR)/startup" ]; then \
- cp -f $(HEAD_OBJ) "$(EXPORT_DIR)/startup"; \
+ cp -f $(STARTUP_OBJS) "$(EXPORT_DIR)/startup"; \
else \
echo "$(EXPORT_DIR)/startup does not exist"; \
exit 1; \
diff --git a/nuttx/arch/mips/src/Makefile b/nuttx/arch/mips/src/Makefile
index 906bac59f..aeb3238a0 100644
--- a/nuttx/arch/mips/src/Makefile
+++ b/nuttx/arch/mips/src/Makefile
@@ -1,7 +1,7 @@
############################################################################
# arch/mips/src/Makefile
#
-# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
+# Copyright (C) 2011-2012, 2014 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@@ -65,6 +65,7 @@ endif
endif
HEAD_OBJ = $(HEAD_ASRC:.S=$(OBJEXT))
+STARTUP_OBJS ?= $(HEAD_OBJ)
ASRCS = $(CHIP_ASRCS) $(CMN_ASRCS)
AOBJS = $(ASRCS:.S=$(OBJEXT))
@@ -140,9 +141,9 @@ endif
# This is part of the top-level export target
-export_head: board/libboard$(LIBEXT) $(HEAD_OBJ)
+export_startup: board/libboard$(LIBEXT) $(STARTUP_OBJS)
$(Q) if [ -d "$(EXPORT_DIR)/startup" ]; then \
- cp -f $(HEAD_OBJ) "$(EXPORT_DIR)/startup"; \
+ cp -f $(STARTUP_OBJS) "$(EXPORT_DIR)/startup"; \
else \
echo "$(EXPORT_DIR)/startup does not exist"; \
exit 1; \
diff --git a/nuttx/arch/rgmp/src/Makefile b/nuttx/arch/rgmp/src/Makefile
index 05ef21fea..09fb372f4 100644
--- a/nuttx/arch/rgmp/src/Makefile
+++ b/nuttx/arch/rgmp/src/Makefile
@@ -1,7 +1,7 @@
############################################################################
# arch/rgmp/src/Makefile
#
-# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
+# Copyright (C) 2011-2012, 2014 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@@ -85,7 +85,7 @@ nuttx$(EXEEXT): $(LINKOBJS)
# This is part of the top-level export target
-export_head:
+expport_startup:
# Dependencies
diff --git a/nuttx/arch/sh/src/Makefile b/nuttx/arch/sh/src/Makefile
index e8be489cd..280b843a1 100644
--- a/nuttx/arch/sh/src/Makefile
+++ b/nuttx/arch/sh/src/Makefile
@@ -1,7 +1,7 @@
############################################################################
# arch/sh/src/Makefile
#
-# Copyright (C) 2008, 2011-2012 Gregory Nutt. All rights reserved.
+# Copyright (C) 2008, 2011-2012, 2014 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@@ -63,6 +63,7 @@ endif
CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(TOPDIR)/sched
HEAD_OBJ = $(HEAD_ASRC:.S=$(OBJEXT))
+STARTUP_OBJS ?= $(HEAD_OBJ)
ASRCS = $(CHIP_ASRCS) $(CMN_ASRCS)
AOBJS = $(ASRCS:.S=$(OBJEXT))
@@ -138,9 +139,9 @@ endif
# This is part of the top-level export target
-export_head: board/libboard$(LIBEXT) $(HEAD_OBJ)
+export_startup: board/libboard$(LIBEXT) $(STARTUP_OBJS)
$(Q) if [ -d "$(EXPORT_DIR)/startup" ]; then \
- cp -f $(HEAD_OBJ) "$(EXPORT_DIR)/startup"; \
+ cp -f $(STARTUP_OBJS) "$(EXPORT_DIR)/startup"; \
else \
echo "$(EXPORT_DIR)/startup does not exist"; \
exit 1; \
diff --git a/nuttx/arch/sim/src/Makefile b/nuttx/arch/sim/src/Makefile
index bb44ab705..8bbf67a8f 100644
--- a/nuttx/arch/sim/src/Makefile
+++ b/nuttx/arch/sim/src/Makefile
@@ -145,7 +145,7 @@ RELLIBS += -lboard
all: up_head$(OBJEXT) libarch$(LIBEXT)
-.PHONY: board/libboard$(LIBEXT) export_head clean distclean cleanrel depend
+.PHONY: board/libboard$(LIBEXT) export_startup clean distclean cleanrel depend
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
@@ -199,7 +199,7 @@ nuttx$(EXEEXT): cleanrel nuttx.rel $(HOSTOBJS)
# This is part of the top-level export target
-export_head: board/libboard$(LIBEXT) up_head.o $(HOSTOBJS)
+export_startup: board/libboard$(LIBEXT) up_head.o $(HOSTOBJS)
cp up_head.o $(HOSTOBJS) ${EXPORT_DIR}/startup
cp nuttx-names.dat ${EXPORT_DIR}/libs
echo main NXmain >> ${EXPORT_DIR}/libs/nuttx-names.dat
diff --git a/nuttx/arch/x86/src/Makefile b/nuttx/arch/x86/src/Makefile
index 2539c0f11..0de6b7c08 100644
--- a/nuttx/arch/x86/src/Makefile
+++ b/nuttx/arch/x86/src/Makefile
@@ -1,7 +1,7 @@
############################################################################
# arch/x86/src/Makefile
#
-# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
+# Copyright (C) 2011-2012, 2014 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@@ -65,6 +65,7 @@ endif
endif
HEAD_OBJ = $(HEAD_ASRC:.S=$(OBJEXT))
+STARTUP_OBJS ?= $(HEAD_OBJ)
ASRCS = $(CHIP_ASRCS) $(CMN_ASRCS)
AOBJS = $(ASRCS:.S=$(OBJEXT))
@@ -148,9 +149,9 @@ endif
# This is part of the top-level export target
-export_head: board/libboard$(LIBEXT) $(HEAD_OBJ)
+export_startup: board/libboard$(LIBEXT) $(STARTUP_OBJS)
$(Q) if [ -d "$(EXPORT_DIR)/startup" ]; then \
- cp -f $(HEAD_OBJ) "$(EXPORT_DIR)/startup"; \
+ cp -f $(STARTUP_OBJS) "$(EXPORT_DIR)/startup"; \
else \
echo "$(EXPORT_DIR)/startup does not exist"; \
exit 1; \
diff --git a/nuttx/arch/z16/src/Makefile b/nuttx/arch/z16/src/Makefile
index 5c0ef42be..02d9c6eb6 100644
--- a/nuttx/arch/z16/src/Makefile
+++ b/nuttx/arch/z16/src/Makefile
@@ -1,7 +1,7 @@
############################################################################
# arch/z16/src/Makefile
#
-# Copyright (C) 2008, 2011-2012 Gregory Nutt. All rights reserved.
+# Copyright (C) 2008, 2011-2012, 2014 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@@ -65,6 +65,7 @@ endif
HEAD_ASRC = $(HEAD_SSRC:.S=$(ASMEXT))
HEAD_OBJ = $(HEAD_SSRC:.S=$(OBJEXT))
+STARTUP_OBJS ?= $(HEAD_OBJ)
SSRCS = $(CHIP_SSRCS) $(CMN_SSRCS)
ASRCS = $(SSRCS:.S=$(ASMEXT))
@@ -145,12 +146,12 @@ endif
# This is part of the top-level export target
-export_head: board/libboard$(LIBEXT) $(HEAD_OBJ)
+export_startup: board/libboard$(LIBEXT) $(STARTUP_OBJS)
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
- $(Q) if exist "$(EXPORT_DIR)$(DELIM)startup" ( copy $(HEAD_OBJ) "$(EXPORT_DIR)$(DELIM)startup$(DELIM)." /b /y)
+ $(Q) if exist "$(EXPORT_DIR)$(DELIM)startup" ( copy $(STARTUP_OBJS) "$(EXPORT_DIR)$(DELIM)startup$(DELIM)." /b /y)
else
$(Q) if [ -d "$(EXPORT_DIR)/startup" ]; then \
- cp -f $(HEAD_OBJ) "$(EXPORT_DIR)/startup"; \
+ cp -f $(STARTUP_OBJS) "$(EXPORT_DIR)/startup"; \
else \
echo "$(EXPORT_DIR)/startup does not exist"; \
exit 1; \
diff --git a/nuttx/arch/z80/src/Makefile.sdccl b/nuttx/arch/z80/src/Makefile.sdccl
index c444690e7..3afd657de 100644
--- a/nuttx/arch/z80/src/Makefile.sdccl
+++ b/nuttx/arch/z80/src/Makefile.sdccl
@@ -1,7 +1,7 @@
############################################################################
# arch/z80/src/Makefile.sdccl
#
-# Copyright (C) 2008, 2011-2012 Gregory Nutt. All rights reserved.
+# Copyright (C) 2008, 2011-2012, 2014 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@@ -43,6 +43,7 @@ CPPFLAGS += -D__ASSEMBLY__
# There should be one head source (.asm file)
HEAD_OBJ = $(HEAD_ASRC:$(ASMEXT)=$(OBJEXT))
+STARTUP_OBJS ?= $(HEAD_OBJ)
# Assembly sources and objects
@@ -181,9 +182,9 @@ endif
# This is part of the top-level export target
-export_head: board/libboard$(LIBEXT) $(HEAD_OBJ)
+export_startup: board/libboard$(LIBEXT) $(STARTUP_OBJS)
$(Q) if [ -d "$(EXPORT_DIR)/startup" ]; then \
- cp -f $(HEAD_OBJ) "$(EXPORT_DIR)/startup"; \
+ cp -f $(STARTUP_OBJS) "$(EXPORT_DIR)/startup"; \
else \
echo "$(EXPORT_DIR)/startup does not exist"; \
exit 1; \
diff --git a/nuttx/arch/z80/src/Makefile.sdccw b/nuttx/arch/z80/src/Makefile.sdccw
index 79e1b002e..ee7948c67 100644
--- a/nuttx/arch/z80/src/Makefile.sdccw
+++ b/nuttx/arch/z80/src/Makefile.sdccw
@@ -1,7 +1,7 @@
############################################################################
# arch/z80/src/Makefile.sdccw
#
-# Copyright (C) 2008, 2011-2012 Gregory Nutt. All rights reserved.
+# Copyright (C) 2008, 2011-2012, 2014 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@@ -43,6 +43,7 @@ CPPFLAGS += -D__ASSEMBLY__
# There should be one head source (.asm file)
HEAD_OBJ = $(HEAD_ASRC:$(ASMEXT)=$(OBJEXT))
+STARTUP_OBJS ?= $(HEAD_OBJ)
# Assembly sources and objects
@@ -179,9 +180,9 @@ endif
# This is part of the top-level export target
-export_head: board\libboard$(LIBEXT) $(HEAD_OBJ)
+export_startup: board\libboard$(LIBEXT) $(STARTUP_OBJS)
$(Q) if not exist board\Makefile ( echo $(EXPORT_DIR)\startup does not exist )
- $(Q) if exist board\Makefile ( cp -f $(HEAD_OBJ) "$(EXPORT_DIR)\startup" )
+ $(Q) if exist board\Makefile ( cp -f $(STARTUP_OBJS) "$(EXPORT_DIR)\startup" )
# Build dependencies
diff --git a/nuttx/arch/z80/src/Makefile.zdsiil b/nuttx/arch/z80/src/Makefile.zdsiil
index 87ada571f..39c4cbe1e 100644
--- a/nuttx/arch/z80/src/Makefile.zdsiil
+++ b/nuttx/arch/z80/src/Makefile.zdsiil
@@ -1,7 +1,7 @@
############################################################################
# arch/z80/src/Makefile.zdsiil
#
-# Copyright (C) 2008, 2011-2012 Gregory Nutt. All rights reserved.
+# Copyright (C) 2008, 2011-2012, 2014 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@@ -51,6 +51,7 @@ LDFLAGS += @nuttx.linkcmd
############################################################################
# Files and directories
+
ifneq ($(HEAD_SSRC),)
HEAD_GENSRC = $(HEAD_SSRC:.S=$(ASMEXT))
HEAD_OBJ = $(HEAD_SSRC:.S=$(OBJEXT))
@@ -58,6 +59,8 @@ else
HEAD_OBJ = $(HEAD_ASRC:$(ASMEXT)=$(OBJEXT))
endif
+STARTUP_OBJS ?= $(HEAD_OBJ)
+
SSRCS = $(CHIP_SSRCS) $(CMN_SSRCS)
ASRCS = $(CHIP_ASRCS) $(CMN_ASRCS)
GENSRCS = $(SSRCS:.S=$(ASMEXT))
@@ -140,9 +143,9 @@ nuttx$(EXEEXT): $(HEAD_OBJ) board$(DELIM)libboard$(LIBEXT) nuttx.linkcmd
# This is part of the top-level export target
-export_head: board$(DELIM)libboard$(LIBEXT) $(HEAD_OBJ)
+export_startup: board$(DELIM)libboard$(LIBEXT) $(STARTUP_OBJS)
$(Q) if [ -d "$(EXPORT_DIR)$(DELIM)startup" ]; then \
- cp -f $(HEAD_OBJ) "$(EXPORT_DIR)$(DELIM)startup"; \
+ cp -f $(STARTUP_OBJS) "$(EXPORT_DIR)$(DELIM)startup"; \
else \
echo "$(EXPORT_DIR)$(DELIM)startup does not exist"; \
exit 1; \
diff --git a/nuttx/arch/z80/src/Makefile.zdsiiw b/nuttx/arch/z80/src/Makefile.zdsiiw
index bf599ecae..25099e8a6 100644
--- a/nuttx/arch/z80/src/Makefile.zdsiiw
+++ b/nuttx/arch/z80/src/Makefile.zdsiiw
@@ -1,7 +1,7 @@
############################################################################
# arch/z80/src/Makefile.zdsiiw
#
-# Copyright (C) 2008, 2011-2012 Gregory Nutt. All rights reserved.
+# Copyright (C) 2008, 2011-2012, 2014 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@@ -55,6 +55,8 @@ else
HEAD_OBJ = $(HEAD_ASRC:$(ASMEXT)=$(OBJEXT))
endif
+STARTUP_OBJS ?= $(HEAD_OBJ)
+
SSRCS = $(CHIP_SSRCS) $(CMN_SSRCS)
ASRCS = $(CHIP_ASRCS) $(CMN_ASRCS)
GENSRCS = $(SSRCS:.S=$(ASMEXT))
@@ -132,8 +134,8 @@ nuttx$(EXEEXT): $(HEAD_OBJ) board$(DELIM)libboard$(LIBEXT) nuttx.linkcmd
# This is part of the top-level export target
-export_head: board$(DELIM)libboard$(LIBEXT) $(HEAD_OBJ)
- $(Q) if exist "$(EXPORT_DIR)$(DELIM)startup" ( copy $(HEAD_OBJ) "$(EXPORT_DIR)$(DELIM)startup$(DELIM)." /b /y)
+export_startup: board$(DELIM)libboard$(LIBEXT) $(STARTUP_OBJS)
+ $(Q) if exist "$(EXPORT_DIR)$(DELIM)startup" ( copy $(STARTUP_OBJS) "$(EXPORT_DIR)$(DELIM)startup$(DELIM)." /b /y)
# Dependencies
diff --git a/nuttx/tools/mkexport.sh b/nuttx/tools/mkexport.sh
index cbdcddc78..6b16e4b07 100755
--- a/nuttx/tools/mkexport.sh
+++ b/nuttx/tools/mkexport.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# tools/mkexport.sh
#
-# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
+# Copyright (C) 2011-2012, 2014 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@@ -194,7 +194,7 @@ cp -LR -p "${TOPDIR}/include" "${EXPORTDIR}/." || \
# Copy the startup object file(s)
-make -C ${ARCHDIR} export_head TOPDIR=${TOPDIR} EXPORT_DIR="${EXPORTDIR}"
+make -C ${ARCHDIR} export_startup TOPDIR=${TOPDIR} EXPORT_DIR="${EXPORTDIR}"
# Copy architecture-specific header files into the arch export sub-directory.
# This is tricky because each architecture does things in a little different