summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mk/bsd.pkg.mk40
-rw-r--r--mk/bsd.pkg.subdir.mk15
-rw-r--r--mk/misc/common.mk48
3 files changed, 52 insertions, 51 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index 551bcc03931..50a535226c6 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.1920 2007/08/13 05:24:26 rillig Exp $
+# $NetBSD: bsd.pkg.mk,v 1.1921 2007/08/13 06:03:46 rillig Exp $
#
# This file is in the public domain.
#
@@ -19,15 +19,7 @@
# build
#
-.MAIN: all
-
-.if defined(.MAKEFLAGS) && !empty(.MAKEFLAGS:M-j*)
-PKG_FAIL_REASON+= "[bsd.pkg.mk] pkgsrc does not support parallel make for the infrastructure."
-PKG_FAIL_REASON+= "[bsd.pkg.mk] Run \"${MAKE} help topic=make_jobs\" to get some parallelism."
-.endif
-
-# Include any preferences, if not already included, and common definitions
-.include "${.PARSEDIR}/bsd.prefs.mk"
+.include "${.PARSEDIR}/misc/common.mk"
.if defined(EMUL_PLATFORMS) && !empty(EMUL_PLATFORMS)
. include "${.PARSEDIR}/emulator/emulator.mk"
@@ -264,31 +256,6 @@ LIBABISUFFIX?=
TOUCH_FLAGS?= -f
-# Debugging levels for this file, dependent on PKG_DEBUG_LEVEL definition
-# 0 == normal, default, quiet operation
-# 1 == all shell commands echoed before invocation
-# 2 == shell "set -x" operation
-PKG_DEBUG_LEVEL?= 0
-_PKG_SILENT= @
-_PKG_DEBUG= # empty
-_PKG_DEBUG_SCRIPT= ${SH}
-
-.if ${PKG_DEBUG_LEVEL} > 0
-_PKG_SILENT= # empty
-.endif
-
-.if ${PKG_DEBUG_LEVEL} > 1
-_PKG_DEBUG= set -x;
-_PKG_DEBUG_SCRIPT= ${SH} -x
-.endif
-
-# This variable can be prepended to all shell commands that should not
-# be printed by default, but when PKGSRC_DEBUG_LEVEL is non-zero.
-# It also re-adds the error checking that has been removed in 2004 to
-# make bmake conform to POSIX.
-#
-RUN= ${_PKG_SILENT}${_PKG_DEBUG} set -e;
-
# A few aliases for *-install targets
INSTALL= ${TOOLS_INSTALL} # XXX override sys.mk
INSTALL_PROGRAM?= \
@@ -839,8 +806,5 @@ ${_MAKEVARS_MK.${_phase_}}: ${WRKDIR}
.if make(debug)
. include "${.PARSEDIR}/bsd.pkg.debug.mk"
.endif
-.if make(help)
-. include "${.PARSEDIR}/help/help.mk"
-.endif
.include "${.PARSEDIR}/misc/warnings.mk"
.include "${.PARSEDIR}/misc/can-be-built-here.mk"
diff --git a/mk/bsd.pkg.subdir.mk b/mk/bsd.pkg.subdir.mk
index 86fa7851b61..4c599beee4a 100644
--- a/mk/bsd.pkg.subdir.mk
+++ b/mk/bsd.pkg.subdir.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.subdir.mk,v 1.66 2007/05/09 23:33:52 joerg Exp $
+# $NetBSD: bsd.pkg.subdir.mk,v 1.67 2007/08/13 06:03:46 rillig Exp $
# Derived from: FreeBSD Id: bsd.port.subdir.mk,v 1.19 1997/03/09 23:10:56 wosch Exp
# from: @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91
#
@@ -26,18 +26,7 @@
# mirror-distfiles, bulk-install, bulk-package, ${PKG_MISC_TARGETS}
#
-# Pull in stuff from mk.conf - need to check two places as this may be
-# called from pkgsrc or from pkgsrc/category.
-.if exists(${.CURDIR}/mk/bsd.prefs.mk)
-.include "${.CURDIR}/mk/bsd.prefs.mk"
-.else
-.if exists(${.CURDIR}/../mk/bsd.prefs.mk)
-.include "${.CURDIR}/../mk/bsd.prefs.mk"
-.endif # exists(${.CURDIR}/../mk/bsd.prefs.mk)
-.endif # exists(${.CURDIR}/mk/bsd.prefs.mk)
-
-
-.MAIN: all
+.include "${.PARSEDIR}/misc/common.mk"
AWK?= /usr/bin/awk
CAT?= /bin/cat
diff --git a/mk/misc/common.mk b/mk/misc/common.mk
new file mode 100644
index 00000000000..10db29c68c3
--- /dev/null
+++ b/mk/misc/common.mk
@@ -0,0 +1,48 @@
+# $NetBSD: common.mk,v 1.1 2007/08/13 06:03:46 rillig Exp $
+#
+# This file contains the definitions that are used in all directories of
+# pkgsrc -- the top-level, the categories and the packages themselves.
+#
+# User-settable variables:
+#
+# PKG_DEBUG_LEVEL
+# (See mk/help/debug.help)
+#
+# System-provided variables:
+#
+# RUN
+# This variable can be prepended to all shell commands that should
+# not be printed by default, but when PKGSRC_DEBUG_LEVEL is
+# non-zero. It also re-adds the error checking that has been
+# removed in 2004 to make bmake conform to POSIX.
+#
+
+.MAIN: all
+
+.if defined(.MAKEFLAGS) && !empty(.MAKEFLAGS:M-j*)
+PKG_FAIL_REASON+= "[bsd.pkg.mk] pkgsrc does not support parallel make for the infrastructure."
+PKG_FAIL_REASON+= "[bsd.pkg.mk] Run \"${MAKE} help topic=make_jobs\" to get some parallelism."
+.endif
+
+# Include any preferences, if not already included, and common definitions
+.include "${.PARSEDIR}/../bsd.prefs.mk"
+
+PKG_DEBUG_LEVEL?= 0
+_PKG_SILENT= @
+_PKG_DEBUG= # empty
+_PKG_DEBUG_SCRIPT= ${SH}
+
+.if ${PKG_DEBUG_LEVEL} > 0
+_PKG_SILENT= # empty
+.endif
+
+.if ${PKG_DEBUG_LEVEL} > 1
+_PKG_DEBUG= set -x;
+_PKG_DEBUG_SCRIPT= ${SH} -x
+.endif
+
+RUN= ${_PKG_SILENT}${_PKG_DEBUG} set -e;
+
+.if make(help)
+.include "${.PARSEDIR}/../help/help.mk"
+.endif