[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
conditional target specific variables
From: |
Emmanuel Mayssat |
Subject: |
conditional target specific variables |
Date: |
Mon, 10 Oct 2016 14:39:08 -0700 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
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
- conditional target specific variables,
Emmanuel Mayssat <=