summaryrefslogtreecommitdiff
path: root/debian/mkcmake.pm
diff options
context:
space:
mode:
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.