Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In GNU make, you can use Target-specific Variable Values (https://www.gnu.org/software/make/manual/make.html#Target_00...)

You can also do

  DEBUG ?= 1
  ifeq ($(DEBUG), 1)
    CFLAGS =<whatever you want>
  else
    CFLAGS=<whatever you want>
  endif
and then build with

  make DEBUG=0
for the release build.

In BSD make, you can use something like

  .ifmake target
  CFLAGS := <whatever you want>
  .else
  CFLAGS := <whatever you want>
  .endif


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: