summaryrefslogtreecommitdiff
path: root/debian/mkcmake.pm
diff options
context:
space:
mode:
authorAndrew Shadura <andrewsh@debian.org>2014-01-05 22:42:41 +0100
committerAndrew Shadura <andrew@shadura.me>2015-07-25 14:44:33 +0200
commitc8659b636be5e763c5dc028a5db7294b1af2648c (patch)
tree7dacf7580ff8c7d8c64682eaa28350bc47fbd56e /debian/mkcmake.pm
parent004c4cd3db1d9ad252eccbc1e9e6c54ec61a2927 (diff)
parentaba913436a8521abe405a04ed71388989e1d646f (diff)
Imported Debian patch 0.25.0-1
Diffstat (limited to 'debian/mkcmake.pm')
-rw-r--r--debian/mkcmake.pm10
1 files changed, 5 insertions, 5 deletions
diff --git a/debian/mkcmake.pm b/debian/mkcmake.pm
index 016685e..3c1e83c 100644
--- a/debian/mkcmake.pm
+++ b/debian/mkcmake.pm
@@ -17,19 +17,19 @@ sub DESCRIPTION {
sub exists_make_target {
my ($this, $target) = @_;
- # Use make -n to check to see if the target would do
- # anything. There's no good way to test if a target exists.
- my @opts=("-s", "-n");
+ # Use -V .ALLTARGETS to get the list of targets; -n is
+ # needed to avoid executing anything
+ my @opts=("-n", "-V", ".ALLTARGETS");
my $buildpath = $this->get_buildpath();
unshift @opts, "-C", $buildpath if $buildpath ne ".";
open(SAVEDERR, ">&STDERR");
open(STDERR, ">/dev/null");
- open(MAKE, "-|", $this->{makecmd}, @opts, $target);
+ open(MAKE, "-|", $this->{makecmd}, @opts);
my $output=<MAKE>;
chomp $output;
close MAKE;
open(STDERR, ">&SAVEDERR");
- return defined $output && length $output;
+ return defined $output && grep(/^$target$/, split(" ",$output));
}
# Currently, we don't want parallel build with bmake.