public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: newlib@sourceware.org
Subject: [PATCH 1/5 v3] newlib: libm: move manual into top-level build
Date: Tue,  1 Feb 2022 01:21:03 -0500	[thread overview]
Message-ID: <20220201062107.19266-1-vapier@gentoo.org> (raw)
In-Reply-To: <20220122043208.21962-1-vapier@gentoo.org>

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.
---
v3: fix .stamp handling with tex generation

 newlib/Makefile.am               |   9 +
 newlib/Makefile.in               | 443 ++++++++++++++++++++++++++++---
 newlib/doc/local.mk              |  11 +
 newlib/libm/Makefile.am          |  27 +-
 newlib/libm/Makefile.in          | 398 +++------------------------
 newlib/libm/Makefile.inc         |  28 ++
 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, 634 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..39418cc79ef8
--- /dev/null
+++ b/newlib/libm/Makefile.inc
@@ -0,0 +1,28 @@
+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.stamp: $(LIBM_CHAPTERS)
+	$(AM_V_GEN)cat $^ > $@.tmp
+	$(AM_V_at)$(SHELL) $(newlib_basedir)/../move-if-change $@.tmp $(@:.stamp=)
+	$(AM_V_at)touch $@
+%D%/targetdep.tex: %D%/targetdep.tex.stamp; @true
+
+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 \
+	%D%/targetdep.tex.stamp \
+	$(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


  parent reply	other threads:[~2022-02-01  6:21 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-22  4:32 [PATCH 0/5] migrate documentation into top-level Mike Frysinger
2022-01-22  4:32 ` [PATCH 1/5] newlib: libm: move manual into top-level build Mike Frysinger
2022-01-22  4:32 ` [PATCH 2/5] newlib: libc: include all chapters all the time in the manual Mike Frysinger
2022-01-22  4:32 ` [PATCH 3/5] newlib: libc: move manual into top-level build Mike Frysinger
2022-01-24 14:30   ` Corinna Vinschen
2022-01-22  4:32 ` [PATCH 4/5] newlib: move man page generation " Mike Frysinger
2022-01-22  4:32 ` [PATCH 5/5] newlib: drop shared documentation rules Mike Frysinger
2022-01-28  7:58 ` [PATCH 1/5 v2] newlib: libm: move manual into top-level build Mike Frysinger
2022-01-28  7:58   ` [PATCH 2/5 v2] newlib: libc: include all chapters all the time in the manual Mike Frysinger
2022-01-28  7:58   ` [PATCH 3/5 v2] newlib: libc: move manual into top-level build Mike Frysinger
2022-01-28  7:58   ` [PATCH 4/5 v2] newlib: move man page generation " Mike Frysinger
2022-01-28  7:58   ` [PATCH 5/5 v2] newlib: drop shared documentation rules Mike Frysinger
2022-01-31 14:58   ` [PATCH 1/5 v2] newlib: libm: move manual into top-level build Jon Turney
2022-02-01  3:40     ` Mike Frysinger
2022-02-01 14:37       ` Jon Turney
2022-02-01  6:21 ` Mike Frysinger [this message]
2022-02-01  6:21   ` [PATCH 2/5 v3] newlib: libc: include all chapters all the time in the manual Mike Frysinger
2022-02-01  6:21   ` [PATCH 3/5 v3] newlib: libc: move manual into top-level build Mike Frysinger
2022-02-01  6:21   ` [PATCH 4/5 v3] newlib: move man page generation " Mike Frysinger
2022-02-01 14:37     ` Jon Turney
2022-02-01 23:12       ` Mike Frysinger
2022-02-01  6:21   ` [PATCH 5/5 v3] newlib: drop shared documentation rules Mike Frysinger
2022-02-05 12:13   ` [PATCH 1/5 v3] newlib: libm: move manual into top-level build Corinna Vinschen
2022-02-05 18:04     ` Mike Frysinger
2022-02-07 10:30       ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220201062107.19266-1-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=newlib@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).