summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2019-05-07 19:36:43 +0000
committerrillig <rillig@pkgsrc.org>2019-05-07 19:36:43 +0000
commite69a8e6b9a2ec1fe26f4213b89531a5debabf312 (patch)
treedd6c3ae5f569aa6abe76820becfd3a45899a0f05
parent0e83f609c5e5acb21481227c510239f9ad2cbe2c (diff)
downloadpkgsrc-e69a8e6b9a2ec1fe26f4213b89531a5debabf312.tar.gz
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.
-rw-r--r--mk/bsd.prefs.mk7
-rw-r--r--mk/build/bsd.build.mk4
-rw-r--r--mk/build/build.mk6
-rw-r--r--mk/build/test.mk6
-rw-r--r--mk/configure/bsd.configure.mk4
-rw-r--r--mk/configure/configure.mk6
-rw-r--r--mk/cwrappers.mk6
-rw-r--r--mk/depends/bsd.depends.mk4
-rw-r--r--mk/depends/depends.mk6
-rw-r--r--mk/extract/extract.mk6
-rw-r--r--mk/install/bsd.install.mk4
-rw-r--r--mk/install/install.mk6
-rw-r--r--mk/package/package.mk6
-rw-r--r--mk/patch/patch.mk6
-rw-r--r--mk/tools/bsd.tools.mk6
-rw-r--r--mk/wrapper/bsd.wrapper.mk8
16 files changed, 48 insertions, 43 deletions
diff --git a/mk/bsd.prefs.mk b/mk/bsd.prefs.mk
index a81de9ef737..66c187e066b 100644
--- a/mk/bsd.prefs.mk
+++ b/mk/bsd.prefs.mk
@@ -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 @@ MAKEFLAGS+= _MAKE=${_MAKE:Q}
.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 --git a/mk/build/bsd.build.mk b/mk/build/bsd.build.mk
index d9a4cb5f34b..152d6faef36 100644
--- a/mk/build/bsd.build.mk
+++ b/mk/build/bsd.build.mk
@@ -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 @@ _COOKIE.test= ${WRKDIR}/.test_done
.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 --git a/mk/build/build.mk b/mk/build/build.mk
index 012cd92f67f..d7b5fccdb40 100644
--- a/mk/build/build.mk
+++ b/mk/build/build.mk
@@ -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 @@ _BUILD_TARGETS+= pkginstall
.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 @@ build: barrier
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 --git a/mk/build/test.mk b/mk/build/test.mk
index 279b0782296..6199450d0e6 100644
--- a/mk/build/test.mk
+++ b/mk/build/test.mk
@@ -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 @@ _TEST_TARGETS+= release-test-lock
.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 @@ test: barrier
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 --git a/mk/configure/bsd.configure.mk b/mk/configure/bsd.configure.mk
index 0f34cd38f87..4370a505e24 100644
--- a/mk/configure/bsd.configure.mk
+++ b/mk/configure/bsd.configure.mk
@@ -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 @@ _COOKIE.configure= ${WRKDIR}/.configure_done
.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 --git a/mk/configure/configure.mk b/mk/configure/configure.mk
index 01366f9fc6e..3c773cec533 100644
--- a/mk/configure/configure.mk
+++ b/mk/configure/configure.mk
@@ -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 @@ _CONFIGURE_TARGETS+= release-configure-lock
.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 @@ configure: barrier
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 --git a/mk/cwrappers.mk b/mk/cwrappers.mk
index 5d544548b3c..ede824686a7 100644
--- a/mk/cwrappers.mk
+++ b/mk/cwrappers.mk
@@ -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 @@ _COOKIE.wrapper= ${WRKDIR}/.wrapper_done
.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 @@ wrapper: barrier
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 --git a/mk/depends/bsd.depends.mk b/mk/depends/bsd.depends.mk
index 098d2524100..19a200d7d1e 100644
--- a/mk/depends/bsd.depends.mk
+++ b/mk/depends/bsd.depends.mk
@@ -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 @@ DEPENDS_TARGET= reinstall
.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 --git a/mk/depends/depends.mk b/mk/depends/depends.mk
index d503c2209e2..03e1f601002 100644
--- a/mk/depends/depends.mk
+++ b/mk/depends/depends.mk
@@ -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 @@ _DEPENDS_TARGETS+= release-depends-lock
.PHONY: depends
.if !target(depends)
-. if exists(${_COOKIE.depends})
+. if exists(${_COOKIE.depends}) && !${_CLEANING}
depends:
@${DO_NADA}
. else
@@ -24,7 +24,7 @@ depends: ${_DEPENDS_TARGETS}
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 --git a/mk/extract/extract.mk b/mk/extract/extract.mk
index f23b7efaae0..fd94ad9071f 100644
--- a/mk/extract/extract.mk
+++ b/mk/extract/extract.mk
@@ -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 @@ _EXTRACT_TARGETS+= release-extract-lock
.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 @@ extract: barrier
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 --git a/mk/install/bsd.install.mk b/mk/install/bsd.install.mk
index f71e9fd0f02..82f1db6e3d4 100644
--- a/mk/install/bsd.install.mk
+++ b/mk/install/bsd.install.mk
@@ -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 @@ install: package-install
.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 --git a/mk/install/install.mk b/mk/install/install.mk
index a1c5590587c..a2dad290519 100644
--- a/mk/install/install.mk
+++ b/mk/install/install.mk
@@ -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 @@ _INSTALL_TARGETS+= release-install-lock
.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 @@ stage-install: barrier
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 --git a/mk/package/package.mk b/mk/package/package.mk
index 641857b7c9c..c1cf8c54276 100644
--- a/mk/package/package.mk
+++ b/mk/package/package.mk
@@ -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 @@ _PACKAGE_TARGETS+= release-package-lock
.PHONY: package
.if !target(package)
-. if exists(${_COOKIE.package})
+. if exists(${_COOKIE.package}) && !${_CLEANING}
package:
@${DO_NADA}
. elif defined(_PKGSRC_BARRIER)
@@ -32,7 +32,7 @@ package: barrier
acquire-package-lock: acquire-lock
release-package-lock: release-lock
-.if exists(${_COOKIE.package})
+.if exists(${_COOKIE.package}) && !${_CLEANING}
${_COOKIE.package}:
@${DO_NADA}
.else
diff --git a/mk/patch/patch.mk b/mk/patch/patch.mk
index c50e3dbb6d5..1cae2f5c512 100644
--- a/mk/patch/patch.mk
+++ b/mk/patch/patch.mk
@@ -1,4 +1,4 @@
-# $NetBSD: patch.mk,v 1.18 2009/03/17 21:43:54 rillig Exp $
+# $NetBSD: patch.mk,v 1.19 2019/05/07 19:36:44 rillig Exp $
#
# The following variables may be set in a package Makefile and control
# how pkgsrc patches are applied.
@@ -66,7 +66,7 @@ _PATCH_TARGETS+= release-patch-lock
.PHONY: patch
.if !target(patch)
-. if exists(${_COOKIE.patch})
+. if exists(${_COOKIE.patch}) && !${_CLEANING}
patch:
@${DO_NADA}
. elif defined(_PKGSRC_BARRIER)
@@ -80,7 +80,7 @@ patch: barrier
acquire-patch-lock: acquire-lock
release-patch-lock: release-lock
-.if exists(${_COOKIE.patch})
+.if exists(${_COOKIE.patch}) && !${_CLEANING}
${_COOKIE.patch}:
@${DO_NADA}
.else
diff --git a/mk/tools/bsd.tools.mk b/mk/tools/bsd.tools.mk
index 258318e109b..b5be4df1a0e 100644
--- a/mk/tools/bsd.tools.mk
+++ b/mk/tools/bsd.tools.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.tools.mk,v 1.58 2019/03/22 16:17:50 rillig Exp $
+# $NetBSD: bsd.tools.mk,v 1.59 2019/05/07 19:36:44 rillig Exp $
#
# Copyright (c) 2005, 2006 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -62,7 +62,7 @@ _TOOLS_TARGETS+= release-tools-lock
.PHONY: tools
.if !target(tools)
-. if exists(${_COOKIE.tools})
+. if exists(${_COOKIE.tools}) && !${_CLEANING}
tools:
@${DO_NADA}
. elif defined(_PKGSRC_BARRIER)
@@ -76,7 +76,7 @@ tools: barrier
acquire-tools-lock: acquire-lock
release-tools-lock: release-lock
-.if exists(${_COOKIE.tools})
+.if exists(${_COOKIE.tools}) && !${_CLEANING}
${_COOKIE.tools}:
@${DO_NADA}
.else
diff --git a/mk/wrapper/bsd.wrapper.mk b/mk/wrapper/bsd.wrapper.mk
index c51c40729a3..1b620bde08d 100644
--- a/mk/wrapper/bsd.wrapper.mk
+++ b/mk/wrapper/bsd.wrapper.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.wrapper.mk,v 1.100 2018/08/22 20:48:37 maya Exp $
+# $NetBSD: bsd.wrapper.mk,v 1.101 2019/05/07 19:36:44 rillig Exp $
#
# Copyright (c) 2005 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -54,7 +54,7 @@ PREPEND_PATH+= ${WRAPPER_BINDIR}
###
### BEGIN: after the barrier
###
-.if exists(${_COOKIE.barrier})
+.if exists(${_COOKIE.barrier}) && !${_CLEANING}
_WRAPPER_DEBUG?= no
CONFIGURE_ENV+= WRAPPER_DEBUG=${_WRAPPER_DEBUG:Q}
@@ -708,7 +708,7 @@ _COOKIE.wrapper= ${WRKDIR}/.wrapper_done
.PHONY: wrapper
.if !target(wrapper)
-. if exists(${_COOKIE.wrapper})
+. if exists(${_COOKIE.wrapper}) && !${_CLEANING}
wrapper:
@${DO_NADA}
. elif defined(_PKGSRC_BARRIER)
@@ -722,7 +722,7 @@ wrapper: barrier
acquire-wrapper-lock: acquire-lock
release-wrapper-lock: release-lock
-.if exists(${_COOKIE.wrapper})
+.if exists(${_COOKIE.wrapper}) && !${_CLEANING}
${_COOKIE.wrapper}:
@${DO_NADA}
.else