On Sat, Jul 26, 2025 at 02:30:23PM -0700, Raymond Toy wrote: > On 7/25/25 5:34 PM, Gavin Smith wrote: > > > It appears from looking at maintain/generate_code_convert_data.pl that > > there is quite a bit of code in the header file that is generated, included > > but not limited to size of arrays. It may not be possible to stop > > generating > > this file, or to include it in fewer places to limit the number of files > > that depend upon it. > > > > However, I wonder if there is some Makefile trick we could use; for example, > > not updating the .h timestamp if the contents haven't changed. > > I think the book "The Unix Programming Environment" had some tricks for > this. It's been a long time since I had to deal with this. But something > along the lines of the output going somewhere else. Then doing a diff > between the current version and the old one. If they differed, copy the new > to the old one. If it was updated, everything gets rebuilt. If not, nothing > happens. > > Maybe. I'll have to look it up. > > ​
The Makefile rules that come with gettext do something like this for updating .po files. From po/Makefile: # This target rebuilds a PO file if $(DOMAIN).pot has changed. # Note that a PO file is not touched if it doesn't need to be changed. However, I don't know if we could follow their method. Even if we could, it wouldn't make the build system any easier to understand. The more straightforward way to reduce the rebuild requirement would be to reduce the pervasiveness of the generated header file. It's included pretty much everywhere, even for code that isn't specifically for HTML conversion: $ fgrep html_conversion_data.h . -R --include="*.c" --include="*.h" ./convert/html_converter_types.h:#include "html_conversion_data.h" ./convert/convert_html.c:#include "html_conversion_data.h" ./convert/format_html.c:#include "html_conversion_data.h" ./convert/build_html_perl_state.c:#include "html_conversion_data.h" ./convert/html_prepare_converter.c:#include "html_conversion_data.h" ./convert/build_html_perl_info.c:#include "html_conversion_data.h" ./convert/converter.c:#include "html_conversion_data.h" ./main/option_types.h:#include "html_conversion_data.h" ./main/html_conversion_data.c:#include "html_conversion_data.h" ./main/converter_types.h:#include "html_conversion_data.h" ./main/document_types.h:#include "html_conversion_data.h" ./main/utils.c:#include "html_conversion_data.h" Perhaps it would be enough to structure this better.
