gitarre
authorMichael Wagner <michael@wagnertech.de>
Wed, 7 Sep 2022 14:06:07 +0000 (16:06 +0200)
committerMichael Wagner <michael@wagnertech.de>
Wed, 7 Sep 2022 14:06:07 +0000 (16:06 +0200)
debian/mbuild.conf
tools/make/configure
tools/make/mMakefile
tools/make/mconfigure

index af95b98..ecd5950 100644 (file)
@@ -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=
index 2382c1d..f83750e 100755 (executable)
@@ -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
index db7fa6c..de84bb8 100644 (file)
@@ -35,5 +35,5 @@ clean:
 #-----------------------------------------------------------------
 %.pdf : %.tex $(SOURCES)
        pdflatex $< && pdflatex $<
-       #cp $*.pdf ~/build
+       cp $*.pdf ~/build
 
index dda9b97..4f0410a 100755 (executable)
@@ -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