From b71ac2b9ce840391a7c6b96bfa045802d21596c9 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 24 Oct 2018 20:34:31 +0000 Subject: Use gen-libm-test.py to generate ulps table for manual. This patch extends gen-libm-test.py to generate the ulps table for the manual, so meaning there is only a single ulps file parser needed and another Perl script is eliminated. As with the introduction of gen-libm-test.py, this is designed to generate exactly the same libm-err.texi as libm-err-tab.pl did. (gen-libm-test.py is still shorter in lines than the old gen-libm-test.pl even after this patch.) Note that this introduces a Python dependency for building the manual, which is thus noted in install.texi and NEWS. Tested building html / info / pdf versions of the manual. * math/gen-libm-test.py: Import os. (ALL_FLOATS_MANUAL): New constant. (ALL_FLOATS_SUFFIX): Likewise. (Ulps.all_functions): New function. (real_all_ulps): Likewise. (generate_err_table_sub): Likewise. (generate_err_table): Likewise. (main): Handle -s and -m options. * manual/libm-err-tab.pl: Remove. * manual/Makefile ($(objpfx)stamp-libm-err): Use gen-libm-test.py instead of libm-err-tab.pl. [$(PERL) != no]: Change condition to [$(if $(PYTHON),$(PERL),no) != no]. * manual/install.texi (Tools for Compilation): Document requirement for Python to build manual. * INSTALL: Regenerated. --- manual/Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'manual/Makefile') diff --git a/manual/Makefile b/manual/Makefile index c275664..9c35c9d 100644 --- a/manual/Makefile +++ b/manual/Makefile @@ -99,10 +99,11 @@ $(objpfx)dir-add.texi: xtract-typefun.awk $(texis-path) # The table with the math errors is generated. $(objpfx)libm-err.texi: $(objpfx)stamp-libm-err -$(objpfx)stamp-libm-err: libm-err-tab.pl $(wildcard $(foreach dir,$(sysdirs),\ - $(dir)/libm-test-ulps)) +$(objpfx)stamp-libm-err: $(..)math/gen-libm-test.py \ + $(wildcard $(foreach dir,$(sysdirs),\ + $(dir)/libm-test-ulps)) pwd=`pwd`; \ - $(PERL) $< $$pwd/.. > $(objpfx)libm-err-tmp + $(PYTHON) $< -s $$pwd/.. -m $(objpfx)libm-err-tmp $(move-if-change) $(objpfx)libm-err-tmp $(objpfx)libm-err.texi touch $@ @@ -169,8 +170,9 @@ include ../Rules .PHONY: install subdir_install install-data install-data subdir_install: install -# Generated files requiring perl: libm-err.texi, summary.texi -ifneq ($(PERL),no) +# Generated files requiring python: libm-err.texi +# Generated files requiring perl: summary.texi +ifneq ($(if $(PYTHON),$(PERL),no),no) ifneq ($(strip $(MAKEINFO)),:) install: $(inst_infodir)/libc.info @if $(SHELL) -c '$(INSTALL_INFO) --version' >/dev/null 2>&1; then \ -- cgit v1.1