1,105,633 Community Members

Passing variables to a makefile

Member Avatar
marirs07
Light Poster
36 posts since Nov 2009
Reputation Points: -3 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Member Avatar
L7Sqr
Veteran Poster
1,006 posts since Feb 2011
Reputation Points: 179 [?]
Q&As Helped to Solve: 168 [?]
Skill Endorsements: 11 [?]
 
0
 

You can use an environment variable:

$cat Makefile

something:
        @echo ${MY_VAR}

Then you can do something like:

$ MY_VAR="DATA" make
DATA
$
You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: