summaryrefslogtreecommitdiff
path: root/mk/build
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2006-07-05 09:08:35 +0000
committerjlam <jlam@pkgsrc.org>2006-07-05 09:08:35 +0000
commit990d0b53771974e8526315776af82fd9b4961c14 (patch)
tree266445424a702f9333f761cfa65f977c42683645 /mk/build
parente3b97d774b9eb87dcd011ba0aeca7f60d35eeb86 (diff)
downloadpkgsrc-990d0b53771974e8526315776af82fd9b4961c14.tar.gz
Make the check-vulnerable target more self-sufficient, by moving some
of the logic from fetch/fetch.mk into flavor/pkg/check.mk, so that check-vulnerable can be used as a source target. Make check-vulnerable a source target for every phase of the build workflow, which ensures that it is always run if the user starts a new phase from the command line. Fix the cookie-generation targets so that they don't append, only overwrite to the cookie file. This works around potential problems due to recursive makes. Move the cookie checks so that they surround the corresponding phase target. The presence of the cookie should now inform the make process to avoid doing any processing of phases that occur before the phase corresponding to the cookie.
Diffstat (limited to 'mk/build')
-rw-r--r--mk/build/bsd.build.mk4
-rw-r--r--mk/build/build.mk13
-rw-r--r--mk/build/test.mk5
3 files changed, 12 insertions, 10 deletions
diff --git a/mk/build/bsd.build.mk b/mk/build/bsd.build.mk
index 8b1e0aaf444..7e17ab1d40a 100644
--- a/mk/build/bsd.build.mk
+++ b/mk/build/bsd.build.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.build.mk,v 1.1 2006/07/05 06:09:15 jlam Exp $
+# $NetBSD: bsd.build.mk,v 1.2 2006/07/05 09:08:35 jlam Exp $
#
# This Makefile fragment is included by bsd.pkg.mk and provides all
# variables and targets related to building sources for a package.
@@ -40,4 +40,4 @@ build: configure build-cookie
.PHONY: build-cookie
build-cookie:
${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${_BUILD_COOKIE:H}
- ${_PKG_SILENT}${_PKG_DEBUG}${ECHO} ${PKGNAME} >> ${_BUILD_COOKIE}
+ ${_PKG_SILENT}${_PKG_DEBUG}${ECHO} ${PKGNAME} > ${_BUILD_COOKIE}
diff --git a/mk/build/build.mk b/mk/build/build.mk
index db9ad7dfce8..aa559124a89 100644
--- a/mk/build/build.mk
+++ b/mk/build/build.mk
@@ -1,4 +1,4 @@
-# $NetBSD: build.mk,v 1.1 2006/07/05 06:09:15 jlam Exp $
+# $NetBSD: build.mk,v 1.2 2006/07/05 09:08:35 jlam Exp $
#
# BUILD_MAKE_FLAGS is the list of arguments that is passed to the make
# process.
@@ -14,6 +14,7 @@ BUILD_TARGET?= all
######################################################################
### build is a public target to build the sources from the package.
###
+_BUILD_TARGETS+= check-vulnerable
_BUILD_TARGETS+= configure
_BUILD_TARGETS+= acquire-build-lock
_BUILD_TARGETS+= ${_BUILD_COOKIE}
@@ -22,20 +23,20 @@ _BUILD_TARGETS+= pkginstall
.PHONY: build
.if !target(build)
+. if !exists(${_BUILD_COOKIE})
build: ${_BUILD_TARGETS}
+. else
+build:
+ @${DO_NADA}
+. endif
.endif
.PHONY: acquire-build-lock release-build-lock
acquire-build-lock: acquire-lock
release-build-lock: release-lock
-.if !exists(${_BUILD_COOKIE})
${_BUILD_COOKIE}:
${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${SETENV} ${BUILD_ENV} ${MAKE} ${MAKEFLAGS} real-build PKG_PHASE=build || ${PKG_ERROR_HANDLER.build}
-.else
-${_BUILD_COOKIE}:
- @${DO_NADA}
-.endif
PKG_ERROR_CLASSES+= build
PKG_ERROR_MSG.build= \
diff --git a/mk/build/test.mk b/mk/build/test.mk
index 6e242cf5f97..561bc340c0a 100644
--- a/mk/build/test.mk
+++ b/mk/build/test.mk
@@ -1,4 +1,4 @@
-# $NetBSD: test.mk,v 1.1 2006/07/05 06:09:15 jlam Exp $
+# $NetBSD: test.mk,v 1.2 2006/07/05 09:08:35 jlam Exp $
#
# TEST_DIRS is the list of directories in which to perform the build
# process. If the directories are relative paths, then they
@@ -19,6 +19,7 @@ TEST_MAKE_FLAGS?= ${MAKE_FLAGS}
######################################################################
### build is a public target to build the sources from the package.
###
+_TEST_TARGETS+= check-vulnerable
_TEST_TARGETS+= build
_TEST_TARGETS+= acquire-test-lock
_TEST_TARGETS+= ${_TEST_COOKIE}
@@ -120,4 +121,4 @@ post-test:
.PHONY: test-cookie
test-cookie:
${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${_TEST_COOKIE:H}
- ${_PKG_SILENT}${_PKG_DEBUG}${ECHO} ${PKGNAME} >> ${_TEST_COOKIE}
+ ${_PKG_SILENT}${_PKG_DEBUG}${ECHO} ${PKGNAME} > ${_TEST_COOKIE}