Re: if vs. ifdef in Makefile.am

Jacob Bachmeyer <[email protected]>
Newsgroups gmane.comp.sysutils.automake.general
Message-ID <[email protected]>
Bogdan wrote:
> [...]
>  Probably Nick's suggestion (a new option to ./configure or the 
> AC_HEADER_ASSERT macro) would be the most future-proof, but it 
> requires running ./configure each time you wish to change the build 
> type (which maybe is not a bad idea, it depends).

That would probably be a very good idea, to avoid mixing files built for 
one mode with files built for another.  Even easier:  use separate build 
directories for each type, from a common source directory, like so:

$ : ... starting one directory above the source tree in ./src/ ...
$ (mkdir test-build; cd ./test-build && ../src/configure --enable-assert 
...)
$ (mkdir release-build; cd ./release-build && ../src/configure 
--disable-assert ...)

Now you avoid conflating modules for test and release builds and ending 
up with an executable that you cannot reliably replicate.  A simple flag 
to make is unlikely to be properly recognized as a dependency for all 
objects built.


-- Jacob
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.