bug-make
[Top][All Lists]
Advanced

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

[bug #63347] make 4.4 change in behavior for sub-make invoked via $(shel


From: anonymous
Subject: [bug #63347] make 4.4 change in behavior for sub-make invoked via $(shell)
Date: Fri, 11 Nov 2022 15:21:16 -0500 (EST)

URL:
  <https://savannah.gnu.org/bugs/?63347>

                 Summary: make 4.4 change in behavior for sub-make invoked via
$(shell)
                 Project: make
               Submitter: None
               Submitted: Fri 11 Nov 2022 08:21:14 PM UTC
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: 4.4
        Operating System: POSIX-Based
           Fixed Release: None
           Triage Status: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Fri 11 Nov 2022 08:21:14 PM UTC By: Anonymous
It appears that make 4.3 never passed environment down to sub-make if invoked
via shell so ie if make was invoked `make CONF_VAR=foo` then `$(shell $(MAKE)
-C subdir)` would not receive `CONF_VAR=foo`.

Can't tell whether that's expected or not but big advantage of make 4.3 was
that environment was not passed consistently irrespective of where that
`$(shell $(MAKE)...)` occurs.

Now that's no longer the case with make 4.4. Let's consider following
example:

all: $(shell $(MAKE) -C subdir --no-print-directory get_conf_var)
        @echo $(shell $(MAKE) -C subdir --no-print-directory get_conf_var)

These two invocations will differ in environment:
- the one producing dependency will not have environment passed
- the one in target body will receive environment

more complete example:

$ cat Makefile
all: $(shell $(MAKE) -C lib --no-print-directory get_conf_var)
        @echo CONF_VAR=$(CONF_VAR)
        @echo get_conf_var=$(shell $(MAKE) -C lib --no-print-directory 
get_conf_var)

foo bar:
        @echo called target $@

$ cat lib/Makefile
CONF_VAR=foo
get_conf_var:
        @echo $(CONF_VAR)

$ make-4.3 CONF_VAR=bar
called target foo
CONF_VAR=bar
get_conf_var=foo

$ make-4.4 CONF_VAR=bar
called target foo
CONF_VAR=bar
get_conf_var=bar







    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63347>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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