-case "$opt_env" in
- desktop)
- . _export_desktop.sh
- cat <<EOF > coverage.mk
-LDFLAGS += --coverage
-EOF
- ;;
- scratchbox)
- . _export_env.sh
- cat <<EOF > coverage.mk
-LDFLAGS +=
-EOF
- ;;
- sbs)
- . _export_sbs.sh
- cat <<EOF > coverage.mk
-LDFLAGS +=
-EOF
- ;;
-esac
-
-
-echo PATH=$PATH
-echo LD_LIBRARY_PATH=$LD_LIBRARY_PATH
-echo TET_ROOT=$TET_ROOT
-echo TET_SUITE_ROOT=$TET_SUITE_ROOT
-echo ARCH=$ARCH
-
-RESULT_DIR=results-$ARCH
-HTML_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.html
-JOURNAL_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.journal
-
-# Faster cleanup.
-find . -name Makefile -execdir make -f {} clean \;
-
-mkdir -p $RESULT_DIR
-if [ $opt_verbose -eq 1 ] ; then
- tcc -b -j - ./ $scenario | tee $JOURNAL_RESULT
+function build
+{
+ if [ $opt_generate == true -o $opt_rebuild == false ] ; then
+ (cd src/$1; ../../scripts/tcheadgen.sh tct-$1-core.h)
+ if [ $? -ne 0 ]; then echo "Aborting..."; exit 1; fi
+ fi
+ (cd build ; cmake .. -DMODULE=$1 ; make -j7 )
+}
+
+if [ -n "$1" ] ; then
+ echo BUILDING ONLY $1
+ build $1