]> git.ipfire.org Git - people/stevee/pakfire.git/blobdiff - macros/build.macro
macros: Simplify customisation of configure/make/make install
[people/stevee/pakfire.git] / macros / build.macro
index f8e14812ee43a9df6e41c8a9771419360b3184b0..4eedd6a91f728dde7ddb6dfffbcdaee19ab51231 100644 (file)
@@ -145,8 +145,17 @@ build
 
        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.
+       # GNU Make Stuff
+       __make = make -O
+
+       # Default "make" command
+       make_build = %{__make} %{PARALLELISMFLAGS} %{make_build_targets}
+
+       # Default "make install" command
+       make_install = %{__make} DESTDIR=%{BUILDROOT} %{make_install_targets}
+
+       # These variables are used if you have to add some targets directly to the make command
+       # LEGACY: DO NOT USE ANY MORE
        make_build_targets   =
        make_install_targets = install
 
@@ -187,10 +196,11 @@ build
                # Remove any RPATH stuff from locally installed libtool
                %{MACRO_FIX_LIBTOOL}
 
-               # Run custom commands.
+               # Run custom commands
                %{configure_cmds}
 
-               make %{PARALLELISMFLAGS} %{make_build_targets}
+               # Run build
+               %{make_build}
 
                # Run more custom commands.
                %{build_cmds}
@@ -214,6 +224,7 @@ build
        def _install
                [ -d "%{DIR_BUILD}" ] && cd %{DIR_BUILD}
 
+               # Create BUILDROOT
                mkdir -pv %{BUILDROOT}
 
                %{install}
@@ -221,25 +232,17 @@ build
                %{MACRO_INSTALL_FILES}
                %{MACRO_PYTHON_COMPILE}
 
-               # Cleanup perl modules.
+               # Cleanup perl modules
                %{perl_cleanup}
 
                %{install_post}
        end
 
        def install
-               make DESTDIR=%{BUILDROOT} %{make_install_targets}
+               # Install
+               %{make_install}
 
-               # Run custom commands.
+               # Run custom commands
                %{install_cmds}
        end
-
-       # XXX to be removed soon
-       def install_post
-       end
-
-       # Enable strict processing of build-id by default.
-       # The build will fail if a file is missing its build-id.
-       debuginfo_strict_build_id = true
-       debuginfo_options =
 end