pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/mk
Module Name: pkgsrc
Committed By: jperkin
Date: Wed Nov 23 13:30:38 UTC 2022
Modified Files:
pkgsrc/mk: bsd.pkg.barrier.mk bsd.pkg.mk compiler.mk cwrappers.mk
pkgsrc/mk/build: bsd.build.mk test.mk
pkgsrc/mk/configure: bsd.configure.mk
pkgsrc/mk/depends: bsd.depends.mk
pkgsrc/mk/extract: extract.mk
pkgsrc/mk/package: package.mk
pkgsrc/mk/tools: bsd.tools.mk
Log Message:
mk: Miscellaneous performance improvements.
Inline ${RUN} calls where appropriate. Call mkdir directly rather than via
a shell when invoked as a single command. Avoid unnecessary mkdir calls.
To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 pkgsrc/mk/bsd.pkg.barrier.mk
cvs rdiff -u -r1.2044 -r1.2045 pkgsrc/mk/bsd.pkg.mk
cvs rdiff -u -r1.98 -r1.99 pkgsrc/mk/compiler.mk
cvs rdiff -u -r1.37 -r1.38 pkgsrc/mk/cwrappers.mk
cvs rdiff -u -r1.13 -r1.14 pkgsrc/mk/build/bsd.build.mk
cvs rdiff -u -r1.24 -r1.25 pkgsrc/mk/build/test.mk
cvs rdiff -u -r1.12 -r1.13 pkgsrc/mk/configure/bsd.configure.mk
cvs rdiff -u -r1.32 -r1.33 pkgsrc/mk/depends/bsd.depends.mk
cvs rdiff -u -r1.43 -r1.44 pkgsrc/mk/extract/extract.mk
cvs rdiff -u -r1.27 -r1.28 pkgsrc/mk/package/package.mk
cvs rdiff -u -r1.64 -r1.65 pkgsrc/mk/tools/bsd.tools.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/mk/bsd.pkg.barrier.mk
diff -u pkgsrc/mk/bsd.pkg.barrier.mk:1.21 pkgsrc/mk/bsd.pkg.barrier.mk:1.22
--- pkgsrc/mk/bsd.pkg.barrier.mk:1.21 Mon Mar 23 00:33:48 2020
+++ pkgsrc/mk/bsd.pkg.barrier.mk Wed Nov 23 13:30:38 2022
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.barrier.mk,v 1.21 2020/03/23 00:33:48 riastradh Exp $
+# $NetBSD: bsd.pkg.barrier.mk,v 1.22 2022/11/23 13:30:38 jperkin Exp $
_COOKIE.barrier= ${WRKDIR}/.barrier_cookie
@@ -89,5 +89,6 @@ barrier: ${_BARRIER_PRE_TARGETS} ${_COOK
### barrier-cookie creates the "barrier" cookie file.
###
${_COOKIE.barrier}:
- ${RUN}${MKDIR} ${.TARGET:H}
- ${RUN}${ECHO} ${PKGNAME} > ${.TARGET}
+ ${RUN} \
+ ${TEST} -d ${.TARGET:H} || ${MKDIR} ${.TARGET:H}; \
+ ${ECHO} ${PKGNAME} > ${.TARGET}
Index: pkgsrc/mk/bsd.pkg.mk
diff -u pkgsrc/mk/bsd.pkg.mk:1.2044 pkgsrc/mk/bsd.pkg.mk:1.2045
--- pkgsrc/mk/bsd.pkg.mk:1.2044 Wed Nov 23 10:53:14 2022
+++ pkgsrc/mk/bsd.pkg.mk Wed Nov 23 13:30:38 2022
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.2044 2022/11/23 10:53:14 jperkin Exp $
+# $NetBSD: bsd.pkg.mk,v 1.2045 2022/11/23 13:30:38 jperkin Exp $
#
# This file is in the public domain.
#
@@ -420,7 +420,7 @@ ALL_ENV+= HOME=${FAKEHOMEDIR}
.PHONY: fake-home
fake-home: ${FAKEHOMEDIR}
${FAKEHOMEDIR}:
- ${RUN} ${MKDIR} ${.TARGET}
+ @${MKDIR} ${.TARGET}
# Use C-based wrappers or legacy shell versions.
.if ${_USE_CWRAPPERS} == "yes"
Index: pkgsrc/mk/compiler.mk
diff -u pkgsrc/mk/compiler.mk:1.98 pkgsrc/mk/compiler.mk:1.99
--- pkgsrc/mk/compiler.mk:1.98 Tue Jul 5 17:32:24 2022
+++ pkgsrc/mk/compiler.mk Wed Nov 23 13:30:38 2022
@@ -1,4 +1,4 @@
-# $NetBSD: compiler.mk,v 1.98 2022/07/05 17:32:24 jperkin Exp $
+# $NetBSD: compiler.mk,v 1.99 2022/11/23 13:30:38 jperkin Exp $
#
# This Makefile fragment implements handling for supported C/C++/Fortran
# compilers.
@@ -252,8 +252,8 @@ ${_FAIL_WRAPPER.ADA}: fail-wrapper
.PHONY: fail-wrapper
fail-wrapper: .USE
- ${RUN}${MKDIR} ${.TARGET:H}
- ${RUN} \
+ ${RUN} \
+ ${TEST} -d ${.TARGET:H} || ${MKDIR} ${.TARGET:H}; \
exec 1>${.TARGET}; \
${ECHO} '#!'${TOOLS_SHELL:Q}; \
${ECHO} 'wrapperlog="$${TOOLS_WRAPPER_LOG-'${_TOOLS_WRAP_LOG:Q}'}"'; \
@@ -263,8 +263,8 @@ fail-wrapper: .USE
${ECHO} '${ECHO} "$$msg" > ${WARNING_DIR}/${.TARGET:T}'; \
${ECHO} '${ECHO} "PKGSRC-WARNING: Something is trying to run the $$lang compiler," 1>&2'; \
${ECHO} '${ECHO} "PKGSRC-WARNING: but it is not added to USE_LANGUAGES in the package Makefile." 1>&2'; \
- ${ECHO} 'exit 1'
- ${RUN}${CHMOD} +x ${.TARGET}
+ ${ECHO} 'exit 1'; \
+ ${CHMOD} +x ${.TARGET}
.if empty(USE_LANGUAGES:Mc) && empty(USE_LANGUAGES:Mobjc) && empty(USE_LANGUAGES:Mobjc-c++)
PKG_CC:= ${_FAIL_WRAPPER.CC}
Index: pkgsrc/mk/cwrappers.mk
diff -u pkgsrc/mk/cwrappers.mk:1.37 pkgsrc/mk/cwrappers.mk:1.38
--- pkgsrc/mk/cwrappers.mk:1.37 Wed Nov 23 10:44:16 2022
+++ pkgsrc/mk/cwrappers.mk Wed Nov 23 13:30:38 2022
@@ -1,4 +1,4 @@
-# $NetBSD: cwrappers.mk,v 1.37 2022/11/23 10:44:16 jperkin Exp $
+# $NetBSD: cwrappers.mk,v 1.38 2022/11/23 13:30:38 jperkin Exp $
#
# This Makefile fragment implements integration of pkgtools/cwrappers.
@@ -147,7 +147,7 @@ wrapper-message:
.PHONY: wrapper-dirs
wrapper-dirs:
- ${RUN}${MKDIR} ${CWRAPPERS_CONFIG_DIR} ${WRAPPER_BINDIR}
+ @${MKDIR} ${CWRAPPERS_CONFIG_DIR} ${WRAPPER_BINDIR}
.PHONY: pre-wrapper do-wrapper post-wrapper
@@ -170,6 +170,7 @@ post-wrapper:
.PHONY: wrapper-cookie
wrapper-cookie:
- ${RUN} [ ! -f ${_COOKIE.wrapper} ]
- ${RUN} ${MKDIR} ${_COOKIE.wrapper:H}
- ${RUN} ${ECHO} ${PKGNAME} > ${_COOKIE.wrapper}
+ ${RUN} \
+ [ ! -f ${_COOKIE.wrapper} ]; \
+ ${TEST} -d ${_COOKIE.wrapper:H} || ${MKDIR} ${_COOKIE.wrapper:H}; \
+ ${ECHO} ${PKGNAME} > ${_COOKIE.wrapper}
Index: pkgsrc/mk/build/bsd.build.mk
diff -u pkgsrc/mk/build/bsd.build.mk:1.13 pkgsrc/mk/build/bsd.build.mk:1.14
--- pkgsrc/mk/build/bsd.build.mk:1.13 Tue May 7 19:36:43 2019
+++ pkgsrc/mk/build/bsd.build.mk Wed Nov 23 13:30:38 2022
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.build.mk,v 1.13 2019/05/07 19:36:43 rillig Exp $
+# $NetBSD: bsd.build.mk,v 1.14 2022/11/23 13:30:38 jperkin Exp $
#
# This Makefile fragment is included by bsd.pkg.mk and provides all
# variables and targets related to building sources for a package.
@@ -55,6 +55,7 @@ build: barrier
###
.PHONY: build-cookie
build-cookie:
- ${RUN}${TEST} ! -f ${_COOKIE.build} || ${FALSE}
- ${RUN}${MKDIR} ${_COOKIE.build:H}
- ${RUN}${ECHO} ${PKGNAME} > ${_COOKIE.build}
+ ${RUN} \
+ ${TEST} ! -f ${_COOKIE.build} || ${FALSE}; \
+ ${TEST} -d ${_COOKIE.build:H} || ${MKDIR} ${_COOKIE.build:H}; \
+ ${ECHO} ${PKGNAME} > ${_COOKIE.build}
Index: pkgsrc/mk/build/test.mk
diff -u pkgsrc/mk/build/test.mk:1.24 pkgsrc/mk/build/test.mk:1.25
--- pkgsrc/mk/build/test.mk:1.24 Mon Mar 23 00:33:48 2020
+++ pkgsrc/mk/build/test.mk Wed Nov 23 13:30:38 2022
@@ -1,4 +1,4 @@
-# $NetBSD: test.mk,v 1.24 2020/03/23 00:33:48 riastradh Exp $
+# $NetBSD: test.mk,v 1.25 2022/11/23 13:30:38 jperkin 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
@@ -181,9 +181,10 @@ post-test:
###
.PHONY: test-cookie
test-cookie:
- ${RUN}${TEST} ! -f ${_COOKIE.test} || ${FALSE}
- ${RUN}${MKDIR} ${_COOKIE.test:H}
- ${RUN}${ECHO} ${PKGNAME} > ${_COOKIE.test}
+ ${RUN} \
+ ${TEST} ! -f ${_COOKIE.test} || ${FALSE}; \
+ ${TEST} -d ${_COOKIE.test:H} || ${MKDIR} ${_COOKIE.test:H}; \
+ ${ECHO} ${PKGNAME} > ${_COOKIE.test}
######################################################################
### test-clean (PRIVATE)
Index: pkgsrc/mk/configure/bsd.configure.mk
diff -u pkgsrc/mk/configure/bsd.configure.mk:1.12 pkgsrc/mk/configure/bsd.configure.mk:1.13
--- pkgsrc/mk/configure/bsd.configure.mk:1.12 Tue May 7 19:36:44 2019
+++ pkgsrc/mk/configure/bsd.configure.mk Wed Nov 23 13:30:38 2022
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.configure.mk,v 1.12 2019/05/07 19:36:44 rillig Exp $
+# $NetBSD: bsd.configure.mk,v 1.13 2022/11/23 13:30:38 jperkin Exp $
#
# This Makefile fragment is included by bsd.pkg.mk and provides all
# variables and targets related to configuring packages for building.
@@ -35,6 +35,7 @@ configure: barrier
# Creates the "configure" cookie file.
_configure-cookie: .PHONY
- ${RUN} [ ! -f ${_COOKIE.configure} ] # XXX: What's the purpose of this assertion?
- ${RUN} ${MKDIR} ${_COOKIE.configure:H}
- ${RUN} ${ECHO} ${PKGNAME} > ${_COOKIE.configure}
+ ${RUN} \
+ [ ! -f ${_COOKIE.configure} ]; \
+ ${TEST} -d ${_COOKIE.configure:H} || ${MKDIR} ${_COOKIE.configure:H}; \
+ ${ECHO} ${PKGNAME} > ${_COOKIE.configure}
Index: pkgsrc/mk/depends/bsd.depends.mk
diff -u pkgsrc/mk/depends/bsd.depends.mk:1.32 pkgsrc/mk/depends/bsd.depends.mk:1.33
--- pkgsrc/mk/depends/bsd.depends.mk:1.32 Wed Apr 13 22:02:36 2022
+++ pkgsrc/mk/depends/bsd.depends.mk Wed Nov 23 13:30:38 2022
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.depends.mk,v 1.32 2022/04/13 22:02:36 rillig Exp $
+# $NetBSD: bsd.depends.mk,v 1.33 2022/11/23 13:30:38 jperkin Exp $
#
# This Makefile fragment is included by bsd.pkg.mk and provides all
# variables and targets related to dependencies.
@@ -112,8 +112,8 @@ install-depends: depends depends-clean
### target so that "depends" may be re-invoked.
###
depends-clean:
- ${RUN}${RM} -f ${_COOKIE.depends}
- ${RUN} \
+ ${RUN} \
+ ${RM} -f ${_COOKIE.depends}; \
${RMDIR} -p ${_COOKIE.depends:H} 2>/dev/null || ${TRUE}
######################################################################
@@ -124,9 +124,10 @@ depends-clean:
###
.PHONY: depends-cookie
depends-cookie:
- ${RUN}${TEST} ! -f ${_COOKIE.depends} || ${FALSE}
- ${RUN}${MKDIR} ${_COOKIE.depends:H}
- ${RUN}${TOUCH} ${TOUCH_ARGS} ${_COOKIE.depends}
+ ${RUN} \
+ ${TEST} ! -f ${_COOKIE.depends} || ${FALSE}; \
+ ${TEST} -d ${_COOKIE.depends:H} || ${MKDIR} ${_COOKIE.depends:H}; \
+ ${TOUCH} ${TOUCH_ARGS} ${_COOKIE.depends}
# show-depends:
# Prints the dependencies that need to be installed before this
Index: pkgsrc/mk/extract/extract.mk
diff -u pkgsrc/mk/extract/extract.mk:1.43 pkgsrc/mk/extract/extract.mk:1.44
--- pkgsrc/mk/extract/extract.mk:1.43 Thu Jan 6 10:19:11 2022
+++ pkgsrc/mk/extract/extract.mk Wed Nov 23 13:30:38 2022
@@ -1,4 +1,4 @@
-# $NetBSD: extract.mk,v 1.43 2022/01/06 10:19:11 schmonz Exp $
+# $NetBSD: extract.mk,v 1.44 2022/11/23 13:30:38 jperkin Exp $
#
# The following variables may be set by the package Makefile and
# specify how extraction happens:
@@ -112,9 +112,9 @@ extract-message:
.PHONY: extract-dir
extract-dir:
- ${RUN}${MKDIR} ${EXTRACT_DIR}
+ @${MKDIR} ${EXTRACT_DIR}
.for f in ${EXTRACT_ONLY}
- ${RUN}${MKDIR} ${EXTRACT_DIR.${f}}
+ @${MKDIR} ${EXTRACT_DIR.${f}}
.endfor
######################################################################
@@ -126,10 +126,11 @@ extract-dir:
.PHONY: extract-check-interactive
extract-check-interactive:
.if !empty(INTERACTIVE_STAGE:Mextract) && defined(BATCH)
- @${ERROR_MSG} "The extract stage of this package requires user interaction"
- @${ERROR_MSG} "Please extract manually with:"
- @${ERROR_MSG} " \"cd ${.CURDIR} && ${MAKE} extract\""
- ${RUN} ${FALSE}
+ ${RUN} \
+ ${ERROR_MSG} "The extract stage of this package requires user interaction"; \
+ ${ERROR_MSG} "Please extract manually with:"; \
+ ${ERROR_MSG} " \"cd ${.CURDIR} && ${MAKE} extract\""; \
+ ${FALSE}
.else
@${DO_NADA}
.endif
@@ -142,9 +143,10 @@ extract-check-interactive:
###
.PHONY: extract-cookie
extract-cookie:
- ${RUN}${TEST} ! -f ${_COOKIE.extract} || ${FALSE}
- ${RUN}${MKDIR} ${_COOKIE.extract:H}
- ${RUN}${ECHO} ${PKGNAME} > ${_COOKIE.extract}
+ ${RUN} \
+ ${TEST} ! -f ${_COOKIE.extract} || ${FALSE}; \
+ ${TEST} -d ${_COOKIE.extract:H} || ${MKDIR} ${_COOKIE.extract:H}; \
+ ${ECHO} ${PKGNAME} > ${_COOKIE.extract}
######################################################################
### pre-extract, do-extract, post-extract (PUBLIC, override)
Index: pkgsrc/mk/package/package.mk
diff -u pkgsrc/mk/package/package.mk:1.27 pkgsrc/mk/package/package.mk:1.28
--- pkgsrc/mk/package/package.mk:1.27 Tue May 7 19:36:44 2019
+++ pkgsrc/mk/package/package.mk Wed Nov 23 13:30:38 2022
@@ -1,4 +1,4 @@
-# $NetBSD: package.mk,v 1.27 2019/05/07 19:36:44 rillig Exp $
+# $NetBSD: package.mk,v 1.28 2022/11/23 13:30:38 jperkin Exp $
#
# This file provides the code for the "package" phase.
#
@@ -63,9 +63,10 @@ package-message:
###
.PHONY: package-cookie
package-cookie:
- ${RUN} ${TEST} ! -f ${_COOKIE.package} || ${FALSE}
- ${RUN} ${MKDIR} ${_COOKIE.package:H}
- ${RUN} ${ECHO} ${PKGNAME} > ${_COOKIE.package}
+ ${RUN} \
+ ${TEST} ! -f ${_COOKIE.package} || ${FALSE}; \
+ ${TEST} -d ${_COOKIE.package:H} || ${MKDIR} ${_COOKIE.package:H}; \
+ ${ECHO} ${PKGNAME} > ${_COOKIE.package}
######################################################################
### The targets below are run with elevated privileges.
Index: pkgsrc/mk/tools/bsd.tools.mk
diff -u pkgsrc/mk/tools/bsd.tools.mk:1.64 pkgsrc/mk/tools/bsd.tools.mk:1.65
--- pkgsrc/mk/tools/bsd.tools.mk:1.64 Sun May 2 11:06:13 2021
+++ pkgsrc/mk/tools/bsd.tools.mk Wed Nov 23 13:30:38 2022
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.tools.mk,v 1.64 2021/05/02 11:06:13 nia Exp $
+# $NetBSD: bsd.tools.mk,v 1.65 2022/11/23 13:30:38 jperkin Exp $
#
# Copyright (c) 2005, 2006 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -111,9 +111,10 @@ tools-message:
###
.PHONY: tools-cookie
tools-cookie:
- ${RUN} ${TEST} ! -f ${_COOKIE.tools} || ${FALSE}
- ${RUN} ${MKDIR} ${_COOKIE.tools:H}
- ${RUN} ${ECHO} ${USE_TOOLS:Q} > ${_COOKIE.tools}
+ ${RUN} \
+ ${TEST} ! -f ${_COOKIE.tools} || ${FALSE}; \
+ ${TEST} -d ${_COOKIE.tools:H} || ${MKDIR} ${_COOKIE.tools:H}; \
+ ${ECHO} ${USE_TOOLS:Q} > ${_COOKIE.tools}
######################################################################
### override-tools (PRIVATE)
Home |
Main Index |
Thread Index |
Old Index