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
A:
@echo $(FLAG)
B:
@echo $(FLAG)
-----
The two rules shows that it works if you try the Makefile.
Sam
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make