It would be good to generate the wesnoth_SOURCES automatic variable (and its ilk) in src/Makefile.am from an external list of files, so that other build systems can reuse the list, and so that we can generate POTFILES.in automatically from these files. Right now we have multiple lists of sources, and they do get out of synch, leading to confusion and wasted time debugging problems that wouldn't occur if there was a single copy of this data.
As jdorje pointed out, using an AC_SUBST autoconf mechanism via configure.ac isn't going to work, since automake needs to have these substitutions done before the automagic creation of rules that is associated with _SOURCES variables. Unfortunately automake also seems to explicitly _not_ support substitutions in _SOURCES variables. In fact automake seems to make the assumption that the Makefile.am is the "ur-file" in the build process, the root of the dependency tree. Of course, we could go along with this, and extract the plain file lists from Makefile.am for use by others (including the POTFILES.in creation), but this seems back-to-front. It certainly makes it inconvenient to apply automated dependency analysis tools like yann's graph-includes, or to generate the list of sources automatically. Am I missing something? Assuming that this is actually a deficiency in the autotools process, and not finding anything obvious via google, I implemented a script (mkmam) to generate src/Makefile.am from src/Makefile.am.in based on files containing the source lists. mkmam finds all instances of _SOURCES variable assignments and substitutes each instance of @NAME@ with the contents of file NAME, in proper makefile format with quoted newlines. I would like to commit the mkmam perl script, src/Makefile.am.in, as well as the three files src/wesnoth_sources, src/wesnoth_common_sources and src/wesnoth_editor_sources containing lists of sources. This would allow running 'mkmam src/Makefile.am.in' to regenerate src/Makefile.am but would also allow src/Makefile.am to remain independent of this new addition to the build process until more people have tested it. When we feel comfortable with this addition to the build process, we can add it to autogen.sh. Any objections? -- [EMAIL PROTECTED]
