]> git.ipfire.org Git - people/ms/pakfire.git/commitdiff
macros: Make it easier to build in a different directory
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 11 Jan 2023 09:26:29 +0000 (09:26 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 11 Jan 2023 09:26:29 +0000 (09:26 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
macros/build.macro
macros/constants.macro

index cfae9dc25d06694baf506fbc846cf5229f435c2e..36c8fa0308159c071c8cb69dc99f3102b5e31c1b 100644 (file)
@@ -155,7 +155,9 @@ end
 
 # Pre-defined build scripts.
 build
-       configure = [ -x "%{CONFIGURE_SCRIPT}" ] && ./%{CONFIGURE_SCRIPT} %{configure_options}
+       DIR_BUILD = %{DIR_APP}/%{BUILD_DIR}
+
+       configure = [ -x "%{DIR_APP}/%{CONFIGURE_SCRIPT}" ] && %{DIR_APP}/%{CONFIGURE_SCRIPT} %{configure_options}
 
        # These variables are used if you have to add some targets
        # directly to the make command.
@@ -167,6 +169,9 @@ build
                mkdir -p %{DIR_SRC} && cd %{DIR_SRC}
 
                %{prepare}
+
+               # Create the build directory
+               mkdir -pv %{DIR_BUILD}
        end
 
        def prepare
@@ -187,7 +192,7 @@ build
        end
 
        def _build
-               [ -d "%{DIR_APP}" ] && cd %{DIR_APP}
+               [ -d "%{DIR_BUILD}" ] && cd %{DIR_BUILD}
 
                %{build}
        end
@@ -215,7 +220,7 @@ build
        end
 
        def _test
-               [ -d "%{DIR_APP}" ] && cd %{DIR_APP}
+               [ -d "%{DIR_BUILD}" ] && cd %{DIR_BUILD}
 
                %{test}
        end
@@ -224,7 +229,7 @@ build
        end
 
        def _install
-               [ -d "%{DIR_APP}" ] && cd %{DIR_APP}
+               [ -d "%{DIR_BUILD}" ] && cd %{DIR_BUILD}
 
                mkdir -pv %{BUILDROOT}
 
index 0a7dbbd1b02f72c4a2dd94218c36d38db918f9f4..e56d5865f56f383b171270b14b2679d1830f8251 100644 (file)
@@ -1,11 +1,8 @@
 
-BUILDROOT   = %{DIR_BUILD}/%{name}-%{thisver}
-
-DIR_BUILD   = /builddir
 DIR_APP     = %{DIR_SRC}/%{thisapp}
 DIR_DL      = %{BASEDIR}/files
 DIR_PATCHES = %{BASEDIR}/patches
-DIR_SRC     = %{DIR_BUILD}/source
+DIR_SRC     = /build/source
 DIR_TMP     = /tmp
 DIR_SOURCE  = %{BASEDIR}