[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [XEN PATCH v6 07/31] build,include: rework compat-build-source.py
On 12.07.2021 16:35, Anthony PERARD wrote: > On Wed, Jul 07, 2021 at 04:58:29PM +0200, Jan Beulich wrote: >> On 01.07.2021 16:09, Anthony PERARD wrote: >>> Improvement are: >>> - give the path to xlat.lst as argument >>> - include `grep -v` in compat-build-source.py script, we don't need to >>> write this in several scripted language. >>> >>> Also remove dependency on Makefile as the file generation doesn't >>> depend on it anymore. >> >> Did it before any more? > > Kind of, yes, there is "grep -v" that makes the Makefile part of the > script that generates the target. > >> In the subsequent patch I can see more of >> a reason to drop the dependency, but neither there nor here I'm >> really convinced: In general I think every generate file would >> better depend on the makefile containing the rule used for its >> building, as a change to that rule means the target wants >> rebuilding. > > Does that mean that nearly every single targets should depends on a > "Makefile" or on "Rules.mk" ? :-) Well, yes, I indeed think so. > As for the current target "compat/%.c", with this patch applied, the > only few things that the content of the file depends on is the script, > the first dependency, and "xlat.lst" (also a dependency). So the > Makefile doesn't play a role into what get's into the target, the > "mkdir" and the "mv" don't really matter. If the rule where to be > changed in a way that changed the content of the target, that would be > wrong in my opinion, the change should be done in the script. > If someone wanted to rewrite the script in a different language and thus > renaming the script, that would be fine too as make would notice that > the new script is newer that the target (as the file for the script as > just been created). Right, but e.g. adding an option to the scrip invocation would then not trigger a rebuild. > But, I guess we could start to use the "if_changed" macro here to > detected rule changes. > > I really don't like when a target depends on a "Makefile" because that > means the target gets rebuilt for unrelated reason so I'd like to avoid > dependency on it when possible. I can see the background of this viewpoint, but personally I think the extra rebuilds are the price to pay to not have any rebuilds skipped when they would be needed. Overall it is my understanding that to get this more fine grained is what if_changed is for. Jan
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |