From 86b851ab95791119e6d26dadb745ec15cb2a5a57 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 25 Aug 2011 17:55:32 +0000 Subject: 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 --- nuttx/ChangeLog | 3 +++ nuttx/tools/mkexport.sh | 56 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) (limited to 'nuttx') diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 85a12ccce..07bbb57f5 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -2027,4 +2027,7 @@ updates to the ADS1255 driver, (2) fix errors from my last merge (sorry), (3) Add DAC infrastructure, (4) add AD5410 DAC driver, and (5) add LPC17xx ADC and DAC drivers. All contributed by Li Zhuoyi (Lzyy). + * tools/mkexport.sh: Extended the script that implements the top-level + 'make export' logic. The script now also finds and bundles up all of + the architecture-specific header files as well. 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 -- cgit v1.2.3