summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrillig <rillig>2007-01-02 23:01:24 +0000
committerrillig <rillig>2007-01-02 23:01:24 +0000
commit67af22b51a9cc19709691b8214dafb6d62f220ca (patch)
treea1054e2cab623c03a983bf8979ab130d249db501 /pkgtools
parent26406f8948aa1104e2a336bc8ba3284b93f4d5ed (diff)
downloadpkgsrc-67af22b51a9cc19709691b8214dafb6d62f220ca.tar.gz
Outside of packages, the :M* operator has to be used sometimes.
When .PHONY appears as the source in a dependency line, all targets are considered "virtual" targets.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/files/pkglint.pl14
1 files changed, 12 insertions, 2 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index 960f627ff52..b1464068df0 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -1,5 +1,5 @@
#! @PERL@
-# $NetBSD: pkglint.pl,v 1.689 2007/01/02 22:27:44 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.690 2007/01/02 23:01:24 rillig Exp $
#
# pkglint - static analyzer and checker for pkgsrc packages
@@ -3900,7 +3900,9 @@ sub checkline_mk_varuse($$$$) {
# configure scripts.
my $need_mstar = false;
if ($varname =~ regex_gnu_configure_volatile_vars) {
- if (defined($pkgctx_vardef) && exists($pkgctx_vardef->{"GNU_CONFIGURE"})) {
+ # When we are not checking a package, but some other file,
+ # the :M* operator is needed for safety.
+ if (!defined($pkgctx_vardef) || exists($pkgctx_vardef->{"GNU_CONFIGURE"})) {
$need_mstar = true;
}
}
@@ -5991,6 +5993,14 @@ sub checklines_mk($) {
$opt_debug_misc and $line->log_debug("targets=${targets}, dependencies=${dependencies}");
$mkctx_target = $targets;
+ foreach my $source (split(/\s+/, $dependencies)) {
+ if ($source eq ".PHONY") {
+ foreach my $target (split(/\s+/, $targets)) {
+ $allowed_targets->{$target} = true;
+ }
+ }
+ }
+
foreach my $target (split(/\s+/, $targets)) {
if ($target eq ".PHONY") {
foreach my $dep (split(qr"\s+", $dependencies)) {