bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #46013] Command overrides added to MAKEOVERRIDES are lost if there


From: anonymous
Subject: [bug #46013] Command overrides added to MAKEOVERRIDES are lost if there were no overrides in the command line
Date: Mon, 28 Sep 2015 16:59:35 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; Trident/7.0; rv:11.0) like Gecko

Follow-up Comment #1, bug #46013 (project make):

Simplified example:


#!/bin/bash
#
exec gmake --warn-undefined-variables -f "$0" "$@"

$(warning Global 1: TEST == ${TEST})
# I took the liberty of adding "export"
export override TEST :=${TEST}.
$(warning Global 2: TEST == ${TEST})

1 2:
        $(warning From target $@: TEST == ${TEST})
        $(if $(filter 1,$@),@${MAKE} -f $(firstword ${MAKEFILE_LIST}) 2



# Executed like this you get ".." in the 2nd invocation:
~ example.sh
# Executed like this the command-line variable cannot be
# overridden for recursive make calls; TEST is always "x."
~ example.sh TEST=x
# Executed like this you get "x.." in the 2nd invocation:
~ TEST=x example.sh
~ example.sh -e TEST=x



I'm of the opinion this /not/ unexpected behavior.  The documentation says
nothing about overriding for recursive make invocations when you use the
"override" keyword.  Furthermore, it's probably better practice to explicitly
pass along a MAKE variable to recursive make instances instead of it being
implicit, otherwise tracking down a bug related to it could be more
problematic.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?46013>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]