[PATCH 1/5] newlib: libm: move manual into top-level build

Mike Frysinger <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
This doesn't migrate all the docs, just the libm's manual (pdf/info).
This is to show the basic form of migrating the chew files.
---
 newlib/Makefile.am              |   9 +
 newlib/Makefile.in              | 454 +++++++++++++++++++++++++++++---
 newlib/doc/local.mk             |  11 +
 newlib/libm/Makefile.am         |  27 +-
 newlib/libm/Makefile.in         | 398 +++-------------------------
 newlib/libm/common/Makefile.am  |  14 +-
 newlib/libm/common/Makefile.in  |  22 +-
 newlib/libm/common/local.mk     |  10 +
 newlib/libm/complex/Makefile.am |  12 +-
 newlib/libm/complex/Makefile.in |  18 +-
 newlib/libm/complex/local.mk    |   8 +
 newlib/libm/fenv/Makefile.am    |  11 +-
 newlib/libm/fenv/Makefile.in    |  15 +-
 newlib/libm/fenv/local.mk       |   7 +
 newlib/libm/local.mk            |  26 ++
 newlib/libm/math/Makefile.am    |  15 +-
 newlib/libm/math/Makefile.in    |  23 +-
 newlib/libm/math/local.mk       |  11 +
 newlib/libm/mathfp/Makefile.am  |  35 +--
 newlib/libm/mathfp/Makefile.in  |  42 +--
 newlib/libm/mathfp/local.mk     |  31 +++
 21 files changed, 638 insertions(+), 561 deletions(-)
 create mode 100644 newlib/libm/common/local.mk
 create mode 100644 newlib/libm/complex/local.mk
 create mode 100644 newlib/libm/fenv/local.mk
 create mode 100644 newlib/libm/local.mk
 create mode 100644 newlib/libm/math/local.mk
 create mode 100644 newlib/libm/mathfp/local.mk

diff --git a/newlib/Makefile.am b/newlib/Makefile.am
index 6a28215d3620..8ad74cfd54fe 100644
--- a/newlib/Makefile.am
+++ b/newlib/Makefile.am
@@ -5,6 +5,8 @@ ACLOCAL_AMFLAGS = -I . -I .. -I ../config
 
 # Variables that will accumulate in subdirs.
 PHONY =
+SUFFIXES =
+info_TEXINFOS =
 noinst_DATA =
 
 # Multilib support variables.
@@ -536,8 +538,15 @@ check-DEJAGNU: site.exp
 clean-local:
 	-rm -rf targ-include newlib.h _newlib_version.h stamp-*
 
+# Workaround bad automake/texinfo interactions.
+# https://bugs.gnu.org/23599
+TEXI2DVI = texi2dvi -E
+
+TEXINFO_TEX = ../texinfo/texinfo.tex
+
 if HAVE_DOC
 include doc/local.mk
 endif
+include libm/local.mk
 
 .PHONY: $(PHONY)
diff --git a/newlib/doc/local.mk b/newlib/doc/local.mk
index 64083c3dd600..5c867c998251 100644
--- a/newlib/doc/local.mk
+++ b/newlib/doc/local.mk
@@ -18,3 +18,14 @@ man-cache:
 	${srcdir}/doc/makedocbook.py --cache
 
 PHONY += man-cache
+
+#
+# Subdir documentation rules.
+#
+
+SUFFIXES += .def
+
+CHEW = $(MKDOC) -f $(srcdir)/%D%/doc.str
+
+.c.def:
+	$(AM_V_GEN)$(CHEW) < $< > $*.def || ( rm $*.def && false )
diff --git a/newlib/libm/Makefile.am b/newlib/libm/Makefile.am
index 8d355cbf6f69..08d6faa8ac17 100644
--- a/newlib/libm/Makefile.am
+++ b/newlib/libm/Makefile.am
@@ -33,31 +33,6 @@ endif
 
 $(SUBLIBS):
 
-TEXINFO_TEX = ../../texinfo/texinfo.tex
-info_TEXINFOS = libm.texi
-libm_TEXINFOS = targetdep.tex
-
-libm.dvi: targetdep.tex math/stmp-def complex/stmp-def fenv/stmp-def
-
-stmp-targetdep: force
-	rm -f tmp.texi
-	targetdoc=`pwd`/tmp.texi; \
-	for d in $(SUBDIRS); do \
-	  if test "$$d" != "."; then \
-	    (cd $$d && $(MAKE) doc) || exit 1; \
-	  fi; \
-	done
-	$(SHELL) $(newlib_basedir)/../move-if-change tmp.texi targetdep.tex
-	touch $@
-
-targetdep.tex: stmp-targetdep ; @true
-
-math/stmp-def: stmp-targetdep ; @true
-
-complex/stmp-def: stmp-targetdep ; @true
-
-fenv/stmp-def: stmp-targetdep ; @true
-
 docbook-recursive: force
 	for d in $(SUBDIRS); do \
 	  if test "$$d" != "."; then \
@@ -78,7 +53,7 @@ install-man: man
 .PHONY: force
 force:
 
-CLEANFILES = tmp.texi targetdep.tex stmp-targetdep *.xml *.3
+CLEANFILES = *.xml *.3
 
 ACLOCAL_AMFLAGS = -I .. -I ../.. -I ../../config
 CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
diff --git a/newlib/libm/common/Makefile.am b/newlib/libm/common/Makefile.am
index ef55e90ea462..52f74eec5763 100644
--- a/newlib/libm/common/Makefile.am
+++ b/newlib/libm/common/Makefile.am
@@ -59,15 +59,11 @@ endif # USE_LIBTOOL
 
 include $(srcdir)/../../Makefile.shared
 
-CHEWOUT_FILES =	s_cbrt.def s_copysign.def s_exp10.def s_expm1.def s_ilogb.def \
-	s_infinity.def s_isnan.def s_log1p.def s_modf.def \
-	s_nan.def s_nextafter.def s_pow10.def s_scalbn.def \
-	s_fdim.def s_fma.def s_fmax.def s_fmin.def \
-	s_logb.def s_log2.def s_lrint.def s_lround.def s_nearbyint.def \
-	s_remquo.def s_rint.def s_round.def s_signbit.def s_trunc.def \
-	isgreater.def
-
-CHAPTERS =
+LIBM_CHEWOUT_FILES =
+LIBM_CHAPTERS =
+include ./local.mk
+CHEWOUT_FILES = $(LIBM_CHEWOUT_FILES)
+CHAPTERS = $(LIBM_CHAPTERS)
 
 # A partial dependency list.
 
diff --git a/newlib/libm/common/local.mk b/newlib/libm/common/local.mk
new file mode 100644
index 000000000000..b0d3013c522b
--- /dev/null
+++ b/newlib/libm/common/local.mk
@@ -0,0 +1,10 @@
+LIBM_CHEWOUT_FILES += \
+	%D%/s_cbrt.def %D%/s_copysign.def %D%/s_exp10.def %D%/s_expm1.def %D%/s_ilogb.def \
+	%D%/s_infinity.def %D%/s_isnan.def %D%/s_log1p.def %D%/s_modf.def \
+	%D%/s_nan.def %D%/s_nextafter.def %D%/s_pow10.def %D%/s_scalbn.def \
+	%D%/s_fdim.def %D%/s_fma.def %D%/s_fmax.def %D%/s_fmin.def \
+	%D%/s_logb.def %D%/s_log2.def %D%/s_lrint.def %D%/s_lround.def %D%/s_nearbyint.def \
+	%D%/s_remquo.def %D%/s_rint.def %D%/s_round.def %D%/s_signbit.def %D%/s_trunc.def \
+	%D%/isgreater.def
+
+LIBM_CHAPTERS +=
diff --git a/newlib/libm/complex/Makefile.am b/newlib/libm/complex/Makefile.am
index 73fa19045754..27993dc43fa2 100644
--- a/newlib/libm/complex/Makefile.am
+++ b/newlib/libm/complex/Makefile.am
@@ -35,13 +35,11 @@ endif # USE_LIBTOOL
 
 include $(srcdir)/../../Makefile.shared
 
-CHEWOUT_FILES =	cabs.def cacos.def cacosh.def carg.def \
-        casin.def casinh.def catan.def catanh.def \
-        ccos.def ccosh.def cexp.def cimag.def clog.def \
-        clog10.def conj.def cpow.def cproj.def creal.def \
-        csin.def csinh.def csqrt.def ctan.def ctanh.def
-
-CHAPTERS = complex.tex
+LIBM_CHEWOUT_FILES =
+LIBM_CHAPTERS =
+include ./local.mk
+CHEWOUT_FILES = $(LIBM_CHEWOUT_FILES)
+CHAPTERS = $(LIBM_CHAPTERS)
 
 # A partial dependency list.
 
diff --git a/newlib/libm/complex/local.mk b/newlib/libm/complex/local.mk
new file mode 100644
index 000000000000..94288082ea32
--- /dev/null
+++ b/newlib/libm/complex/local.mk
@@ -0,0 +1,8 @@
+LIBM_CHEWOUT_FILES += \
+	%D%/cabs.def %D%/cacos.def %D%/cacosh.def %D%/carg.def \
+	%D%/casin.def %D%/casinh.def %D%/catan.def %D%/catanh.def \
+	%D%/ccos.def %D%/ccosh.def %D%/cexp.def %D%/cimag.def %D%/clog.def \
+	%D%/clog10.def %D%/conj.def %D%/cpow.def %D%/cproj.def %D%/creal.def \
+	%D%/csin.def %D%/csinh.def %D%/csqrt.def %D%/ctan.def %D%/ctanh.def
+
+LIBM_CHAPTERS += %D%/complex.tex
diff --git a/newlib/libm/fenv/Makefile.am b/newlib/libm/fenv/Makefile.am
index db59c8048490..3d0052e53617 100644
--- a/newlib/libm/fenv/Makefile.am
+++ b/newlib/libm/fenv/Makefile.am
@@ -22,12 +22,11 @@ endif # USE_LIBTOOL
 
 include $(srcdir)/../../Makefile.shared
 
-CHEWOUT_FILES =	feclearexcept.def fegetenv.def \
-	fegetexceptflag.def fegetround.def feholdexcept.def \
-	feraiseexcept.def fesetenv.def fesetexceptflag.def fesetround.def \
-	fetestexcept.def feupdateenv.def
-
-CHAPTERS = fenv.tex
+LIBM_CHEWOUT_FILES =
+LIBM_CHAPTERS =
+include ./local.mk
+CHEWOUT_FILES = $(LIBM_CHEWOUT_FILES)
+CHAPTERS = $(LIBM_CHAPTERS)
 
 # A partial dependency list.
 
diff --git a/newlib/libm/fenv/local.mk b/newlib/libm/fenv/local.mk
new file mode 100644
index 000000000000..0399638ad603
--- /dev/null
+++ b/newlib/libm/fenv/local.mk
@@ -0,0 +1,7 @@
+LIBM_CHEWOUT_FILES += \
+	%D%/feclearexcept.def %D%/fegetenv.def \
+	%D%/fegetexceptflag.def %D%/fegetround.def %D%/feholdexcept.def \
+	%D%/feraiseexcept.def %D%/fesetenv.def %D%/fesetexceptflag.def %D%/fesetround.def \
+	%D%/fetestexcept.def %D%/feupdateenv.def
+
+LIBM_CHAPTERS += %D%/fenv.tex
diff --git a/newlib/libm/local.mk b/newlib/libm/local.mk
new file mode 100644
index 000000000000..db10751f9392
--- /dev/null
+++ b/newlib/libm/local.mk
@@ -0,0 +1,26 @@
+info_TEXINFOS += %D%/libm.texi
+%C%_libm_TEXINFOS = %D%/targetdep.tex $(LIBM_CHEWOUT_FILES)
+
+LIBM_CHEWOUT_FILES =
+
+LIBM_CHAPTERS =
+
+%D%/libm.dvi: %D%/targetdep.tex $(LIBM_CHEWOUT_FILES)
+
+%D%/targetdep.tex: $(LIBM_CHAPTERS)
+	$(AM_V_GEN)cat $^ > [email protected]
+	$(AM_V_at)$(SHELL) $(newlib_basedir)/../move-if-change [email protected] $@
+	$(AM_V_at)touch $@
+
+include %D%/common/local.mk
+include %D%/complex/local.mk
+include %D%/fenv/local.mk
+if NEWLIB_HW_FP
+include %D%/mathfp/local.mk
+else
+include %D%/math/local.mk
+endif
+
+CLEANFILES += \
+	%D%/targetdep.tex \
+	$(LIBM_CHEWOUT_FILES)
diff --git a/newlib/libm/math/Makefile.am b/newlib/libm/math/Makefile.am
index 5529c358a80e..97d5d3748936 100644
--- a/newlib/libm/math/Makefile.am
+++ b/newlib/libm/math/Makefile.am
@@ -66,16 +66,11 @@ endif # USE_LIBTOOL
 
 include $(srcdir)/../../Makefile.shared
 
-CHEWOUT_FILES = w_acos.def w_acosh.def w_asin.def s_asinh.def \
-	s_atan.def w_atan2.def w_atanh.def w_j0.def \
-	w_cosh.def s_erf.def w_exp.def w_exp2.def \
-	s_fabs.def s_floor.def w_fmod.def s_frexp.def \
-	w_gamma.def w_hypot.def s_ldexp.def w_log.def \
-	w_log10.def \
-	w_pow.def w_remainder.def s_sin.def w_sinh.def \
-	w_sqrt.def s_tan.def s_tanh.def
-
-CHAPTERS = math.tex
+LIBM_CHEWOUT_FILES =
+LIBM_CHAPTERS =
+include ./local.mk
+CHEWOUT_FILES = $(LIBM_CHEWOUT_FILES)
+CHAPTERS = $(LIBM_CHAPTERS)
 
 # A partial dependency list.
 
diff --git a/newlib/libm/math/local.mk b/newlib/libm/math/local.mk
new file mode 100644
index 000000000000..bc3205e0b156
--- /dev/null
+++ b/newlib/libm/math/local.mk
@@ -0,0 +1,11 @@
+LIBM_CHEWOUT_FILES += \
+	%D%/w_acos.def %D%/w_acosh.def %D%/w_asin.def %D%/s_asinh.def \
+	%D%/s_atan.def %D%/w_atan2.def %D%/w_atanh.def %D%/w_j0.def \
+	%D%/w_cosh.def %D%/s_erf.def %D%/w_exp.def %D%/w_exp2.def \
+	%D%/s_fabs.def %D%/s_floor.def %D%/w_fmod.def %D%/s_frexp.def \
+	%D%/w_gamma.def %D%/w_hypot.def %D%/s_ldexp.def %D%/w_log.def \
+	%D%/w_log10.def \
+	%D%/w_pow.def %D%/w_remainder.def %D%/s_sin.def %D%/w_sinh.def \
+	%D%/w_sqrt.def %D%/s_tan.def %D%/s_tanh.def
+
+LIBM_CHAPTERS += %D%/math.tex
diff --git a/newlib/libm/mathfp/Makefile.am b/newlib/libm/mathfp/Makefile.am
index 39fb8b1db69e..a35ae1f54d36 100644
--- a/newlib/libm/mathfp/Makefile.am
+++ b/newlib/libm/mathfp/Makefile.am
@@ -56,36 +56,11 @@ endif # USE_LIBTOOL
 
 include $(srcdir)/../../Makefile.shared
 
-CHEWOUT_FILES = e_acosh.def \
-	e_atanh.def \
-	e_hypot.def \
-	e_remainder.def \
-	er_lgamma.def \
-	s_acos.def \
-	s_asine.def \
-	s_asinh.def \
-	s_atan.def \
-	s_atan2.def \
-	s_atangent.def \
-	s_cosh.def \
-	s_erf.def \
-	s_exp.def \
-	s_fabs.def \
-	s_floor.def \
-	s_fmod.def \
-	s_frexp.def \
-	s_ldexp.def \
-	s_log10.def \
-	s_logarithm.def \
-	s_pow.def \
-	s_sine.def \
-	s_sineh.def \
-	s_sqrt.def \
-	s_tan.def \
-	s_tanh.def \
-	w_jn.def
-
-CHAPTERS = mathfp.tex
+LIBM_CHEWOUT_FILES =
+LIBM_CHAPTERS =
+include ./local.mk
+CHEWOUT_FILES = $(LIBM_CHEWOUT_FILES)
+CHAPTERS = $(LIBM_CHAPTERS)
 
 # A partial dependency list.
 
diff --git a/newlib/libm/mathfp/local.mk b/newlib/libm/mathfp/local.mk
new file mode 100644
index 000000000000..739e41f16d0b
--- /dev/null
+++ b/newlib/libm/mathfp/local.mk
@@ -0,0 +1,31 @@
+LIBM_CHEWOUT_FILES += \
+	%D%/e_acosh.def \
+	%D%/e_atanh.def \
+	%D%/e_hypot.def \
+	%D%/e_remainder.def \
+	%D%/er_lgamma.def \
+	%D%/s_acos.def \
+	%D%/s_asine.def \
+	%D%/s_asinh.def \
+	%D%/s_atan.def \
+	%D%/s_atan2.def \
+	%D%/s_atangent.def \
+	%D%/s_cosh.def \
+	%D%/s_erf.def \
+	%D%/s_exp.def \
+	%D%/s_fabs.def \
+	%D%/s_floor.def \
+	%D%/s_fmod.def \
+	%D%/s_frexp.def \
+	%D%/s_ldexp.def \
+	%D%/s_log10.def \
+	%D%/s_logarithm.def \
+	%D%/s_pow.def \
+	%D%/s_sine.def \
+	%D%/s_sineh.def \
+	%D%/s_sqrt.def \
+	%D%/s_tan.def \
+	%D%/s_tanh.def \
+	%D%/w_jn.def
+
+LIBM_CHAPTERS += %D%/mathfp.tex
-- 
2.34.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.