From 237602b9903d51a9b3de50e5ff9fed0289118be4 Mon Sep 17 00:00:00 2001 From: Michael Wagner Date: Wed, 7 Sep 2022 16:06:07 +0200 Subject: [PATCH] gitarre --- debian/mbuild.conf | 2 +- tools/make/configure | 31 +++++++++++++++++++-------- tools/make/mMakefile | 2 +- tools/make/mconfigure | 49 ++++++++++++++++++++++++++++++++++++------- 4 files changed, 66 insertions(+), 18 deletions(-) diff --git a/debian/mbuild.conf b/debian/mbuild.conf index af95b98..ecd5950 100644 --- a/debian/mbuild.conf +++ b/debian/mbuild.conf @@ -1,6 +1,6 @@ # mbuild configuration file -# type of compile. Possible values: NONE, CPP, CMAKE, PDF +# type of compile. Possible values: NONE, CPP, CMAKE, PDF, OLD (for downward compatibility) compile_type=NONE # compile target compile_target= diff --git a/tools/make/configure b/tools/make/configure index 2382c1d..f83750e 100755 --- a/tools/make/configure +++ b/tools/make/configure @@ -14,6 +14,18 @@ function echo_usage { echo " -V : version set by project" } +function create_build { + pushd $BUILD_DIR >/dev/null + if [ "$compile_type" == "PDF" ] + then + 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 @@ -316,7 +328,7 @@ else fi # .build - if [ "$compile_type" != "CMAKE" ] + if [ "$compile_type" != "CMAKE" -a "$compile_type" != "OLD" ] then cp debian/rules.pre $BUILD_DIR/$compile_dir/make.pre pushd $BUILD_DIR/$compile_dir >/dev/null @@ -333,15 +345,16 @@ else popd >/dev/null fi - if [ -x debian/$paket.build ] + if [ -x debian/$paket.prebuild ] 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 >/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 diff --git a/tools/make/mMakefile b/tools/make/mMakefile index db7fa6c..de84bb8 100644 --- a/tools/make/mMakefile +++ b/tools/make/mMakefile @@ -35,5 +35,5 @@ clean: #----------------------------------------------------------------- %.pdf : %.tex $(SOURCES) pdflatex $< && pdflatex $< - #cp $*.pdf ~/build + cp $*.pdf ~/build diff --git a/tools/make/mconfigure b/tools/make/mconfigure index dda9b97..4f0410a 100755 --- a/tools/make/mconfigure +++ b/tools/make/mconfigure @@ -6,6 +6,31 @@ function echo_usage { ./configure -I } +function create_conf { + if [ -f "debian/$paket.cmake" ] + then + echo "compile_type=CMAKE" > debian/$paket.conf + elif [ -f "debian/$paket.build" ] + then + if [ -f "debian/$paket.cpp" ] + then + echo "compile_type=CPP" > debian/$paket.conf + else + echo "compile_type=OLD" > debian/$paket.conf + fi + else + echo "compile_type=NONE" > debian/$paket.conf + fi + + if [ -f "$paket.control" -a -f "$paket.cp" ] + then + echo "target_type=DEB" >> debian/$paket.conf + else + echo "target_type=FILE" >> debian/$paket.conf + fi + echo "$paket.conf created." +} + ############################################################################## # Main program ############################################################################## @@ -49,9 +74,16 @@ fi if [ ! -f debian/$paket.conf ] then + # check if any files for $paket are present + if ! ls debian/$paket.* 2>/dev/null + then + echo "$paket is no build target in this repository." + exit 5 + fi + + # build conf file echo "$paket.conf missing. We create it ..." - echo "to be implemented ..." - exit 5 + create_conf fi if [ ! -e configure ] @@ -67,6 +99,7 @@ then rm -rf ~/build mkdir ~/build fi + configure_args="$configure_args -b" fi # perform configure @@ -144,13 +177,15 @@ then elif [ "$target_type" == "FILE" ] then echo "PACK=version" >> debian/rules.pre - if [ -z "$compile_target" ] + if [ "$compile_type" != "OLD" ] then - echo "compile_target is needed for target_type FILE" - exit 12 + if [ -z "$compile_target" ] + then + echo "compile_target is needed for target_type FILE" + exit 12 + fi + echo "TARGET = $compile_target" >> debian/rules.pre fi - echo "TARGET = $compile_target" >> debian/rules.pre - else echo "Unknown target type: $target_type" exit 13 -- 2.20.1