summaryrefslogtreecommitdiff
path: root/mk/build/bsd.build.mk
diff options
context:
space:
mode:
authorjlam <jlam>2006-07-05 06:09:15 +0000
committerjlam <jlam>2006-07-05 06:09:15 +0000
commitae760a5261f0d8bdd629f11fc996f388ef18d597 (patch)
tree5cda57cdca85b18146d681fc321900e0b05b7666 /mk/build/bsd.build.mk
parentff1abac1968d3a2126fff67c56d713586d517e87 (diff)
downloadpkgsrc-ae760a5261f0d8bdd629f11fc996f388ef18d597.tar.gz
Refactor configure, build, test and wrapper phases out of bsd.pkg.mk
and into their own directories. Also do some cleanups with build/_build and pkginstall -- we get rid of _build and simply run pkginstall as part of the "build" target. Introduce a new mechanism to handle varying directory depths under ${WRKSRC} in which we find files to override, e.g. configure, config.*, libtool, etc. OVERRIDE_DIRDEPTH is a package-settable variable that specifies how far under ${WRKSRC} the various targets should look, and it defaults to "2". We preserve the meaning of the various *_OVERRIDE variables, so if they are defined, then their values supersede the OVERRIDE_DIRDEPTH mechanism. devel/tla will need to specially set OVERRIDE_DIRDEPTH to 3 (see log for revision 1.1857 for bsd.pkg.mk -- to be done in a separate commit.
Diffstat (limited to 'mk/build/bsd.build.mk')
-rw-r--r--mk/build/bsd.build.mk43
1 files changed, 43 insertions, 0 deletions
diff --git a/mk/build/bsd.build.mk b/mk/build/bsd.build.mk
new file mode 100644
index 00000000000..8b1e0aaf444
--- /dev/null
+++ b/mk/build/bsd.build.mk
@@ -0,0 +1,43 @@
+# $NetBSD: bsd.build.mk,v 1.1 2006/07/05 06:09:15 jlam Exp $
+#
+# This Makefile fragment is included by bsd.pkg.mk and provides all
+# variables and targets related to building sources for a package.
+#
+# The following are the "public" targets provided by this module:
+#
+# build, test
+#
+# The following targets may be overridden in a package Makefile:
+#
+# pre-build, do-build, post-build
+# pre-test, do-test, post-test
+#
+
+_BUILD_COOKIE= ${WRKDIR}/.build_done
+_TEST_COOKIE= ${WRKDIR}/.test_done
+
+######################################################################
+### build (PUBLIC)
+######################################################################
+### build is a public target to build the sources for the package.
+###
+.PHONY: build
+.if defined(NO_BUILD)
+. if !target(build)
+build: configure build-cookie
+. endif
+.else
+. include "${PKGSRCDIR}/mk/build/build.mk"
+.endif
+
+.include "${PKGSRCDIR}/mk/build/test.mk"
+
+######################################################################
+### build-cookie (PRIVATE)
+######################################################################
+### build-cookie creates the "build" cookie file.
+###
+.PHONY: build-cookie
+build-cookie:
+ ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${_BUILD_COOKIE:H}
+ ${_PKG_SILENT}${_PKG_DEBUG}${ECHO} ${PKGNAME} >> ${_BUILD_COOKIE}