Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Makefile question: (2 Items)
   
Makefile question  
Ok, I'm having trouble forcing a makefile variable to be something for a particular build.  I've stripped it out into a 
toy file that exhibits the same problem

Makefile
---------------





$(info 1 MYPLATFORM $(MYPLATFORM) SOMEOTHERVAR $(SOMEOTHERVAR) MYQCCCALL $(MYQCCCALL))
ifeq ($(MYPLATFORM),doggy)
$(info 2 MYPLATFORM $(MYPLATFORM) SOMEOTHERVAR $(SOMEOTHERVAR) MYQCCCALL $(MYQCCCALL))
	SOMEOTHERVAR := helloworld
$(info 3 MYPLATFORM $(MYPLATFORM) SOMEOTHERVAR $(SOMEOTHERVAR) MYQCCCALL $(MYQCCCALL))
endif
$(info 4 MYPLATFORM $(MYPLATFORM) SOMEOTHERVAR $(SOMEOTHERVAR) MYQCCCALL $(MYQCCCALL))


$(info 5 MYPLATFORM $(MYPLATFORM) SOMEOTHERVAR $(SOMEOTHERVAR) MYQCCCALL $(MYQCCCALL))
mymaketarget:	MYQCCCALL := $(SOMEOTHERVAR)
$(info 6 MYPLATFORM $(MYPLATFORM) SOMEOTHERVAR $(SOMEOTHERVAR) MYQCCCALL $(MYQCCCALL))
mymaketarget:	$(info 7 MYPLATFORM $(MYPLATFORM) SOMEOTHERVAR $(SOMEOTHERVAR) MYQCCCALL $(MYQCCCALL))

-----------------------------------


Call on command line with complete output:

C:\xyz>make MYPLATFORM=doggy mymaketarget
1 MYPLATFORM doggy SOMEOTHERVAR  MYQCCCALL
2 MYPLATFORM doggy SOMEOTHERVAR  MYQCCCALL
3 MYPLATFORM doggy SOMEOTHERVAR helloworld MYQCCCALL
4 MYPLATFORM doggy SOMEOTHERVAR helloworld MYQCCCALL
5 MYPLATFORM doggy SOMEOTHERVAR helloworld MYQCCCALL
6 MYPLATFORM doggy SOMEOTHERVAR helloworld MYQCCCALL
7 MYPLATFORM doggy SOMEOTHERVAR helloworld MYQCCCALL
make: Nothing to be done for `mymaketarget'.


I don't believe the "nothing to be done" has anything to do with it, because the "real" file does not show that.  The 
infos show that, in spite of specifying mymaketarget (and several maketarget: lines get executed) the one that assigns a
 value to MQCCCALL does not get executed.

Why?  How can I force it to be set when specifying mymaketarget?

Is MYQCCCALL being set to some phantom, un-set version of SOMEOTHERVAR?  Or is that line not being executed at all, and 
why not?  := vs. = does not seem to matter.
Re: Makefile question  
Lemme ask a slightly different question.  Is this a valid dependency line?

my_make_target:   SOME_VAR   := $(SOME_OTHER_VAR)


Or is the setting of make variables on a dependency line invalid?