#!/bin/bash
-TEMP=`getopt -o r --long rebuild \
+TEMP=`getopt -o rn --long rebuild,no-gen \
-n 'genmake' -- "$@"`
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
eval set -- "$TEMP"
opt_rebuild=false
+opt_generate=true
while true ; do
case "$1" in
-r|--rebuild) opt_rebuild=true ; shift ;;
+ -n|--no-gen) opt_generate=false ; shift ;;
--) shift ; break ;;
*) shift ;; # Ignore
esac
function build
{
- (cd build ; cmake .. -DMODULE=$1 ; make -j7 )
+ 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
+ BUILDSYSTEM="Unix Makefiles"
+ BUILDCMD=make
+ if [ -e ../build/tizen/build.ninja ] ; then
+ BUILDSYSTEM="Ninja"
+ BUILDCMD=ninja
+ fi
+ (cd build ; cmake .. -DMODULE=$1 -G "$BUILDSYSTEM" ; $BUILDCMD -j7 )
}
if [ -n "$1" ] ; then