From owner-freebsd-bugs@FreeBSD.ORG Thu Jul 1 01:30:10 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6004816A4CF for ; Thu, 1 Jul 2004 01:30:10 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5674843D48 for ; Thu, 1 Jul 2004 01:30:10 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i611UAXm026648 for ; Thu, 1 Jul 2004 01:30:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i611UA2C026647; Thu, 1 Jul 2004 01:30:10 GMT (envelope-from gnats) Date: Thu, 1 Jul 2004 01:30:10 GMT Message-Id: <200407010130.i611UA2C026647@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: John E Hein Subject: Re: bin/68534: make(1) - ${.MAKEFLAGS} does not contain cmd line args X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: John E Hein List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jul 2004 01:30:10 -0000 The following reply was made to PR bin/68534; it has been noted by GNATS. From: John E Hein To: Giorgos Keramidas Cc: bug-followup@freebsd.org Subject: Re: bin/68534: make(1) - ${.MAKEFLAGS} does not contain cmd line args Date: Wed, 30 Jun 2004 19:22:20 -0600 This is interesting env var precedence weirdness... $ cat Makefile FOO?=0 X?=0 .PHONY: x x: @echo MAKEFLAGS: ${MAKEFLAGS} @echo .MAKEFLAGS: ${.MAKEFLAGS} @echo FOO: ${FOO} .if $X != 1 make X=1 .endif $ env FOO=1 MAKEFLAGS=FOO=3 make FOO=2 MAKEFLAGS: FOO=3 .MAKEFLAGS: FOO: 2 make X=1 MAKEFLAGS: FOO=3 .MAKEFLAGS: FOO: 3 $ env FOO=1 make FOO=2 MAKEFLAGS: .MAKEFLAGS: FOO: 2 make X=1 MAKEFLAGS: .MAKEFLAGS: FOO: 2 In the first case FOO=3 is inserted in the environment by make via MAKEFLAGS. In the second case FOO=1 is inserted in the environment in a more generic way. Why does FOO=2 (the cmd line variable) override FOO in the environment in the first case, but not the second? I'm going to have a look in the source. And finally... $ env FOO=1 make -E FOO FOO=2 MAKEFLAGS: -E FOO .MAKEFLAGS: -E FOO FOO: 2 make X=1 MAKEFLAGS: -E FOO .MAKEFLAGS: -E FOO FOO: 2 But that is as expected. It's case 2 that puzzles me. Whoa, wait a second. There's some stuff from the command line in MAKEFLAGS now. So I guess the bug is that only CERTAIN things from the command line show up in MAKEFLAGS>