Friday, September 11, 2015 "option subdir-objects is disabled" Warning and Fix

The "option subdir-objects is disabled" warning is thrown-up by GNU autotools when builds a source file in a subdirectory located beneath the's file. This is an example warning:
.. warning: source file '$(srcdir)/test.c' is in a subdirectory,
.. but option 'subdir-objects' is disabled
This warning is not fatal. What it means roughly: the generated object file will not be placed inside the same directory as the source code. The full explanation is at (scroll-down to subdir-objects option). This is the important excerpt:

If this option is specified, then objects are placed into the subdirectory of the build directory corresponding to the subdirectory of the source file. For instance, if the source file is subdir/file.cxx, then the output file would besubdir/file.o.
Fixing this problem is not hard, you just need to add the subdir-objects option to Below is an example taken from in one of my project. I placed the statement as the first entry in
AUTOMAKE_OPTIONS = subdir-objects
### ...
### Other statements
### ...
Hopefully, this helps out those experiencing this problem.
Post a Comment

No comments: