Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using makefile targets to set build options

Tags:

makefile

This is either trivial or runs counter to the philosophy of how make should be used, but I'd like to have a command line that reads as "make debug" rather than "make DEBUG=1". I tried creating a phony target called debug that did nothing except set the DEBUG variable, but then there was a difference between "make debug build" and "make build debug"--namely that in one case, the variable got set after the build happened.

Is there a way to give certain targets precedence?

Thanks for your help.

like image 646
leoger Avatar asked May 06 '10 21:05

leoger


1 Answers

See 'Target-specific variable values' in this page.

like image 129
bmargulies Avatar answered Sep 25 '22 08:09

bmargulies