summaryrefslogtreecommitdiff
path: root/nuttx/tools
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-08-25 17:55:32 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-08-25 17:55:32 +0000
commit86b851ab95791119e6d26dadb745ec15cb2a5a57 (patch)
treeca700a57c9fcd5a3cfd1ce160f8879db7bea201e /nuttx/tools
parent0b0bd436389e01d8a6ba6a3e27e0126141b8bb27 (diff)
downloadpx4-nuttx-86b851ab95791119e6d26dadb745ec15cb2a5a57.tar.gz
px4-nuttx-86b851ab95791119e6d26dadb745ec15cb2a5a57.tar.bz2
px4-nuttx-86b851ab95791119e6d26dadb745ec15cb2a5a57.zip
Extend the 'make export' logic to bundle up chip header files as well
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3915 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/tools')
-rwxr-xr-xnuttx/tools/mkexport.sh56
1 files changed, 56 insertions, 0 deletions
diff --git a/nuttx/tools/mkexport.sh b/nuttx/tools/mkexport.sh
index 36255fe46..6148472c6 100755
--- a/nuttx/tools/mkexport.sh
+++ b/nuttx/tools/mkexport.sh
@@ -129,6 +129,7 @@ mkdir "${EXPORTDIR}" || { echo "MK: 'mkdir ${EXPORTDIR}' failed"; exit 1; }
mkdir "${EXPORTDIR}/startup" || { echo "MK: 'mkdir ${EXPORTDIR}/startup' failed"; exit 1; }
mkdir "${EXPORTDIR}/libs" || { echo "MK: 'mkdir ${EXPORTDIR}/libs' failed"; exit 1; }
mkdir "${EXPORTDIR}/build" || { echo "MK: 'mkdir ${EXPORTDIR}/build' failed"; exit 1; }
+mkdir "${EXPORTDIR}/arch" || { echo "MK: 'mkdir ${EXPORTDIR}/arch' failed"; exit 1; }
# Verify that we have a Make.defs file.
@@ -187,6 +188,61 @@ find "${EXPORTDIR}/include" -name .svn | xargs rm -rf
make -C ${ARCHDIR} export_head 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
+# way.
+#
+# First copy any header files in the architecture src/ sub-directory (some
+# architectures keep all of the header files there, some a few, and others
+# none
+
+cp -f "${ARCHDIR}"/*.h "${EXPORTDIR}"/arch/. 2>/dev/null
+
+# Then look a list of possible places where other architecture-specific
+# header files might be found. If those places exist (as directories or
+# as symbolic links to directories, then copy the header files from
+# those directories into the EXPORTDIR
+
+ARCH_HDRDIRS="common chip arm armv7-m avr avr32 mips32"
+for hdir in $ARCH_HDRDIRS; do
+
+ # Does the directory (or symbolic link) exist?
+
+ if [ -d "${ARCHDIR}/${hdir}" -o -h "${ARCHDIR}/${hdir}" ]; then
+
+ # Yes.. create a export sub-directory of the same name
+
+ mkdir "${EXPORTDIR}/arch/${hdir}" || \
+ { echo "MK: 'mkdir ${EXPORTDIR}/arch/${hdir}' failed"; exit 1; }
+
+ # Then copy the header files (only) into the new directory
+
+ cp -f "${ARCHDIR}"/${hdir}/*.h "${EXPORTDIR}"/arch/${hdir}/. 2>/dev/null
+
+ # One architecture has low directory called "chip" that holds the
+ # header files
+
+ if [ -d "${ARCHDIR}/${hdir}/chip" ]; then
+
+ # Yes.. create a export sub-directory of the same name
+
+ mkdir "${EXPORTDIR}/arch/${hdir}/chip" || \
+ { echo "MK: 'mkdir ${EXPORTDIR}/arch/${hdir}/chip' failed"; exit 1; }
+
+ # Then copy the header files (only) into the new directory
+
+ cp -f "${ARCHDIR}"/${hdir}/chip/*.h "${EXPORTDIR}"/arch/${hdir}/chip/. 2>/dev/null
+ fi
+ fi
+done
+
+# Copy OS internal header files as well. They are used by some architecture-
+# specific header files.
+
+mkdir "${EXPORTDIR}/arch/os" || \
+ { echo "MK: 'mkdir ${EXPORTDIR}/arch/${hdir}/chip' failed"; exit 1; }
+cp -f "${TOPDIR}"/sched/*.h "${EXPORTDIR}"/arch/os/. 2>/dev/null
+
# Add the board library to the list of libraries
if [ -f "${ARCHDIR}/board/libboard${LIBEXT}" ]; then