We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,510 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

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

2
Contributors
1
Reply
3 Hours
Discussion Span
1 Year Ago
Last Updated
2
Views
marirs07
Light Poster
36 posts since Nov 2009
Reputation Points: 7
Solved Threads: 0
Skill Endorsements: 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 Posting Shark
851 posts since Feb 2011
Reputation Points: 253
Solved Threads: 155
Skill Endorsements: 7

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.3114 seconds using 2.65MB