Skip to content
Snippets Groups Projects
Commit 68e9a2ed authored by Alfredo Gimenez's avatar Alfredo Gimenez Committed by Todd Gamblin
Browse files

Added customization for make targets in 'build' and 'install' phases for AutotoolsPackage (#2464)

* Customization for make targets in build and test phases for AutotoolsPackage

* Updated Blitz++ to use customized make build and test targets

* Removed flake8 error

* Removed make test customization, added make install customization, need to figure out issues with multiple make targets

* Changed build_targets and install_targets to normal attributes
parent 0de7b550
No related branches found
No related tags found
No related merge requests found
...@@ -45,6 +45,9 @@ class AutotoolsPackage(PackageBase): ...@@ -45,6 +45,9 @@ class AutotoolsPackage(PackageBase):
They all have sensible defaults and for many packages the only thing They all have sensible defaults and for many packages the only thing
necessary will be to override `configure_args` necessary will be to override `configure_args`
Additionally, you may specify make targets for build and install
phases by overriding `build_targets` and `install_targets`
""" """
phases = ['autoreconf', 'configure', 'build', 'install'] phases = ['autoreconf', 'configure', 'build', 'install']
# To be used in UI queries that require to know which # To be used in UI queries that require to know which
...@@ -52,6 +55,9 @@ class AutotoolsPackage(PackageBase): ...@@ -52,6 +55,9 @@ class AutotoolsPackage(PackageBase):
build_system_class = 'AutotoolsPackage' build_system_class = 'AutotoolsPackage'
patch_config_guess = True patch_config_guess = True
build_targets = []
install_targets = ['install']
def do_patch_config_guess(self): def do_patch_config_guess(self):
"""Some packages ship with an older config.guess and need to have """Some packages ship with an older config.guess and need to have
this updated when installed on a newer architecture.""" this updated when installed on a newer architecture."""
...@@ -152,12 +158,12 @@ def configure(self, spec, prefix): ...@@ -152,12 +158,12 @@ def configure(self, spec, prefix):
inspect.getmodule(self).configure(*options) inspect.getmodule(self).configure(*options)
def build(self, spec, prefix): def build(self, spec, prefix):
"""The usual `make` after configure""" """Make the build targets"""
inspect.getmodule(self).make() inspect.getmodule(self).make(*self.build_targets)
def install(self, spec, prefix): def install(self, spec, prefix):
"""...and the final `make install` after configure""" """Make the install targets"""
inspect.getmodule(self).make('install') inspect.getmodule(self).make(*self.install_targets)
@PackageBase.sanity_check('build') @PackageBase.sanity_check('build')
@PackageBase.on_package_attributes(run_tests=True) @PackageBase.on_package_attributes(run_tests=True)
......
...@@ -31,3 +31,9 @@ class Blitz(AutotoolsPackage): ...@@ -31,3 +31,9 @@ class Blitz(AutotoolsPackage):
url = "https://github.com/blitzpp/blitz/tarball/1.0.0" url = "https://github.com/blitzpp/blitz/tarball/1.0.0"
version('1.0.0', '9f040b9827fe22228a892603671a77af') version('1.0.0', '9f040b9827fe22228a892603671a77af')
build_targets = ['lib']
def check(self):
make('check-testsuite')
make('check-examples')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment