From nobody@FreeBSD.org  Tue Oct  8 02:35:25 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id 9C27175C
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  8 Oct 2013 02:35:25 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 706182929
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  8 Oct 2013 02:35:25 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r982ZPfC088584
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 8 Oct 2013 02:35:25 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r982ZP6q088577;
	Tue, 8 Oct 2013 02:35:25 GMT
	(envelope-from nobody)
Message-Id: <201310080235.r982ZP6q088577@oldred.freebsd.org>
Date: Tue, 8 Oct 2013 02:35:25 GMT
From: Edwin Groothuis <edwin@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: gmake strangeness on 10.0 Alpha 4
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         182821
>Category:       ports
>Synopsis:       devel/gmake strangeness on 10.0 Alpha 4
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    autotools
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 08 02:40:00 UTC 2013
>Closed-Date:    Thu Oct 24 10:23:46 UTC 2013
>Last-Modified:  Fri Oct 25 04:40:01 UTC 2013
>Originator:     Edwin Groothuis
>Release:        10.0-ALPHA4
>Organization:
-
>Environment:
FreeBSD f10 10.0-ALPHA4 FreeBSD 10.0-ALPHA4 #0 r255933: Sun Sep 29 02:50:54 UTC 2013     root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
While trying to fix this:
http://pb2.nyi.freebsd.org/bulk/exp-bdrewery-default/2013-08-23_16h05m22s/logs/errors/ngrep-1.45.log

The ports Makefile is attached below, the Makefile in the tar-ball shows:
all:
        echo all/MAKEFLAGS: ${MAKEFLAGS}

That's all. No magic there.


This is how it works on 9.1:
===>  Building for test-1.45
gmake: Warning: File `Makefile' has modification time 39188 s in the future
echo all/MAKEFLAGS:  --jobserver-fds=3,4 -j -- DESTDIR=/usr/home/edwin/port/work/stage SYSTEMVERSION= OSVERSION=901000 OSREL=9.1 OPSYS=FreeBSD ARCH=amd64
all/MAKEFLAGS: --jobserver-fds=3,4 -j -- DESTDIR=/usr/home/edwin/port/work/stage SYSTEMVERSION= OSVERSION=901000 OSREL=9.1 OPSYS=FreeBSD ARCH=amd64

All arguments are sane.


On 10.0 ALPHA 4, it shows:
===>  Building for test-1.45
gmake[1]: Entering directory `/usr/home/edwin/ports/net/test/work/test-1.45'
echo all/MAKEFLAGS: w -- DESTDIR=/usr/home/edwin/ports/net/test/work/stage SYSTEMVERSION= OSVERSION=1000055 OSREL=10.0 OPSYS=FreeBSD ARCH=amd64 .MAKE.LEVEL.ENV=MAKELEVEL
all/MAKEFLAGS: w -- DESTDIR=/usr/home/edwin/ports/net/test/work/stage SYSTEMVERSION= OSVERSION=1000055 OSREL=10.0 OPSYS=FreeBSD ARCH=amd64 .MAKE.LEVEL.ENV=MAKELEVEL
gmake[1]: Leaving directory `/usr/home/edwin/ports/net/test/work/test-1.45'

Now there is a "w" there. And I don't know why....
>How-To-Repeat:
Use this ports Makefile:

# Created by: David O'Brien (obrien@NUXI.com)
# $FreeBSD: head/net/ngrep/Makefile 327755 2013-09-20 22:10:23Z bapt $

PORTNAME=       test
PORTVERSION=    1.45
CATEGORIES=     net security
MASTER_SITES=   http://www.mavetju.org/~edwin/

MAINTAINER=     edwin@mavetju.org
COMMENT=        Network grep

USES=           gmake

.include <bsd.port.mk>

run make.
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->autotools 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Oct 21 05:45:00 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

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

From: Tijl Coosemans <tijl@FreeBSD.org>
To: bug-followup@FreeBSD.org, edwin@FreeBSD.org
Cc: "Simon J. Gerraty" <sjg@FreeBSD.org>
Subject: Re: ports/182821: devel/gmake strangeness on 10.0 Alpha 4
Date: Wed, 23 Oct 2013 16:15:13 +0200

 http://www.freebsd.org/cgi/query-pr.cgi?pr=182821
 
 CCing Simon who may know more about this.
 
 
 If you run "gmake -w" on your Makefile you get the same result for
 MAKEFLAGS so I suspect that gmake adds this 'w' to MAKEFLAGS when it
 detects it's a submake (or something).  That leaves the question of
 why it does that when run from bmake and not from fmake though.


From: Edwin
 I mailed this no 8 October:
 http://lists.gnu.org/archive/html/help-make/2009-10/msg00061.html

 On Sat, 2009-10-31 at 07:32 -0700, RobinK wrote:
 > But this is inconvenient. I do want it to print the directory, but I
 > don't want that "w" to be in $(MAKEFLAGS). Plus, even if it has to add
 > the w, shouldn't it be "-w" rather than just a "w"? The extra w
 > totally messed up my makefile in the sub directory.
 
 This is exactly how it's supposed to work.  Read about MAKEFLAGS in the
 GNU make manual to know why there's no leading "-".
 
 If it messed up your makefile, then your makefile is not correct.
 Remember that MAKEFLAGS is an INTERNAL variable, intended for use by
 make to pass information to sub-makes through the environment.  It is
 not intended to ever be used in a command line; for example you would
 never write:
 
         foo:
                $(MAKE) $(MAKEFLAGS)

 or something like that.

State-Changed-From-To: open->closed 
State-Changed-By: edwin 
State-Changed-When: Thu Oct 24 10:22:35 UTC 2013 
State-Changed-Why:  
False alarm. 

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

From: "Simon J. Gerraty" <sjg@juniper.net>
To: Tijl Coosemans <tijl@freebsd.org>
Cc: <bug-followup@freebsd.org>, <edwin@freebsd.org>
Subject: Re: ports/182821: devel/gmake strangeness on 10.0 Alpha 4
Date: Thu, 24 Oct 2013 21:37:00 -0700

 On Wed, 23 Oct 2013 16:15:13 +0200, Tijl Coosemans writes:
 >http://www.freebsd.org/cgi/query-pr.cgi?pr=182821
 
 >If you run "gmake -w" on your Makefile you get the same result for
 >MAKEFLAGS so I suspect that gmake adds this 'w' to MAKEFLAGS when it
 >detects it's a submake (or something).  That leaves the question of
 >why it does that when run from bmake and not from fmake though.
 
 A number of changes were made to NetBSD's make this year to make it
 "interoperate" with gmake in this way (some were prompted by a complaint
 from someone in FreeBSD about the variable used to communicate recursion
 level). 
 
 So nowwhen gmake runs bmake, or bmake runs gmake they agree on recusion level.
 Even -w works the same....
 
 Good or bad? hard to say.
 
 
>Unformatted:
