X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/projects.git/blobdiff_plain/0b8ae20fd3339cdb7b02aa37ec295cb0ceca6380..dcad31e1921b598a7caa7cc7dab5a8145aa22765:/tools/make/configure diff --git a/tools/make/configure b/tools/make/configure index 2382c1d..acf16cb 100755 --- a/tools/make/configure +++ b/tools/make/configure @@ -3,17 +3,35 @@ set -e function echo_usage { echo "usage: configure [options] " - echo " -a " - echo " -b : extern build in ../build directory" - echo " -c " - echo " -C " - echo " -i : install dir. default: /" - echo " -I : print this info" - echo " -t default: NONE" - echo " -v : set version" - echo " -V : version set by project" + echo "--- general options ---" + echo " -h : print this info" + echo "--- compile options ---" + echo " -a " + echo " -c default: NONE" + echo " -C " + echo " -d " + echo " -e " + echo "--- build target options ---" + echo " -i : install dir. default: /, nec. for make install" + echo " -n : default: " + echo " -t , nec. for make pack" + echo " -v : set version" + echo " -V : version set by project" } +function create_build { + pushd $BUILD_DIR >/dev/null + if [ "$compile_type" == "PDF" ] + then + echo "cd $compile_dir" > debian/$paket.build + echo "make $compile_target" >> debian/$paket.build + chmod 755 debian/$paket.build + else + echo "build for compile_type not implemented." + exit 10 + fi + popd >/dev/null +} function cmake_check { pushd ../build >/dev/null # do checks @@ -126,6 +144,23 @@ function check_version { fi } +function add_sources { + echo "Anz: $#" + for suf in $* + do + find . -name "*.$suf" -exec echo " "{}" \\" >> make.pre \; + done + if [ $# -eq 2 ] + then + rm make.tmp || true + find . -name "*.$2" -exec echo {} >> make.tmp \; + while read line + do + echo " ${line/\.$2/\.$1} \\" >> make.pre + done < make.tmp + fi +} + ############################################################################## # Main program ############################################################################## @@ -136,23 +171,29 @@ extern_build=0 while [ $OPTIND -le "$#" ] do - if getopts "a:bB:C:i:It:v:V" opt + if getopts "ha:bc:C:d:e:i:n:t:v:V" opt then case $opt in + h) echo_usage + exit 0 + ;; a) ARCH=$OPTARG ;; b) extern_build=1 ;; - c) compile_dir=$OPTARG + c) compile_type=$OPTARG ;; C) cross=$OPTARG ;; + d) compile_dir=$OPTARG + ;; + d) compile_target=$OPTARG + ;; i) install_dir=$OPTARG ;; - I) echo_usage - exit 0 + n) target_name=$OPTARG ;; - t) compile_type=$OPTARG + t) target_type=$OPTARG ;; v) optversion=$OPTARG ;; @@ -316,32 +357,40 @@ else fi # .build - if [ "$compile_type" != "CMAKE" ] + if [ "$compile_type" != "CMAKE" -a "$compile_type" != "ANY" ] then cp debian/rules.pre $BUILD_DIR/$compile_dir/make.pre pushd $BUILD_DIR/$compile_dir >/dev/null ln -sf /usr/share/mbuild/makefile . - if [ -n "$sources_suffix" ] - then - echo "SOURCES = \\" >> make.pre - for suf in $sources_suffix - do - find . -name "*.$suf" -exec echo " "{}" \\" >> make.pre \; - done - echo >> make.pre +# if [ -n "$sources_suffix" ] +# then +# echo "SOURCES = \\" >> make.pre +# for suf in $sources_suffix +# do +# find . -name "*.$suf" -exec echo " "{}" \\" >> make.pre \; +# done +# echo >> make.pre fi popd >/dev/null fi - - if [ -x debian/$paket.build ] + + if [ "$compile_type" == "PDF" ] then - if [ -x debian/$paket.prebuild ] - then - pushd $BUILD_DIR >/dev/null - . debian/setenv.sh - debian/$paket.prebuild - popd >/dev/null - fi + pushd $BUILD_DIR/$compile_dir >/dev/null + echo "SOURCES = \\" >> make.pre + add_sources tex xml + echo >> make.pre + popd >/dev/null + if [ -x debian/$paket.prebuild ] + then + pushd $BUILD_DIR >/dev/null + . debian/setenv.sh + debian/$paket.prebuild + popd >/dev/null + fi + if ! [ -x debian/$paket.build -o -f debian/$paket.cmake ] + then + create_build fi # .cmake