My makefile is compiling my program for debugging. By that I mean that it passes -g -D DEBUG to the compiler. I want to be able to pass -nd for not debug or -p for production to make thus removing the debug flags from the compiler. To do this I’d need some way of putting this into make syntax: “If MAKEFLAGS is not nd then set CFLAGS to -g -D DEBUG otherwise leave it empty”
How can I do this?
If all you care about is
-nd, this will do it:If you also care about
-p, it’s not quite as clean: