https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116400
--- Comment #14 from Iain Sandoe <iains at gcc dot gnu.org> --- (In reply to Iain Sandoe from comment #13) > (In reply to Francois-Xavier Coudert from comment #12) > > Created attachment 61532 [details] > > Regeneration script > > > > Attached is a shell script, to be placed in libgfortran/, that can be run in > > that directory to regenerated all files. If people agree with this approach, > > I would then remove the hackish "maintainer mode" code from > > libgfortran/Makefile.am, leading to behavior that is identical to other GCC > > runtime libraries: > > - maintainer mode regenerates automake/autoconf files > > - regeneration of library code is done manually by developers, through a > > script > > > > I think this is definitely more robust. Let me know what you think. > cool ... > what might be nice is to share the list by including it in both the regen > script and the Makefile... that seems like it should be possible? In addition to sharing the input list I'd think that the Makefile can have -include $(srdir)/generated_sources_list and the script can just . generated_sources_list ==== 1/ I think that the regen script should collect all the inputs into one list and do something like: for f in ${all_generated} ; do $(M4) -Dfile=$f -I./m4 powu.m4 > $f.tmp ../move-if-changed $f.tmp $f done otherwise it's going to touch all the files? 2/ if this is called from the Makefile then we definitely need to use $(M4); I guess the script can fallback to 'm4' if that is unset?