summaryrefslogtreecommitdiff
path: root/mk/misc
diff options
context:
space:
mode:
authorrillig <rillig>2007-08-13 06:03:46 +0000
committerrillig <rillig>2007-08-13 06:03:46 +0000
commit2f56d02340e31de6da1b4c8f373eaa495808d54b (patch)
tree740b06121e4bd164ce7cbf5c20c1cc77ddb76596 /mk/misc
parent7a65d88b71538072cd942087a7f0af5279b88df2 (diff)
downloadpkgsrc-2f56d02340e31de6da1b4c8f373eaa495808d54b.tar.gz
Moved the stuff that is common to all directories of pkgsrc into its own
file. Now "make help" can be called from the top-level directory, avoiding to parse lots of buildlink3.mk files just to get some help.
Diffstat (limited to 'mk/misc')
-rw-r--r--mk/misc/common.mk48
1 files changed, 48 insertions, 0 deletions
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