On Mon, Jun 28, 2010 at 11:43, Gary <[email protected]> wrote: > What is the accepted way to do this, please? > > At the moment I have > ,----[ Makefile ] > |... > | DEBUG_OPT=-D _DEBUG > | CFLAGS=${DEBUG} ... > |... > | debug: > | $(MAKE) DEBUG="${DEBUG_OPT}" > `---- > > So if I want to build everything as debug, I just do > ,---- > | $ make debug > `---- > > And if I want to build single targets, I do > ,---- > | $ env DEBUG='-D _DEBUG' make ./Src/equipment/manufacturer/foo/bar.php > `---- > > It's a bit clumsy in the latter case, but it works. Is there a better > solution?
I'm using for smal Makefiles this: --8<-- ifdef DEBUG CFLAGS+=-D _DEBUG endif -->8-- and use it like this: $ make DEBUG=1 <target> Bert > > > _______________________________________________ > Help-make mailing list > [email protected] > http://lists.gnu.org/mailman/listinfo/help-make > _______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
