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
This commit is contained in:
patacongo
2011-08-25 17:55:32 +00:00
parent 07292be9c0
commit 310d3f2ab7
2 changed files with 59 additions and 0 deletions
+3
View File
@@ -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.
+56
View File
@@ -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