heptagon/examples/MissionComputer_for_Core/build

67 lines
1.5 KiB
Plaintext
Raw Normal View History

2011-09-06 14:30:30 +02:00
#!/bin/bash
2011-09-09 17:05:02 +02:00
HEPTC=../../heptc
HEPTC_OPTIONS=""
2011-09-05 16:03:39 +02:00
2011-09-06 14:30:30 +02:00
GCC=gcc
2011-09-07 13:24:08 +02:00
GCC_OPTIONS="-g -O2 -std=c99 -I ../../../lib/c"
2011-09-06 14:30:30 +02:00
2011-09-05 16:03:39 +02:00
VERBOSE=1
interfaces=(typeBase.epi typeTracks.epi typeArray.epi cstArrayInit.epi cstBaseInit.epi cstPhysics.epi cstTracksInit.epi mc_TypeInputs.epi mc_TypeLists.epi mc_TypeSensors.epi)
ext_libs=(mc_ext.epi mathext.epi)
sources=(math.ept trackslib.ept digital.ept mc.ept dv.ept verif.ept debug.ept)
exit_if_failed() {
if [ $? != 0 ]; then
exit $?
fi
}
2011-09-05 16:03:39 +02:00
for f in ${interfaces[@]}; do
if [ $VERBOSE ] ; then
echo "**** Compiling interface: $f *******"
fi
2011-09-06 14:30:30 +02:00
$HEPTC $HEPTC_OPTIONS -target c $f
exit_if_failed
2011-09-05 16:03:39 +02:00
done
for f in ${ext_libs[@]}; do
if [ $VERBOSE ] ; then
echo "**** Compiling external lib: $f *******"
fi
2011-09-06 14:30:30 +02:00
$HEPTC $HEPTC_OPTIONS $f
exit_if_failed
2011-09-05 16:03:39 +02:00
done
for f in ${sources[@]}; do
if [ $VERBOSE ] ; then
echo "**** Compiling source file: $f *******"
fi
2011-09-06 14:30:30 +02:00
$HEPTC $HEPTC_OPTIONS -target c $f
exit_if_failed
2011-09-06 14:30:30 +02:00
done
2011-09-06 15:01:33 +02:00
#$HEPTC $HEPTC_OPTIONS -target c -s dv_fighterdebug debug.ept
2011-09-06 14:30:30 +02:00
source_dirs=(debug_c dv_c digital_c math_c mc_c trackslib_c verif_c typeBase_c typeTracks_c typeArray_c cstArrayInit_c cstBaseInit_c cstPhysics_c cstTracksInit_c mc_TypeInputs_c mc_TypeLists_c mc_TypeSensors_c)
2011-09-06 15:01:33 +02:00
other_files=(mathext.c mathext.h mc_ext.c mc_ext.h main.c)
2011-09-06 14:30:30 +02:00
if [ -d _build ]; then
rm -r _build
fi
mkdir _build
cd _build
for f in ${source_dirs[@]}; do
cp ../$f/* .
2011-09-05 16:03:39 +02:00
done
2011-09-06 14:30:30 +02:00
for f in ${other_files[@]}; do
cp ../$f .
done
2011-09-06 15:01:33 +02:00
$GCC $GCC_OPTIONS *.c -o mission_control
exit_if_failed
2011-09-06 15:01:33 +02:00
cp mission_control ..
2011-09-06 14:30:30 +02:00
cd ..