On Sat, Jan 22, 2022 at 05:05:00PM +0800, Xi Ruoyao wrote: > On Sat, 2022-01-22 at 16:56 +0800, 程璐璐 wrote: > > > Under the MIPS architecture, *.opt files are also generated in > > $(srcdir). > > Well, but then you should put the commands for generating those files > into contrib/gcc_update instead of Makefile.in, just like MIPS.
The MIPS does it wrong too. If the generated file is checked into the tree as in the mips case, such a make rule can be there, but it should be wrapped with ifeq($(ENABLE_MAINTAINER_RULES),true) ... endif or so. The point is, when not --enable-maintainer-mode, the gcc tree can be stored on read-only filesystem. When adding new CPUs, one just uses --enable-maintainer-mode and regenates the generated but committed files and commits them together with the changes. There are many other examples of such generated files, configure, Makefile.in from Makefile.am, etc. Jakub