using makefile targets to set build options

Posted by leo grrr on Stack Overflow See other posts from Stack Overflow or by leo grrr
Published on 2010-05-06T21:15:52Z Indexed on 2010/05/06 21:18 UTC
Read the original article Hit count: 168

Filed under:

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.

© Stack Overflow or respective owner

Related posts about makefile