summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2008-07-24 15:03:14 +0200
committerHans Ulrich Niedermann <hun@n-dimensional.de>2008-07-24 15:03:14 +0200
commitb1d5fc06e235a45561bf53b4bfd07856cec4ea81 (patch)
tree161381475725e8186aeef110ef19642c986760b1
parent958e81655ad143dfd54b099637db60db42f77fb0 (diff)
downloadnbb-b1d5fc06e235a45561bf53b4bfd07856cec4ea81.tar.gz
nbb-b1d5fc06e235a45561bf53b4bfd07856cec4ea81.tar.xz
nbb-b1d5fc06e235a45561bf53b4bfd07856cec4ea81.zip
Make automake's "make" command depend on configure
-rw-r--r--TODO2
-rw-r--r--src/nbblib/bs.py8
-rw-r--r--src/nbblib/nbbcommands.py9
3 files changed, 13 insertions, 6 deletions
diff --git a/TODO b/TODO
index 55fc020..fb5461f 100644
--- a/TODO
+++ b/TODO
@@ -15,6 +15,7 @@ nbb-0.1 (done)
nbb-0.2
* Make sure the "if cmp ... mv .. rm" in make rules are correct and useful,
and the cmp is silent.
+ * Make automake's "nbb make" depend on configure etc.
- License review. Every source file needs a license. Trace back origin
of all code.
- Useful logging infrastructure, and --debug etc user interface.
@@ -48,7 +49,6 @@ nbb-0.9 or earlier
- Man page or something similar. Generate from help texts?
- Command aliases:
make -> build (for automake, or similar mapping)
- - Make automake's "nbb make" depend on configure etc.
- Test sh command like run command.
diff --git a/src/nbblib/bs.py b/src/nbblib/bs.py
index 94f81af..44e901a 100644
--- a/src/nbblib/bs.py
+++ b/src/nbblib/bs.py
@@ -124,13 +124,17 @@ class AutomakeSourceTree(BSSourceTree):
"--enable-maintainer-mode",
], self.context)
- def build(self):
+ def make(self, *make_args):
"""'make'"""
builddir = self.config.builddir
if not os.path.exists(os.path.join(builddir, 'config.status')):
self.configure()
os.chdir(builddir)
- progutils.prog_run(["make", ], self.context)
+ progutils.prog_run(["make"] + list(make_args), self.context)
+
+ def build(self):
+ """'make'"""
+ self.make()
def install(self):
"""'make install'"""
diff --git a/src/nbblib/nbbcommands.py b/src/nbblib/nbbcommands.py
index 4bb6ef9..79025de 100644
--- a/src/nbblib/nbbcommands.py
+++ b/src/nbblib/nbbcommands.py
@@ -210,9 +210,12 @@ class MakeCommand(SourceClassCommand):
summary = 'run make in builddir'
validate_args = Command.validate_args_any
def run(self):
- os.chdir(self.bs_sourcetree.config.builddir)
- progutils.prog_run(["make"] + list(self.args),
- self.context)
+ if hasattr(self.bs_sourcetree, 'make'):
+ self.bs_sourcetree.make(*self.args)
+ else:
+ os.chdir(self.bs_sourcetree.config.builddir)
+ progutils.prog_run(["make"] + list(self.args),
+ self.context)
class GeneralRunCommand(SourceClassCommand):