aboutsummaryrefslogtreecommitdiff
path: root/targets/Makefile.inc
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2014-11-30 00:20:20 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2014-11-30 00:20:20 +0000
commitb6209a9b5861cbf265a23afeac999cb27bfc7eae (patch)
treecccfb1631d9c3b519238efb58e573405281c0762 /targets/Makefile.inc
parentf1382cffe7703a142e8eea88242485a577c1aeb2 (diff)
downloadsrc-b6209a9b5861cbf265a23afeac999cb27bfc7eae.tar.gz
src-b6209a9b5861cbf265a23afeac999cb27bfc7eae.zip
Rename pkgs to more generic targets (that's what they are)
Reviewed by: marcel
Notes
Notes: svn path=/projects/bmake/; revision=275282
Diffstat (limited to 'targets/Makefile.inc')
-rw-r--r--targets/Makefile.inc53
1 files changed, 53 insertions, 0 deletions
diff --git a/targets/Makefile.inc b/targets/Makefile.inc
new file mode 100644
index 000000000000..58d19c83c3ab
--- /dev/null
+++ b/targets/Makefile.inc
@@ -0,0 +1,53 @@
+# $FreeBSD$
+
+.if !target(__${_this}__)
+__${_this}__:
+
+_CURDIR ?= ${.CURDIR}
+_OBJDIR ?= ${.OBJDIR}
+
+.if ${RELDIR:Mpkgs/*} != "" || ${RELDIR} == "."
+
+.if ${.MAKE.LEVEL} == 0 && ${RELDIR:Mpkgs/*} != ""
+.if make(bootstrap*) || !exists(${_CURDIR}/${.MAKE.DEPENDFILE:T})
+_bootstrap_dirdeps = yes
+.else
+# BUILD_AT_LEVEL0=no tells dirdeps.mk to use a sub-make for .CURDIR
+# This is useful if we need to leverage DIRDEPS
+BUILD_AT_LEVEL0 = no
+# this renders the rest harmless
+PKG_METHOD = no
+.endif
+.endif
+
+# The makefile in subdirs should set this to something useful
+# the default should do nothing.
+PKG_METHOD ?= none
+
+.MAIN: all
+
+.if ${build-*:${M_L_TARGETS}} != ""
+# just build the bits, skip packaging
+all:
+SHIPDIR = no
+.if ${RELDIR} != "."
+PKG_METHOD = no
+.endif
+.endif
+
+.if ${PKG_METHOD:Mno*} != ""
+all: ${PKG_METHOD}
+
+# set this to "no" for manual control
+UPDATE_DEPENDFILE ?= yes
+.endif
+
+.if ${UPDATE_DEPENDFILE:Uno} == "yes"
+.include <meta.autodep.mk>
+.endif
+
+# all the clever packaging methods go here....
+
+.endif # level 0
+
+.endif # _this