Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 May 2012 16:54:42 -0500
From:      "Bryan Drewery" <bryan@shatow.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/167850: [PATCH] Mk: Add a Makefile for quick 'make -V' lookups
Message-ID:  <20120513215504.CA57C106566B@hub.freebsd.org>
Resent-Message-ID: <201205132200.q4DM0Ed8099742@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         167850
>Category:       ports
>Synopsis:       [PATCH] Mk: Add a Makefile for quick 'make -V' lookups
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 13 22:00:14 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Bryan Drewery
>Release:        FreeBSD 8.3-RELEASE i386
>Organization:
>Environment:

	
>Description:
	This patch simply adds a no-op Makefile to /usr/ports/Mk. It's intended to allow
	scripts to lookup global make.conf variables, including bsd.port.mk vars, in a quick
	way without depending on a port.

	For example, if a script wanted see if WITH_PKGNG was defined, it typically would do:
	WITH_PKGNG=`make -C /usr/ports -VWITH_PKGNG`

	This works, but is slow due to all of the subdir code, and takes 6 seconds on my machine.
	The patch makes this 0.19 seconds to process.

	Additionally, /usr/ports/Makefile doesn't pull in all of the bsd.port.mk variables, so
	it is more challenging to lookup variables such as MAKE_JOBS_NUMBER without using a port.
	`FORCE_MAKE_JOBS=yes make -C /usr/ports -VMAKE_JOBS_NUMBER` does not work
	`FORCE_MAKE_JOBS=yes make -C /usr/ports/$someport -VMAKE_JOBS_NUMBER` does work, but adds an
	unnecessary port dependency.

	The Makefile defines 1 target which tells the user there is nothing to do.

	The patch would benefit scripts such as ports-mgmt/portupgrade, ports-mgmt/portmaster
	ports-mgmt/poudriere as they check for various variables in /usr/ports using this method.

>How-To-Repeat:
	
>Fix:

	Patch is relative to Mk dir.

--- patch-Mk-Makefile.txt begins here ---
--- /dev/null	2012-05-13 16:23:20.000000000 -0500
+++ Makefile	2012-05-13 16:22:58.513083080 -0500
@@ -0,0 +1,8 @@
+# $FreeBSD$
+# This file is just meant to give a quick way to get
+# make variables for shell scripts.
+# CC=`make -C /usr/ports/Mk -VCC`
+all:
+	@echo "Nothing to build here."
+
+.include <bsd.port.mk>
--- patch-Mk-Makefile.txt ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120513215504.CA57C106566B>