On Tue, Apr 29, 2025 at 02:47:21PM +0100, Alice Carlotti wrote: > This demonstrates a clear benefit to make the makefile rules automatic. I > thought this might be quite tricky, but it turns out to be fairly > straightforward.
Actually, it turns out I missed at least one more thing that's needed, so the first two patches combined don't even build cleanly. The issue is that dependencies on generated files need some mechanism to ensure that the generated files are available before their dependants are built during a clean build. This means that I can't just delete the dependency aarch64-builtins.o: aarch64-builtin-iterators.h Many other generated files are currently specified as prerequisites via the rule: $(ALL_HOST_OBJS) : | $(generated_files) I think it would make sense to include the backend generated files into this variable. Currently some backend files are included, but this is done using the variables TM_H, TM_P_H, TM_D_H and TM_RUST_H variables, which looks like a misuse of these variables. The intended meaning/use of the TM_* variables is also unclear. As far as I can tell, it looks like they should list the dependencies of the corresponding files generated by mkconfig, of which the direct includes are added automatically, but this isn't quite consistent with the current values in t-aarch64. Another related observation is that aarch64-builtin-iterators.h is missing from MOSTLYCLEANFILES, so it isn't removed in a clean build. It ought to be included, and I think it would be good if we could use the same list (or mostly the same list) of generated files for both the order-only prerequiste rule and in MOSTLYCLEANFILES.