copied everything over from 2012 and removed all of the actual robot code except the drivetrain stuff
git-svn-id: https://robotics.mvla.net/svn/frc971/2013/trunk/src@4078 f308d9b7-e957-4cde-b6ac-9a88185e7312
diff --git a/aos/build/crio_link_out b/aos/build/crio_link_out
new file mode 100755
index 0000000..eef549b
--- /dev/null
+++ b/aos/build/crio_link_out
@@ -0,0 +1,26 @@
+#!/bin/bash -e
+
+# This is a helper script that compiles .out files for the cRIO. It is designed
+# to be called as a replacement for g++ being used as a linker.
+
+# All the flags except -shared.
+INPUTS_FLAGS=`echo "$@" | sed 's/-shared//g'`
+# The arguments after any -o flags.
+OUTPUT=`echo ${INPUTS_FLAGS} | awk \
+ 'BEGIN { RS=" " }; output { print ; output = 0 }; /-o/ { output = 1 }'`
+# All arguments that don't start with a - and aren't ${OUTPUT}.
+#INPUTS=`echo ${INPUTS_FLAGS} | sed "s:-[^ ]*::g; s:${OUTPUT}::g;"`
+INPUTS=`echo ${INPUTS_FLAGS} | awk \
+ 'BEGIN { RS=" " }; /-Wl,--no-whole-archive/ { output = 0 }; \
+ output { print }; \
+ /-Wl,--whole-archive/ { output = 1 }'`
+TEMPDIR=`dirname ${OUTPUT}`
+AOS=`dirname $0`/..
+powerpc-wrs-vxworks-nm ${INPUTS} | \
+ tclsh ${WIND_BASE}/host/resource/hutils/tcl/munch.tcl -c ppc > ${TEMPDIR}/ctdt.c
+powerpc-wrs-vxworks-gcc -I${AOS}/.. -c ${TEMPDIR}/ctdt.c -o ${TEMPDIR}/ctdt.o
+powerpc-wrs-vxworks-nm ${INPUTS} | \
+ ${AOS}/build/create_aos_ctdt.sh > ${TEMPDIR}/aos_ctdt.c
+powerpc-wrs-vxworks-gcc -I${AOS}/.. -c ${TEMPDIR}/aos_ctdt.c -o ${TEMPDIR}/aos_ctdt.o
+powerpc-wrs-vxworks-g++ ${INPUTS_FLAGS} ${TEMPDIR}/ctdt.o ${TEMPDIR}/aos_ctdt.o
+ln -f ${OUTPUT} `echo ${OUTPUT} | sed 's/lib\([A-Za-z0-9_]*\)\.so$/\1.out/'`