I have a project with a large number of subdirectories, only a few of which need to be built at any one time. Automake successfully builds only the desired directories using AM_CONDITIONAL.

However, ideally I would like to only run configure in the directories to be built. Configuration can take quite a while, and I'm not sure I want to use a cache (if that would even help much). It is possible to set AC_CONFIG_SUBDIRS conditionally such as with:

if test "opt" = true; then
  AC_CONFIG_SUBDIRS[opt]
else
  AC_CONFIG_SUBDIRS[bin]
fi

This does configure as desired, but the distclean target -- which uses DIST_SUBDIRS instead of SUBDIRS -- fails in the directories not configured (obviously -- no Makefile).

In this case, I would want distclean to attempt to run in all DIST_SUBDIRS, but issue a warning and continue if a Makefile is not found. As it is distclean issues an error and exits. I'd live with being able to set distclean to use SUBDIRS, but this could lead to an incomplete distclean in some cases.

Any suggestions?


- Matt







Reply via email to