From nobody@FreeBSD.org  Tue Apr  2 21:37:15 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
	by hub.freebsd.org (Postfix) with ESMTP id D60A2BC6
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  2 Apr 2013 21:37:15 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id C72A5D2B
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  2 Apr 2013 21:37:15 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r32LbF1A068006
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 2 Apr 2013 21:37:15 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id r32LbF17068005;
	Tue, 2 Apr 2013 21:37:15 GMT
	(envelope-from nobody)
Message-Id: <201304022137.r32LbF17068005@red.freebsd.org>
Date: Tue, 2 Apr 2013 21:37:15 GMT
From: Garrett Cooper <yaneurabeya@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [PATCH] bmake doesn't honor BSDmakefile like pmake does
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         177593
>Category:       bin
>Synopsis:       [PATCH] bmake(1) doesn't honor BSDmakefile like pmake does
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    sjg
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 02 21:40:00 UTC 2013
>Closed-Date:    Tue Apr 09 18:50:51 UTC 2013
>Last-Modified:  Fri Jun  7 19:30:00 UTC 2013
>Originator:     Garrett Cooper
>Release:        10-CURRENT
>Organization:
EMC Isilon
>Environment:
FreeBSD fuji-current.local 10.0-CURRENT FreeBSD 10.0-CURRENT #7 r+bece424: Sat Mar 30 03:15:47 PDT 2013     root@fuji-current.local:/usr/obj/usr/src/sys/FUJI  i386
>Description:
pmake supports BSDmakefile but bmake doesn't. This patch enhances bmake to support BSDmakefile.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

From 80a80dc066a2f76b111c30378a064f3e3af56878 Mon Sep 17 00:00:00 2001
From: Garrett Cooper <yanegomi@gmail.com>
Date: Tue, 2 Apr 2013 14:28:03 -0700
Subject: [PATCH] Support BSDmakefile with bmake

Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
---
 usr.bin/bmake/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/usr.bin/bmake/Makefile b/usr.bin/bmake/Makefile
index 6cac1ec..ed4a646 100644
--- a/usr.bin/bmake/Makefile
+++ b/usr.bin/bmake/Makefile
@@ -88,6 +88,7 @@ DEFAULT_SYS_PATH?= .../share/mk:${prefix}/share/mk
 
 CPPFLAGS+= -DUSE_META
 CFLAGS+= ${CPPFLAGS}
+CFLAGS+= -DMAKEFILE_PREFERENCE_LIST="\"BSDmakefile makefile Makefile\""
 CFLAGS+= -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\"
 CFLAGS+= -I. -I${srcdir} ${XDEFS} -DMAKE_NATIVE
 CFLAGS+= ${COPTS.${.ALLSRC:M*.c:T:u}}
-- 
1.8.1.3



>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->sjg 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Tue Apr 2 22:05:32 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=177593 

Date: Tue, 2 Apr 2013 15:19:19 -0700
From: "Simon J. Gerraty" <sjg@juniper.net>
To: Garrett Cooper <yaneurabeya@gmail.com>
Cc: <sjg@juniper.net>, <FreeBSD-gnats-submit@FreeBSD.org>
Subject: Re: Fwd: bin/177593: [PATCH] bmake doesn't honor BSDmakefile like pmake does

 There is no need for a code change:
 
 Index: share/mk/sys.mk
 ===================================================================
 --- share/mk/sys.mk	(revision 248991)
 +++ share/mk/sys.mk	(working copy)
 @@ -333,6 +333,9 @@
  # Tell bmake to expand -V VAR by default
  .MAKE.EXPAND_VARIABLES= yes
  
 +# Tell bmake the makefile preference
 +.MAKE.MAKEFILE_PREFERENCE ?= BSDmakefile makefile Makefile
 +
  .if !defined(.PARSEDIR)
  # We are not bmake, which is more aggressive about searching .PATH
  # It is sometime necessary to curb its enthusiasm with .NOPATH

Date: Tue, 2 Apr 2013 16:48:37 -0700
From: Garrett Cooper <yaneurabeya@gmail.com>
To: "Simon J. Gerraty" <sjg@juniper.net>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: Fwd: bin/177593: [PATCH] bmake doesn't honor BSDmakefile like pmake does

 That works too..
 Thanks!
 -Garrett

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/177593: commit references a PR
Date: Wed,  3 Apr 2013 16:20:34 +0000 (UTC)

 Author: sjg
 Date: Wed Apr  3 16:20:21 2013
 New Revision: 249057
 URL: http://svnweb.freebsd.org/changeset/base/249057
 
 Log:
   Tell bmake to use the FreeBSD preferred makefile preference list.
   
   PR:		177593
   Reviewed by:	obrien
 
 Modified:
   head/share/mk/sys.mk
 
 Modified: head/share/mk/sys.mk
 ==============================================================================
 --- head/share/mk/sys.mk	Wed Apr  3 16:02:01 2013	(r249056)
 +++ head/share/mk/sys.mk	Wed Apr  3 16:20:21 2013	(r249057)
 @@ -333,6 +333,9 @@ OBJFORMAT?=	elf
  # Tell bmake to expand -V VAR by default
  .MAKE.EXPAND_VARIABLES= yes
  
 +# Tell bmake the makefile preference
 +.MAKE.MAKEFILE_PREFERENCE?= BSDmakefile makefile Makefile
 +
  .if !defined(.PARSEDIR)
  # We are not bmake, which is more aggressive about searching .PATH
  # It is sometime necessary to curb its enthusiasm with .NOPATH
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: sjg 
State-Changed-When: Tue Apr 9 18:49:41 UTC 2013 
State-Changed-Why:  
Fixed by setting .MAKE.MAKEFILE_PREFERENCE in sys.mk 
submitter confirmed resolution. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=177593 

From: Bryan Drewery <bdrewery@FreeBSD.org>
To: Simon Gerraty <sjg@juniper.net>
Cc: bug-followup@FreeBSD.org, yaneurabeya@gmail.com
Subject: Re: bin/177593: [PATCH] bmake(1) doesn&#39;t honor BSDmakefile like
 pmake does
Date: Fri, 07 Jun 2013 11:57:15 -0500

 Hi Simon,
 
 This is not working for me on CURRENT r251493. Patch to fix below.
 
 It does pick up the .MAKE.MAKEFILE_PREFERENCE from /usr/share/mk/sys.mk,
 but does not honor it.
 
 > [bryan@c1100_1 ~/test]$ make -dA 2>&1|grep .MAKE.MAKEFILE_PREFERENCE
 > ParseReadLine (337): '.MAKE.MAKEFILE_PREFERENCE?= BSDmakefile makefile
 > Makefile'
 > .MAKE.MAKEFILE_PREFERENCE = makefile Makefile
 > .MAKE.MAKEFILE_PREFERENCE = makefile Makefile
 
 >
 > [bryan@c1100_1 ~/test]$ make -V .MAKE.MAKEFILE_PREFERENCE
 > makefile Makefile
 >
 > [bryan@c1100_1 ~/test]$ grep '.' *
 > BSDmakefile:all:
 > BSDmakefile:    @echo in BSDmakefile
 > Makefile:all:
 > Makefile:       @echo in Makefile
 > makefile:all:
 > makefile:       @echo in makefile
 >
 >
 > [bryan@c1100_1 ~/test]$ make
 > in makefile
 > [bryan@c1100_1 ~/test]$ mv makefile makefile.ignore
 > [bryan@c1100_1 ~/test]$ make
 > in Makefile
 > [bryan@c1100_1 ~/test]$
 > [bryan@c1100_1 ~/test]$ make .MAKE.MAKEFILE_PREFERENCE='BSDmakefile
 > makefile Makefile'
 > in BSDmakefile
 
 Additionally, the BSDmakefile is missing from the bmake.1 manpage. It
 was previously documented for the old make.
 
 This patch fixes .MAKE.MAKEFILE_PREFERENCE to only set the default if
 the variable is not set.
 
 http://people.freebsd.org/~bdrewery/bmake-BSDmakefile.diff
 <http://people.freebsd.org/%7Ebdrewery/bmake-BSDmakefile.diff>
 
 With patch:
 > [bryan@c1100_1 ~/test]$ make
 > in BSDmakefile
 > [bryan@c1100_1 ~/test]$ make .MAKE.MAKEFILE_PREFERENCE='makefile Makefile'
 > in makefile
 > [bryan@c1100_1 ~/test]$ make .MAKE.MAKEFILE_PREFERENCE='Makefile'
 > in Makefile
 > [bryan@c1100_1 ~/test]$ make -f Makefile
 > in Makefile
 
 
 -- 
 Regards,
 Bryan Drewery
 

From: "Simon J. Gerraty" <sjg@juniper.net>
To: Bryan Drewery <bdrewery@FreeBSD.org>
Cc: <bug-followup@FreeBSD.org>, <yaneurabeya@gmail.com>
Subject: Re: bin/177593: [PATCH] bmake(1) doesn&#39;t honor BSDmakefile like pmake does
Date: Fri, 7 Jun 2013 12:09:16 -0700

 On Fri, 7 Jun 2013 11:57:15 -0500, Bryan Drewery writes:
 >It does pick up the .MAKE.MAKEFILE_PREFERENCE from /usr/share/mk/sys.mk,
 >but does not honor it.
 >
 >> [bryan@c1100_1 ~/test]$ make -dA 2>&1|grep .MAKE.MAKEFILE_PREFERENCE
 >> ParseReadLine (337): '.MAKE.MAKEFILE_PREFERENCE?= BSDmakefile makefile
 
 Which would imply it should be = rather than ?=
 or that make should set its default later.
 As in your diff - which looks reasonable.
 
 For now, replacing ?= with = in sys.mk should fix your problem.
 
 >Additionally, the BSDmakefile is missing from the bmake.1 manpage. It
 >was previously documented for the old make.
 
 The difference is that BSDmakefile doesn't mean anything to bmake
 itself - so not sure it should be documented there.
 If it were, this would be a local change rather - which I'd like to avoid
 if possible.
 
 >This patch fixes .MAKE.MAKEFILE_PREFERENCE to only set the default if
 >the variable is not set.
 
 Thanks!
 --sjg
 
 
>Unformatted:
