posaune
[projects.git] / tools / make / mconfigure
index 4f0410a..e091ca6 100755 (executable)
@@ -16,7 +16,7 @@ function create_conf {
                then
                        echo "compile_type=CPP" > debian/$paket.conf
                else
-                       echo "compile_type=OLD" > debian/$paket.conf
+                       echo "compile_type=ANY" > debian/$paket.conf
                fi
        else
                echo "compile_type=NONE" > debian/$paket.conf
@@ -99,19 +99,23 @@ then
                rm -rf ~/build
                mkdir ~/build
        fi
-       configure_args="$configure_args -b"
+       configure_args="$configure_args -d ~/build"
 fi
 
 # perform configure
 . debian/$paket.conf
-if [ -n "$compile_dir" ]
-then
-       configure_args="$configure_args -b $compile_dir"
-fi
-if [ -z "$compile_type" ]
+if [ "$compile_type" != "NONE" ]
 then
-       echo "compile_type required in $paket.conf"
-       exit 51
+       configure_args="$configure_args -b"
+       if [ -n "$compile_dir" ]
+       then
+               configure_args="$configure_args -d $compile_dir"
+       fi
+       if [ -z "$compile_type" ]
+       then
+               echo "compile_type required in $paket.conf"
+               exit 51
+       fi
 fi
 if [ "$target_type" == "FILE" ]
 then
@@ -177,14 +181,20 @@ then
 elif [ "$target_type" == "FILE" ]
 then
        echo "PACK=version" >> debian/rules.pre
-       if [ "$compile_type" != "OLD" ]
+       if [ "$compile_type" != "ANY" ]
        then
                if [ -z "$compile_target" ]
                then
                        echo "compile_target is needed for target_type FILE"
                        exit 12
                fi
-               echo "TARGET = $compile_target" >> debian/rules.pre
+               echo "COMPILE_TARGET = $compile_target" >> debian/rules.pre
+               if [ -n "$target_name" ]
+               then
+                       echo "TARGET = $target_name" >> debian/rules.pre
+               else
+                       echo "TARGET = $paket" >> debian/rules.pre
+               fi
        fi
 else
        echo "Unknown target type: $target_type"