Sample makefile
$ cat Makefile 
SETIN01?=0
SETIN012?=0

1: SETIN1?=1
1: SETIN12?=1
1: SETIN01?=1
1: SETIN012?=1
1: 2
    @echo "---------- 1 -------------"
    @echo " SETIN1     is $(SETIN1)"
    @echo " SETIN2     is $(SETIN2)"
    @echo " SETIN12    is $(SETIN12)"
    @echo " SETIN01    is $(SETIN01)"
    @echo " SETIN012   is $(SETIN012)"

2: SETIN2?=2
2: SETIN12?=2
2: SETIN012?=2
2:
    @echo "---------- 2 -------------"
    @echo " SETIN1     is $(SETIN1)"
    @echo " SETIN2     is $(SETIN2)"
    @echo " SETIN12    is $(SETIN12)"
    @echo " SETIN01    is $(SETIN01)"
    @echo " SETIN012   is $(SETIN012)"


# Now when I run
$ make 2
---------- 2 -------------
 SETIN1     is 
 SETIN2     is 2
 SETIN12    is 2
 SETIN01    is 0
 SETIN012   is 0

The results above are as expected. But when I run 

$ make 1
---------- 2 -------------
 SETIN1     is 1
 SETIN2     is 2
 SETIN12    is 2
 SETIN01    is 0
 SETIN012   is 0
---------- 1 -------------
 SETIN1     is 1
 SETIN2     is 
 SETIN12    is 1
 SETIN01    is 0
 SETIN012   is 0

why is in 2 SETIN12 equals to 2 instead of 1?
why is in 1 SETIN12 value different than in 2?

Because SETIN1, we can see that the variables of 1 are read (including
SETIN12), but still 2 considers that SETIN12 is not set and reset it to 2.

Why don't the variable in the 'called target' have priority on the variable
defined in its dependencies?

-- 
Emmanuel
Menlo Security, Inc.
Menlo Park, CA


_______________________________________________
Help-make mailing list
Help-make@gnu.org
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to