954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Passing variables to a makefile

Hi all,

I would like to call a makefile with a particular variable and value so that the variable is used to make decisions inside the makefile.

Thanks

marirs07
Light Poster
36 posts since Nov 2009
Reputation Points: 7
Solved Threads: 0
 

You can use an environment variable:

$cat Makefile

something:
        @echo ${MY_VAR}

Then you can do something like:

$ MY_VAR="DATA" make
DATA
$
L7Sqr
Practically a Master Poster
657 posts since Feb 2011
Reputation Points: 201
Solved Threads: 124
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: