[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Need some information related setting make variables during run-time
Re: Need some information related setting make variables during run-time depending on the target
Wed, 28 Jul 2010 17:44:08 +0200
On Wed, Jul 28, 2010 at 08:46:26PM +0530, Sandeep K S wrote:
> Hello Make Experts,
> I need some information on Makefiles with respect to setting some make
> variables during run time depending on the target.
> For eg:
> I have two targets A and B. For Target A, I need to set a variable FLAG as
> '-DFLAG_A', and for target B, I need to set the variable FLAG as '-DFLAG_B'.
> This FLAG variable is used in the compilation which declares two macros
> (FLAG_A and FLAG_B) for the C file to use.
It is as simple as this (if I understood your mail correct):
A: FLAG = -DFLAG_A
B: FLAG = -DFLAG_B
The two rules shows that it works if you try the Makefile.