aboutsummaryrefslogtreecommitdiff
path: root/apps/interpreters/ficl/configure.sh
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2012-08-04 15:12:36 -0700
committerpx4dev <px4@purgatory.org>2012-08-04 15:12:36 -0700
commit8a365179eafdf3aea98e60ab9f5882b200d4c759 (patch)
tree4f38d6d4cd80bd0b6e22e2bb534c3f117ce44e56 /apps/interpreters/ficl/configure.sh
downloadpx4-firmware-8a365179eafdf3aea98e60ab9f5882b200d4c759.tar.gz
px4-firmware-8a365179eafdf3aea98e60ab9f5882b200d4c759.tar.bz2
px4-firmware-8a365179eafdf3aea98e60ab9f5882b200d4c759.zip
Fresh import of the PX4 firmware sources.
Diffstat (limited to 'apps/interpreters/ficl/configure.sh')
-rwxr-xr-xapps/interpreters/ficl/configure.sh47
1 files changed, 47 insertions, 0 deletions
diff --git a/apps/interpreters/ficl/configure.sh b/apps/interpreters/ficl/configure.sh
new file mode 100755
index 000000000..cadc1d48a
--- /dev/null
+++ b/apps/interpreters/ficl/configure.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+USAGE="$0 <Ficl-dir>"
+
+FICLDIR=$1
+if [ -z "${FICLDIR}" ]; then
+ echo "Missing command line argument"
+ echo $USAGE
+ exit 1
+fi
+
+if [ ! -d "${FICLDIR}" ]; then
+ echo "Sub-directory ${FICLDIR} does not exist"
+ echo $USAGE
+ exit 1
+fi
+
+if [ ! -r "${FICLDIR}/Makefile" ]; then
+ echo "Readable ${FICLDIR}/Makefile does not exist"
+ echo $USAGE
+ exit 1
+fi
+
+OBJECTS=`grep "^OBJECTS" ${FICLDIR}/Makefile`
+if [ -z "${OBJECTS}" ]; then
+ echo "No OBJECTS found in ${FICLDIR}/Makefile"
+ echo $USAGE
+ exit 1
+fi
+
+OBJLIST=`echo ${OBJECTS} | cut -d'=' -f2 | sed -e "s/unix\.o//g"`
+
+rm -f Make.srcs
+echo "# apps/interpreters/ficl/Make.obs" >> Make.srcs
+echo "# Auto-generated file.. Do not edit" >> Make.srcs
+echo "" >> Make.srcs
+echo "FICL_SUBDIR = ${1}" >> Make.srcs
+echo "FICL_DEPPATH = --dep-path ${1}" >> Make.srcs
+
+unset CSRCS
+for OBJ in ${OBJLIST}; do
+ SRC=`echo ${OBJ} | sed -e "s/\.o/\.c/g"`
+ CSRCS=${CSRCS}" ${SRC}"
+done
+echo "FICL_ASRCS = " >> Make.srcs
+echo "FICL_CXXSRCS = " >> Make.srcs
+echo "FICL_CSRCS = ${CSRCS}" >> Make.srcs