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&nbsp;


```
$ make # NDEBUG=1
$ make NDEBUG=1
```


Can I have automake.am to define and convey something like this to the output Makefile:


```
ifdef NDEBUG &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.