You can also do
DEBUG ?= 1 ifeq ($(DEBUG), 1) CFLAGS =<whatever you want> else CFLAGS=<whatever you want> endif
make DEBUG=0
In BSD make, you can use something like
.ifmake target CFLAGS := <whatever you want> .else CFLAGS := <whatever you want> .endif
You can also do
and then build with for the release build.In BSD make, you can use something like