14.4.2 distcheck-hook

If the distcheck-hook rule is defined in your top-level Makefile.am, then it will be invoked by distcheck after the new distribution has been unpacked, but before the unpacked copy is configured and built. Your distcheck-hook can do almost anything, though as always caution is advised. Generally this hook is used to check for potential distribution errors not caught by the standard mechanism.

distcheck-hook, as well as AM_DISTCHECK_CONFIGURE_FLAGS and DISTCHECK_CONFIGURE_FLAGS, are not honored in a subpackage Makefile.am, but the flags from AM_DISTCHECK_CONFIGURE_FLAGS and DISTCHECK_CONFIGURE_FLAGS are passed down to the configure script of the subpackage.