From 5e39091321b3fd227cfd73272858b208b9c1164c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Pasteur?= Date: Tue, 4 Oct 2011 11:30:09 +0200 Subject: [PATCH] Some work on the build script for examples --- examples/MC_inlined/build | 2 +- examples/MC_memalloc/build | 2 +- examples/MissionComputer_for_Core/build | 14 ++++++++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/examples/MC_inlined/build b/examples/MC_inlined/build index 90bac3d..500ab3e 100755 --- a/examples/MC_inlined/build +++ b/examples/MC_inlined/build @@ -1,6 +1,6 @@ #!/bin/bash HEPTC=../../heptc -HEPTC_OPTIONS="" +HEPTC_OPTIONS="-tomato" GCC=gcc GCC_OPTIONS="-g -O2 -std=c99 -I ../../../lib/c" diff --git a/examples/MC_memalloc/build b/examples/MC_memalloc/build index 6c775b7..950d604 100755 --- a/examples/MC_memalloc/build +++ b/examples/MC_memalloc/build @@ -9,7 +9,7 @@ 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) +sources=(math.ept trackslib.ept digital.ept mc.ept verif.ept dv.ept debug.ept) exit_if_failed() { if [ $? != 0 ]; then diff --git a/examples/MissionComputer_for_Core/build b/examples/MissionComputer_for_Core/build index fd96f1b..b1889bc 100755 --- a/examples/MissionComputer_for_Core/build +++ b/examples/MissionComputer_for_Core/build @@ -1,6 +1,6 @@ #!/bin/bash HEPTC=../../heptc -HEPTC_OPTIONS=-memalloc +HEPTC_OPTIONS="" GCC=gcc GCC_OPTIONS="-g -O2 -std=c99 -I ../../../lib/c" @@ -11,11 +11,18 @@ interfaces=(typeBase.epi typeTracks.epi typeArray.epi cstArrayInit.epi cstBaseIn 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 +} + for f in ${interfaces[@]}; do if [ $VERBOSE ] ; then echo "**** Compiling interface: $f *******" fi $HEPTC $HEPTC_OPTIONS -target c $f + exit_if_failed done for f in ${ext_libs[@]}; do @@ -23,6 +30,7 @@ for f in ${ext_libs[@]}; do echo "**** Compiling external lib: $f *******" fi $HEPTC $HEPTC_OPTIONS $f + exit_if_failed done for f in ${sources[@]}; do @@ -30,6 +38,7 @@ for f in ${sources[@]}; do echo "**** Compiling source file: $f *******" fi $HEPTC $HEPTC_OPTIONS -target c $f + exit_if_failed done #$HEPTC $HEPTC_OPTIONS -target c -s dv_fighterdebug debug.ept @@ -50,7 +59,8 @@ for f in ${other_files[@]}; do done $GCC $GCC_OPTIONS *.c -o mission_control +exit_if_failed cp mission_control .. -cd .. \ No newline at end of file +cd ..