GNOME Bugzilla – Bug 638453
Do not regenerate / touch st.h when not needed
Last modified: 2011-01-03 23:20:12 UTC
See patch.
Created attachment 177328 [details] [review] Build: stop regenerating st.h when not needed Use the same approach as other generated headers (a temporary file, compare to the existing, then copy), to avoid regenerating st.h, so that other dependent objects are not rebuilt, if not needed. It should speed up building when switching git branches, as often config.status or automake are run, causing Makefiles to be recreated.
Review of attachment 177328 [details] [review]: Basically fine to commit, some consistency issues with the other rules that would be better corrected before commit. Subject line might be better as 'stop updating timestamp on st.h when not changed' since precisely speaking it does get regenerated. ::: src/Makefile-st.am @@ +104,3 @@ + @: + +stamp-st.h: Makefile Inconsistency is noise. "why is this different" takes time to figure out. So if all the other rules do this as @true and don't have a following blank line, then while the above is perfectly fine in isolation, it should be consistent in this context. @@ +108,3 @@ for name in $(st_source_h); do \ echo "#include <"$$name">"; \ + done; echo "#undef ST_H_INSIDE") > st.h.tmp && \ Similarly I'd use $@.tmp for consistency (and to reduce the chance that this rule gets cut-and-pasted and all the references don't get changed and a parallel make problem is created. This has happened before.) Yes, I know that $@.tmp is stamp-st.h.tmp not st.h.tmp - that's fine here.
Created attachment 177434 [details] [review] Build: stop updating timestamp of st.h when not needed Use the same approach as other generated headers (a temporary file, compare to the existing, then copy), to avoid touching st.h, so that other dependent objects are not rebuilt, if not needed. It should speed up building when switching git branches, as often config.status or automake are run, causing Makefiles to be recreated.
Review of attachment 177434 [details] [review]: Looks great