[PATCH 1/5 v2] 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               | 442 ++++++++++++++++++++++++++++---
 newlib/doc/local.mk              |  11 +
 newlib/libm/Makefile.am          |  27 +-
 newlib/libm/Makefile.in          | 398 +++-------------------------
 newlib/libm/Makefile.inc         |  26 ++
 newlib/libm/common/Makefile.am   |  14 +-
 newlib/libm/common/Makefile.in   |  22 +-
 newlib/libm/common/Makefile.inc  |  10 +
 newlib/libm/complex/Makefile.am  |  12 +-
 newlib/libm/complex/Makefile.in  |  18 +-
 newlib/libm/complex/Makefile.inc |   8 +
 newlib/libm/fenv/Makefile.am     |  11 +-
 newlib/libm/fenv/Makefile.in     |  15 +-
 newlib/libm/fenv/Makefile.inc    |   7 +
 newlib/libm/math/Makefile.am     |  15 +-
 newlib/libm/math/Makefile.in     |  23 +-
 newlib/libm/math/Makefile.inc    |  11 +
 newlib/libm/mathfp/Makefile.am   |  35 +--
 newlib/libm/mathfp/Makefile.in   |  42 +--
 newlib/libm/mathfp/Makefile.inc  |  31 +++
 21 files changed, 631 insertions(+), 556 deletions(-)
 create mode 100644 newlib/libm/Makefile.inc
 create mode 100644 newlib/libm/common/Makefile.inc
 create mode 100644 newlib/libm/complex/Makefile.inc
 create mode 100644 newlib/libm/fenv/Makefile.inc
 create mode 100644 newlib/libm/math/Makefile.inc
 create mode 100644 newlib/libm/mathfp/Makefile.inc

diff --git a/newlib/Makefile.am b/newlib/Makefile.am
index 718002535c78..a4cb965c2af2 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 =
 pkglib_LTLIBRARIES =
 
@@ -510,11 +512,18 @@ 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
 if HAVE_ICONVDATA
 include iconvdata/Makefile.inc
 endif
+include libm/Makefile.inc
 
 .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 5165ff34b9c0..1070af011ddd 100644
--- a/newlib/libm/Makefile.am
+++ b/newlib/libm/Makefile.am
@@ -36,31 +36,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 \
@@ -81,7 +56,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/Makefile.inc b/newlib/libm/Makefile.inc
new file mode 100644
index 000000000000..9aa5a5c93519
--- /dev/null
+++ b/newlib/libm/Makefile.inc
@@ -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/Makefile.inc
+include %D%/complex/Makefile.inc
+include %D%/fenv/Makefile.inc
+if NEWLIB_HW_FP
+include %D%/mathfp/Makefile.inc
+else
+include %D%/math/Makefile.inc
+endif
+
+CLEANFILES += \
+	%D%/targetdep.tex \
+	$(LIBM_CHEWOUT_FILES)
diff --git a/newlib/libm/common/Makefile.am b/newlib/libm/common/Makefile.am
index ef55e90ea462..29597d6031a9 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 ./Makefile.inc
+CHEWOUT_FILES = $(LIBM_CHEWOUT_FILES)
+CHAPTERS = $(LIBM_CHAPTERS)
 
 # A partial dependency list.
 
diff --git a/newlib/libm/common/Makefile.inc b/newlib/libm/common/Makefile.inc
new file mode 100644
index 000000000000..b0d3013c522b
--- /dev/null
+++ b/newlib/libm/common/Makefile.inc
@@ -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..0f27fff19ff6 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 ./Makefile.inc
+CHEWOUT_FILES = $(LIBM_CHEWOUT_FILES)
+CHAPTERS = $(LIBM_CHAPTERS)
 
 # A partial dependency list.
 
diff --git a/newlib/libm/complex/Makefile.inc b/newlib/libm/complex/Makefile.inc
new file mode 100644
index 000000000000..94288082ea32
--- /dev/null
+++ b/newlib/libm/complex/Makefile.inc
@@ -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..00c55d03898d 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 ./Makefile.inc
+CHEWOUT_FILES = $(LIBM_CHEWOUT_FILES)
+CHAPTERS = $(LIBM_CHAPTERS)
 
 # A partial dependency list.
 
diff --git a/newlib/libm/fenv/Makefile.inc b/newlib/libm/fenv/Makefile.inc
new file mode 100644
index 000000000000..0399638ad603
--- /dev/null
+++ b/newlib/libm/fenv/Makefile.inc
@@ -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/math/Makefile.am b/newlib/libm/math/Makefile.am
index 5529c358a80e..3d23a46a15e6 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 ./Makefile.inc
+CHEWOUT_FILES = $(LIBM_CHEWOUT_FILES)
+CHAPTERS = $(LIBM_CHAPTERS)
 
 # A partial dependency list.
 
diff --git a/newlib/libm/math/Makefile.inc b/newlib/libm/math/Makefile.inc
new file mode 100644
index 000000000000..bc3205e0b156
--- /dev/null
+++ b/newlib/libm/math/Makefile.inc
@@ -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..44d0e8f28026 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 ./Makefile.inc
+CHEWOUT_FILES = $(LIBM_CHEWOUT_FILES)
+CHAPTERS = $(LIBM_CHAPTERS)
 
 # A partial dependency list.
 
diff --git a/newlib/libm/mathfp/Makefile.inc b/newlib/libm/mathfp/Makefile.inc
new file mode 100644
index 000000000000..739e41f16d0b
--- /dev/null
+++ b/newlib/libm/mathfp/Makefile.inc
@@ -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.