I hit this problem in GRUB2 and still am not sure what is the best way to proceed.
GRUB2 autogenerates Makefile.am (using autogen), and Makefile.am basically consists of series if PLATFORM_A_ENABLED module_1_SOURCES = ... ... EXTRA_DIST += ... ... endif if PLATFORM_B_ENABLED module_1_sources = ... ... EXTRA_DIST += ... ... endif for every object (module, program, etc) that is built. The problem is, some objects are not built for every supported platform. If grub2 is configured for such platform, "make dist" will be missing EXTRA_DIST snippets for such objects, and using such tarball will fail on other platforms. The problem so far seems to be restricted to EXTRA_DIST only; other parts (SOURCES, SCRIPTS or even dist_DATA) all gets collected even if put under condition that evaluates to false. So what is the best way to actually solve it? Empirically using dist_noinst_DATA instead of EXTRA_DATA does solve the problem (dist_noinst_DATA is apparently honored even when condition itself is disabled). Alternative is to place EXTRA_DIST outside of conditionals, but this is more intrusive probably. I could not find definitive description in automake documentation which files are collected for distribution in presence of conditionals. Can I rely on dist_xxx_DATA being stable in the future? This is automake 1.12. TIA -andrey