According to the official documentation(*):
------------------------------------------
Here is an example of how to define a conditional config file:
AM_CONDITIONAL([SHELL_WRAPPER], [test "x$with_wrapper" = xtrue])
AM_COND_IF([SHELL_WRAPPER],
[AC_CONFIG_FILES([wrapper:wrapper.in])])
------------------------------------------
I try to generically find out, whether examples/makefile.am exists in
a project and to automatically use it, if it exists:
------------------------------------------
AM_CONDITIONAL([HAVE_EXAMPLES_DIR], [test -f examples/makefile.am])
AM_COND_IF([HAVE_EXAMPLES_DIR], [AC_CONFIG_FILES([examples/makefile])])
------------------------------------------
But automake fails:
------------------------------------------
configure.ac:27: error: required file 'examples/makefile.in' not found
------------------------------------------