if vs. ifdef in Makefile.am
"ljh" via Discussion list for automake <[email protected]>
| Newsgroups | gmane.comp.sysutils.automake.general |
|---|---|
| Message-ID | <[email protected]> |
Hi community, I want to build debug or release with ``` $ make # NDEBUG=1 $ make NDEBUG=1 ``` Can I have automake.am to define and convey something like this to the output Makefile: ``` ifdef NDEBUG # if vs. ifdef CPPFLAGS += -DNDEBUG CFLAGS += -O3 # .cpp else CFLAGS += -g # .cpp LDFLAGS += -fsanitize=address endif ``` But it seems I can only write `if` but not `ifdef` in Makefile.am. So I had to enable ndebug option in configure.ac. That's a lot more work. Thanks