pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk mk: allow "bmake clean depends" as shortcut



details:   https://anonhg.NetBSD.org/pkgsrc/rev/04ac531b7ad0
branches:  trunk
changeset: 323300:04ac531b7ad0
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Tue May 07 19:36:43 2019 +0000

description:
mk: allow "bmake clean depends" as shortcut

When "bmake clean depends" was called for a package where the various
cookie files already existed, these would enable different rules than a
clean package directory.

Since "bmake clean" deletes all the cookie files before "bmake depends"
starts, in these combined command lines the cookie files must be treated
as absent.

diffstat:

 mk/bsd.prefs.mk               |  7 ++++++-
 mk/build/bsd.build.mk         |  4 ++--
 mk/build/build.mk             |  6 +++---
 mk/build/test.mk              |  6 +++---
 mk/configure/bsd.configure.mk |  4 ++--
 mk/configure/configure.mk     |  6 +++---
 mk/cwrappers.mk               |  6 +++---
 mk/depends/bsd.depends.mk     |  4 ++--
 mk/depends/depends.mk         |  6 +++---
 mk/extract/extract.mk         |  6 +++---
 mk/install/bsd.install.mk     |  4 ++--
 mk/install/install.mk         |  6 +++---
 mk/package/package.mk         |  6 +++---
 mk/patch/patch.mk             |  6 +++---
 mk/tools/bsd.tools.mk         |  6 +++---
 mk/wrapper/bsd.wrapper.mk     |  8 ++++----
 16 files changed, 48 insertions(+), 43 deletions(-)

diffs (truncated from 399 to 300 lines):

diff -r f481eb8077a8 -r 04ac531b7ad0 mk/bsd.prefs.mk
--- a/mk/bsd.prefs.mk   Tue May 07 14:26:06 2019 +0000
+++ b/mk/bsd.prefs.mk   Tue May 07 19:36:43 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.prefs.mk,v 1.403 2019/01/06 12:51:45 bsiegert Exp $
+# $NetBSD: bsd.prefs.mk,v 1.404 2019/05/07 19:36:43 rillig Exp $
 #
 # This file includes the mk.conf file, which contains the user settings.
 #
@@ -61,6 +61,11 @@
 .endif
 MAKE:= ${_MAKE}
 
+# Whether bmake has been called with one of the "clean" targets followed by
+# another non-cleaning target like "depends" or "build". This is to make
+# the call "bmake clean depends" equivalent to "bmake clean && bmake depends".
+_CLEANING:=    ${"${.TARGETS:C,( [[:alnum:]-]*clean[[:alnum:]-]*)+$,,W:M*clean*}":?yes:}
+
 .if exists(/usr/bin/uname)
 UNAME=/usr/bin/uname
 .elif exists(/bin/uname)
diff -r f481eb8077a8 -r 04ac531b7ad0 mk/build/bsd.build.mk
--- a/mk/build/bsd.build.mk     Tue May 07 14:26:06 2019 +0000
+++ b/mk/build/bsd.build.mk     Tue May 07 19:36:43 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.build.mk,v 1.12 2017/06/01 02:15:10 jlam Exp $
+# $NetBSD: bsd.build.mk,v 1.13 2019/05/07 19:36:43 rillig Exp $
 #
 # This Makefile fragment is included by bsd.pkg.mk and provides all
 # variables and targets related to building sources for a package.
@@ -32,7 +32,7 @@
 .if !defined(NO_BUILD)
 .  include "build.mk"
 .elif !target(build)
-.  if exists(${_COOKIE.build})
+.  if exists(${_COOKIE.build}) && !${_CLEANING}
 build:
        @${DO_NADA}
 .  elif defined(_PKGSRC_BARRIER)
diff -r f481eb8077a8 -r 04ac531b7ad0 mk/build/build.mk
--- a/mk/build/build.mk Tue May 07 14:26:06 2019 +0000
+++ b/mk/build/build.mk Tue May 07 19:36:43 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: build.mk,v 1.25 2019/03/17 03:59:11 dholland Exp $
+# $NetBSD: build.mk,v 1.26 2019/05/07 19:36:43 rillig Exp $
 #
 # This file defines what happens in the build phase, excluding the
 # self-test, which is defined in test.mk.
@@ -77,7 +77,7 @@
 
 .PHONY: build
 .if !target(build)
-.  if exists(${_COOKIE.build})
+.  if exists(${_COOKIE.build}) && !${_CLEANING}
 build:
        @${DO_NADA}
 .  elif defined(_PKGSRC_BARRIER)
@@ -91,7 +91,7 @@
 acquire-build-lock: acquire-lock
 release-build-lock: release-lock
 
-.if exists(${_COOKIE.build})
+.if exists(${_COOKIE.build}) && !${_CLEANING}
 ${_COOKIE.build}:
        @${DO_NADA}
 .else
diff -r f481eb8077a8 -r 04ac531b7ad0 mk/build/test.mk
--- a/mk/build/test.mk  Tue May 07 14:26:06 2019 +0000
+++ b/mk/build/test.mk  Tue May 07 19:36:43 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: test.mk,v 1.20 2018/11/30 18:38:19 rillig Exp $
+# $NetBSD: test.mk,v 1.21 2019/05/07 19:36:43 rillig Exp $
 #
 # After the "build" phase, many packages provide some sort of self-test
 # that can be run on the not-yet installed package. To enable these
@@ -67,7 +67,7 @@
 
 .PHONY: test
 .if !target(test)
-.  if exists(${_COOKIE.test})
+.  if exists(${_COOKIE.test}) && !${_CLEANING}
 test:
        @${DO_NADA}
 .  elif defined(_PKGSRC_BARRIER)
@@ -81,7 +81,7 @@
 acquire-test-lock: acquire-lock
 release-test-lock: release-lock
 
-.if exists(${_COOKIE.test})
+.if exists(${_COOKIE.test}) && !${_CLEANING}
 ${_COOKIE.test}:
        @${DO_NADA}
 .else
diff -r f481eb8077a8 -r 04ac531b7ad0 mk/configure/bsd.configure.mk
--- a/mk/configure/bsd.configure.mk     Tue May 07 14:26:06 2019 +0000
+++ b/mk/configure/bsd.configure.mk     Tue May 07 19:36:43 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.configure.mk,v 1.11 2008/01/04 01:46:26 rillig Exp $
+# $NetBSD: bsd.configure.mk,v 1.12 2019/05/07 19:36:44 rillig Exp $
 #
 # This Makefile fragment is included by bsd.pkg.mk and provides all
 # variables and targets related to configuring packages for building.
@@ -23,7 +23,7 @@
 .if !defined(NO_CONFIGURE)
 .  include "configure.mk"
 .elif !target(configure)
-.  if exists(${_COOKIE.configure})
+.  if exists(${_COOKIE.configure}) && !${_CLEANING}
 configure:
        @${DO_NADA}
 .  elif defined(_PKGSRC_BARRIER)
diff -r f481eb8077a8 -r 04ac531b7ad0 mk/configure/configure.mk
--- a/mk/configure/configure.mk Tue May 07 14:26:06 2019 +0000
+++ b/mk/configure/configure.mk Tue May 07 19:36:43 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: configure.mk,v 1.28 2019/04/28 13:18:18 rillig Exp $
+# $NetBSD: configure.mk,v 1.29 2019/05/07 19:36:44 rillig Exp $
 #
 # = Package-settable variables =
 #
@@ -99,7 +99,7 @@
 
 .PHONY: configure
 .if !target(configure)
-.  if exists(${_COOKIE.configure})
+.  if exists(${_COOKIE.configure}) && !${_CLEANING}
 configure:
        @${DO_NADA}
 .  elif defined(_PKGSRC_BARRIER)
@@ -113,7 +113,7 @@
 acquire-configure-lock: acquire-lock
 release-configure-lock: release-lock
 
-.if exists(${_COOKIE.configure})
+.if exists(${_COOKIE.configure}) && !${_CLEANING}
 ${_COOKIE.configure}:
        @${DO_NADA}
 .else
diff -r f481eb8077a8 -r 04ac531b7ad0 mk/cwrappers.mk
--- a/mk/cwrappers.mk   Tue May 07 14:26:06 2019 +0000
+++ b/mk/cwrappers.mk   Tue May 07 19:36:43 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: cwrappers.mk,v 1.30 2017/11/08 03:52:50 khorben Exp $
+# $NetBSD: cwrappers.mk,v 1.31 2019/05/07 19:36:43 rillig Exp $
 #
 # This Makefile fragment implements integration of pkgtools/cwrappers.
 
@@ -101,7 +101,7 @@
 
 .PHONY: wrapper
 .if !target(wrapper)
-.  if exists(${_COOKIE.wrapper})
+.  if exists(${_COOKIE.wrapper}) && !${_CLEANING}
 wrapper:
        @${DO_NADA}
 .  elif defined(_PKGSRC_BARRIER)
@@ -115,7 +115,7 @@
 acquire-wrapper-lock: acquire-lock
 release-wrapper-lock: release-lock
 
-.if exists(${_COOKIE.wrapper})
+.if exists(${_COOKIE.wrapper}) && !${_CLEANING}
 ${_COOKIE.wrapper}:
        @${DO_NADA}
 .else
diff -r f481eb8077a8 -r 04ac531b7ad0 mk/depends/bsd.depends.mk
--- a/mk/depends/bsd.depends.mk Tue May 07 14:26:06 2019 +0000
+++ b/mk/depends/bsd.depends.mk Tue May 07 19:36:43 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.depends.mk,v 1.29 2019/05/04 11:45:14 leot Exp $
+# $NetBSD: bsd.depends.mk,v 1.30 2019/05/07 19:36:44 rillig Exp $
 #
 # This Makefile fragment is included by bsd.pkg.mk and provides all
 # variables and targets related to dependencies.
@@ -72,7 +72,7 @@
 .if ${SKIP_DEPENDS:M[Nn][Oo]} != ""
 .  include "depends.mk"
 .elif !target(depends)
-.  if exists(${_COOKIE.depends})
+.  if exists(${_COOKIE.depends}) && !${_CLEANING}
 depends:
        @${DO_NADA}
 .  else
diff -r f481eb8077a8 -r 04ac531b7ad0 mk/depends/depends.mk
--- a/mk/depends/depends.mk     Tue May 07 14:26:06 2019 +0000
+++ b/mk/depends/depends.mk     Tue May 07 19:36:43 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: depends.mk,v 1.18 2014/01/14 12:28:47 cheusov Exp $
+# $NetBSD: depends.mk,v 1.19 2019/05/07 19:36:44 rillig Exp $
 
 ######################################################################
 ### depends (PUBLIC)
@@ -12,7 +12,7 @@
 
 .PHONY: depends
 .if !target(depends)
-.  if exists(${_COOKIE.depends})
+.  if exists(${_COOKIE.depends}) && !${_CLEANING}
 depends:
        @${DO_NADA}
 .  else
@@ -24,7 +24,7 @@
 acquire-depends-lock: acquire-lock
 release-depends-lock: release-lock
 
-.if exists(${_COOKIE.depends})
+.if exists(${_COOKIE.depends}) && !${_CLEANING}
 ${_COOKIE.depends}:
        @${DO_NADA}
 .else
diff -r f481eb8077a8 -r 04ac531b7ad0 mk/extract/extract.mk
--- a/mk/extract/extract.mk     Tue May 07 14:26:06 2019 +0000
+++ b/mk/extract/extract.mk     Tue May 07 19:36:43 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: extract.mk,v 1.37 2014/03/02 09:45:42 obache Exp $
+# $NetBSD: extract.mk,v 1.38 2019/05/07 19:36:44 rillig Exp $
 #
 # The following variables may be set by the package Makefile and
 # specify how extraction happens:
@@ -71,7 +71,7 @@
 
 .PHONY: extract
 .if !target(extract)
-.  if exists(${_COOKIE.extract})
+.  if exists(${_COOKIE.extract}) && !${_CLEANING}
 extract:
        @${DO_NADA}
 .  elif defined(_PKGSRC_BARRIER)
@@ -85,7 +85,7 @@
 acquire-extract-lock: acquire-lock
 release-extract-lock: release-lock
 
-.if exists(${_COOKIE.extract})
+.if exists(${_COOKIE.extract}) && !${_CLEANING}
 ${_COOKIE.extract}:
        @${DO_NADA}
 .else
diff -r f481eb8077a8 -r 04ac531b7ad0 mk/install/bsd.install.mk
--- a/mk/install/bsd.install.mk Tue May 07 14:26:06 2019 +0000
+++ b/mk/install/bsd.install.mk Tue May 07 19:36:43 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.install.mk,v 1.16 2016/04/10 15:58:02 joerg Exp $
+# $NetBSD: bsd.install.mk,v 1.17 2019/05/07 19:36:44 rillig Exp $
 #
 # This Makefile fragment is included by bsd.pkg.mk and provides all
 # variables and targets related to installing packages.
@@ -38,7 +38,7 @@
 .if !defined(NO_INSTALL)
 .  include "install.mk"
 .else
-.  if exists(${_COOKIE.install})
+.  if exists(${_COOKIE.install}) && !${_CLEANING}
 stage-install:
        @${DO_NADA}
 .  elif defined(_PKGSRC_BARRIER)
diff -r f481eb8077a8 -r 04ac531b7ad0 mk/install/install.mk
--- a/mk/install/install.mk     Tue May 07 14:26:06 2019 +0000
+++ b/mk/install/install.mk     Tue May 07 19:36:43 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: install.mk,v 1.75 2018/11/12 14:22:58 jperkin Exp $
+# $NetBSD: install.mk,v 1.76 2019/05/07 19:36:44 rillig Exp $
 #
 # This file provides the code for the "install" phase.
 #
@@ -77,7 +77,7 @@
 
 .PHONY: stage-install
 .if !target(stage-install)
-.  if exists(${_COOKIE.install})
+.  if exists(${_COOKIE.install}) && !${_CLEANING}
 stage-install:
        @${DO_NADA}
 .  elif defined(_PKGSRC_BARRIER)
@@ -91,7 +91,7 @@
 acquire-install-lock: acquire-lock
 release-install-lock: release-lock
 
-.if exists(${_COOKIE.install})
+.if exists(${_COOKIE.install}) && !${_CLEANING}
 ${_COOKIE.install}:
        @${DO_NADA}
 .else
diff -r f481eb8077a8 -r 04ac531b7ad0 mk/package/package.mk
--- a/mk/package/package.mk     Tue May 07 14:26:06 2019 +0000
+++ b/mk/package/package.mk     Tue May 07 19:36:43 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: package.mk,v 1.26 2016/07/14 14:43:55 leot Exp $
+# $NetBSD: package.mk,v 1.27 2019/05/07 19:36:44 rillig Exp $
 #
 # This file provides the code for the "package" phase.
 #
@@ -18,7 +18,7 @@
 
 .PHONY: package
 .if !target(package)
-.  if exists(${_COOKIE.package})
+.  if exists(${_COOKIE.package}) && !${_CLEANING}
 package:
        @${DO_NADA}
 .  elif defined(_PKGSRC_BARRIER)



Home | Main Index | Thread Index | Old Index