public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: newlib@sourceware.org
Subject: [PATCH 3/5] newlib: libc: move manual into top-level build
Date: Fri, 21 Jan 2022 23:32:06 -0500	[thread overview]
Message-ID: <20220122043208.21962-4-vapier@gentoo.org> (raw)
In-Reply-To: <20220122043208.21962-1-vapier@gentoo.org>

This doesn't migrate all the docs, just the libc's manual (pdf/info).
This is to show the basic form of migrating the chew files.

For subdirs that didn't have any docs, I've stripped their settings
for clarity.  If someone wanted to suddenly add docs, they can add
the corresponding local.mk files easily.
---
 newlib/Makefile.am                |   1 +
 newlib/Makefile.in                | 235 ++++++++++++++-
 newlib/libc/argz/Makefile.am      |   4 -
 newlib/libc/argz/Makefile.in      |   3 -
 newlib/libc/ctype/Makefile.am     |  41 +--
 newlib/libc/ctype/Makefile.in     |  51 +---
 newlib/libc/ctype/local.mk        |  36 +++
 newlib/libc/errno/Makefile.am     |   4 -
 newlib/libc/errno/Makefile.in     |   3 -
 newlib/libc/iconv/Makefile.am     |  28 +-
 newlib/libc/iconv/Makefile.in     |  30 +-
 newlib/libc/iconv/ccs/Makefile.am |   3 -
 newlib/libc/iconv/ccs/Makefile.in |   2 -
 newlib/libc/iconv/ces/Makefile.am |   3 -
 newlib/libc/iconv/ces/Makefile.in |   2 -
 newlib/libc/iconv/iconv.tex       |   2 +-
 newlib/libc/iconv/lib/Makefile.am |   3 -
 newlib/libc/iconv/lib/Makefile.in |   2 -
 newlib/libc/iconv/lib/local.mk    |   1 +
 newlib/libc/iconv/local.mk        |   3 +
 newlib/libc/local.mk              |  32 ++
 newlib/libc/locale/Makefile.am    |  13 +-
 newlib/libc/locale/Makefile.in    |  17 +-
 newlib/libc/locale/local.mk       |   8 +
 newlib/libc/machine/Makefile.am   |   4 -
 newlib/libc/misc/Makefile.am      |   7 +-
 newlib/libc/misc/Makefile.in      |  10 +-
 newlib/libc/misc/local.mk         |   6 +
 newlib/libc/posix/Makefile.am     |  10 +-
 newlib/libc/posix/Makefile.in     |  13 +-
 newlib/libc/posix/local.mk        |   5 +
 newlib/libc/reent/Makefile.am     |  30 +-
 newlib/libc/reent/Makefile.in     |  37 +--
 newlib/libc/reent/local.mk        |  25 ++
 newlib/libc/search/Makefile.am    |  13 +-
 newlib/libc/search/Makefile.in    |  14 +-
 newlib/libc/search/local.mk       |   4 +
 newlib/libc/signal/Makefile.am    |   8 +-
 newlib/libc/signal/Makefile.in    |  10 +-
 newlib/libc/signal/local.mk       |   7 +
 newlib/libc/ssp/Makefile.am       |   9 +-
 newlib/libc/ssp/Makefile.in       |  10 +-
 newlib/libc/ssp/local.mk          |   3 +
 newlib/libc/stdio/Makefile.am     | 468 +++++++++++++-----------------
 newlib/libc/stdio/Makefile.in     | 104 ++-----
 newlib/libc/stdio/local.mk        |  80 +++++
 newlib/libc/stdio64/Makefile.am   |  18 +-
 newlib/libc/stdio64/Makefile.in   |  21 +-
 newlib/libc/stdio64/local.mk      |  11 +
 newlib/libc/stdlib/Makefile.am    |  58 +---
 newlib/libc/stdlib/Makefile.in    |  68 +----
 newlib/libc/stdlib/local.mk       |  51 ++++
 newlib/libc/string/Makefile.am    |  27 +-
 newlib/libc/string/Makefile.in    |  48 +--
 newlib/libc/string/local.mk       |  22 ++
 newlib/libc/sys/Makefile.am       |   4 -
 newlib/libc/syscalls/Makefile.am  |   4 -
 newlib/libc/syscalls/Makefile.in  |   3 -
 newlib/libc/time/Makefile.am      |  22 +-
 newlib/libc/time/Makefile.in      |  29 +-
 newlib/libc/time/local.mk         |  15 +
 newlib/libc/unix/Makefile.am      |   4 -
 newlib/libc/unix/Makefile.in      |   3 -
 newlib/libc/xdr/Makefile.am       |   4 -
 newlib/libc/xdr/Makefile.in       |   3 -
 65 files changed, 943 insertions(+), 876 deletions(-)
 create mode 100644 newlib/libc/ctype/local.mk
 create mode 100644 newlib/libc/iconv/lib/local.mk
 create mode 100644 newlib/libc/iconv/local.mk
 create mode 100644 newlib/libc/local.mk
 create mode 100644 newlib/libc/locale/local.mk
 create mode 100644 newlib/libc/misc/local.mk
 create mode 100644 newlib/libc/posix/local.mk
 create mode 100644 newlib/libc/reent/local.mk
 create mode 100644 newlib/libc/search/local.mk
 create mode 100644 newlib/libc/signal/local.mk
 create mode 100644 newlib/libc/ssp/local.mk
 create mode 100644 newlib/libc/stdio/local.mk
 create mode 100644 newlib/libc/stdio64/local.mk
 create mode 100644 newlib/libc/stdlib/local.mk
 create mode 100644 newlib/libc/string/local.mk
 create mode 100644 newlib/libc/time/local.mk

diff --git a/newlib/Makefile.am b/newlib/Makefile.am
index 8ad74cfd54fe..21945fd71c0f 100644
--- a/newlib/Makefile.am
+++ b/newlib/Makefile.am
@@ -547,6 +547,7 @@ TEXINFO_TEX = ../texinfo/texinfo.tex
 if HAVE_DOC
 include doc/local.mk
 endif
+include libc/local.mk
 include libm/local.mk
 
 .PHONY: $(PHONY)
diff --git a/newlib/libc/argz/Makefile.am b/newlib/libc/argz/Makefile.am
index 0f73cd2b8cfb..a8351b8e20e4 100644
--- a/newlib/libc/argz/Makefile.am
+++ b/newlib/libc/argz/Makefile.am
@@ -41,8 +41,4 @@ lib_a_CFLAGS = $(AM_CFLAGS)
 noinst_DATA =
 endif # USE_LIBTOOL
 
-CHEWOUT_FILES =
-CHAPTERS =
-# No doc for argz.
-
 include $(srcdir)/../../Makefile.shared
diff --git a/newlib/libc/ctype/Makefile.am b/newlib/libc/ctype/Makefile.am
index 447b7afde2e0..6d68622b5175 100644
--- a/newlib/libc/ctype/Makefile.am
+++ b/newlib/libc/ctype/Makefile.am
@@ -95,41 +95,10 @@ endif # USE_LIBTOOL
 
 include $(srcdir)/../../Makefile.shared
 
-CHEWOUT_FILES= \
-	isalnum.def	\
-	isalpha.def	\
-	isascii.def	\
-	isblank.def	\
-	iscntrl.def	\
-	isdigit.def	\
-	islower.def	\
-	isprint.def	\
-	ispunct.def	\
-	isspace.def	\
-	isupper.def	\
-	iswalnum.def	\
-	iswalpha.def	\
-	iswblank.def 	\
-	iswcntrl.def 	\
-	iswctype.def 	\
-	iswdigit.def 	\
-	iswgraph.def 	\
-	iswlower.def 	\
-	iswprint.def 	\
-	iswpunct.def 	\
-	iswspace.def 	\
-	iswupper.def 	\
-	iswxdigit.def 	\
-	isxdigit.def	\
-	toascii.def	\
-	tolower.def	\
-	toupper.def	\
-	towctrans.def	\
-	towlower.def	\
-	towupper.def	\
-	wctrans.def	\
-	wctype.def
-
-CHAPTERS = ctype.tex
+LIBC_CHEWOUT_FILES =
+LIBC_CHAPTERS =
+include ./local.mk
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
 
 $(lpfx)ctype_.$(oext): ctype_.c ctype_iso.h ctype_cp.h
diff --git a/newlib/libc/ctype/local.mk b/newlib/libc/ctype/local.mk
new file mode 100644
index 000000000000..8cef16630ac1
--- /dev/null
+++ b/newlib/libc/ctype/local.mk
@@ -0,0 +1,36 @@
+LIBC_CHEWOUT_FILES += \
+	%D%/isalnum.def \
+	%D%/isalpha.def \
+	%D%/isascii.def \
+	%D%/isblank.def \
+	%D%/iscntrl.def \
+	%D%/isdigit.def \
+	%D%/islower.def \
+	%D%/isprint.def \
+	%D%/ispunct.def \
+	%D%/isspace.def \
+	%D%/isupper.def \
+	%D%/iswalnum.def \
+	%D%/iswalpha.def \
+	%D%/iswblank.def \
+	%D%/iswcntrl.def \
+	%D%/iswctype.def \
+	%D%/iswdigit.def \
+	%D%/iswgraph.def \
+	%D%/iswlower.def \
+	%D%/iswprint.def \
+	%D%/iswpunct.def \
+	%D%/iswspace.def \
+	%D%/iswupper.def \
+	%D%/iswxdigit.def \
+	%D%/isxdigit.def \
+	%D%/toascii.def \
+	%D%/tolower.def \
+	%D%/toupper.def \
+	%D%/towctrans.def \
+	%D%/towlower.def \
+	%D%/towupper.def \
+	%D%/wctrans.def \
+	%D%/wctype.def
+
+LIBC_CHAPTERS += %D%/ctype.tex
diff --git a/newlib/libc/errno/Makefile.am b/newlib/libc/errno/Makefile.am
index 77a0b8b83ad8..3470abd0bc1c 100644
--- a/newlib/libc/errno/Makefile.am
+++ b/newlib/libc/errno/Makefile.am
@@ -18,7 +18,3 @@ noinst_DATA =
 endif # USE_LIBTOOL
 
 include $(srcdir)/../../Makefile.shared
-
-CHEWOUT_FILES =
-CHAPTERS =
-# No doc for errno.
diff --git a/newlib/libc/iconv/Makefile.am b/newlib/libc/iconv/Makefile.am
index 4123c7acbcca..0b861d3b8c68 100644
--- a/newlib/libc/iconv/Makefile.am
+++ b/newlib/libc/iconv/Makefile.am
@@ -6,28 +6,10 @@ cct_DATA=encoding.aliases
 
 AM_CPPFLAGS = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
 
-SUBDEFS = lib/stmp-def
-
 include $(srcdir)/../../Makefile.shared
 
-CHEWOUT_FILES = iconv.def
-CHAPTERS = iconv.tex
-
-iconv.def: lib/iconv.def
-	cp lib/iconv.def iconv.def
-
-iconv.xml: lib/iconv.xml
-	cp lib/iconv.xml iconv.xml
-
-stmp-def: force
-	(cd lib && $(MAKE) doc)
-	touch $@
-
-.PHONY: force
-force:
-
-$(SUBDEFS): stmp-def
-
-lib/iconv.def: $(SUBDEFS); @true
-
-lib/stmp-def: ; @true
+LIBC_CHEWOUT_FILES =
+LIBC_CHAPTERS =
+include ./local.mk
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
diff --git a/newlib/libc/iconv/ccs/Makefile.am b/newlib/libc/iconv/ccs/Makefile.am
index f87d072b8e70..071b75b8ef4f 100644
--- a/newlib/libc/iconv/ccs/Makefile.am
+++ b/newlib/libc/iconv/ccs/Makefile.am
@@ -45,7 +45,4 @@ noinst_DATA =
 
 SUBDIRS=binary
 
-CHEWOUT_FILES =
-CHAPTERS =
-
 include $(srcdir)/../../../Makefile.shared
diff --git a/newlib/libc/iconv/ces/Makefile.am b/newlib/libc/iconv/ces/Makefile.am
index 21a37b7b8000..9f129c9978b8 100644
--- a/newlib/libc/iconv/ces/Makefile.am
+++ b/newlib/libc/iconv/ces/Makefile.am
@@ -39,6 +39,3 @@ lib_a_CFLAGS = $(AM_CFLAGS)
 noinst_DATA =
 
 include $(srcdir)/../../../Makefile.shared
-
-CHEWOUT_FILES =
-CHAPTERS =
diff --git a/newlib/libc/iconv/iconv.tex b/newlib/libc/iconv/iconv.tex
index 46ced296b907..42d04c0b616f 100644
--- a/newlib/libc/iconv/iconv.tex
+++ b/newlib/libc/iconv/iconv.tex
@@ -21,7 +21,7 @@ The iconv functions declarations are in
 @end menu
 
 @page
-@include iconv/iconv.def
+@include iconv/lib/iconv.def
 
 @page
 @node Introduction to iconv
diff --git a/newlib/libc/iconv/lib/Makefile.am b/newlib/libc/iconv/lib/Makefile.am
index 4e495573a287..0114b2aa3e96 100644
--- a/newlib/libc/iconv/lib/Makefile.am
+++ b/newlib/libc/iconv/lib/Makefile.am
@@ -30,6 +30,3 @@ lib_a_CFLAGS = $(AM_CFLAGS)
 noinst_DATA =
 
 include $(srcdir)/../../../Makefile.shared
-
-CHEWOUT_FILES = iconv.def
-CHAPTER =
diff --git a/newlib/libc/iconv/lib/local.mk b/newlib/libc/iconv/lib/local.mk
new file mode 100644
index 000000000000..62a2be87ba5e
--- /dev/null
+++ b/newlib/libc/iconv/lib/local.mk
@@ -0,0 +1 @@
+LIBC_CHEWOUT_FILES += %D%/iconv.def
diff --git a/newlib/libc/iconv/local.mk b/newlib/libc/iconv/local.mk
new file mode 100644
index 000000000000..ea8e78783d04
--- /dev/null
+++ b/newlib/libc/iconv/local.mk
@@ -0,0 +1,3 @@
+LIBC_CHAPTERS += %D%/iconv.tex
+
+include %D%/lib/local.mk
diff --git a/newlib/libc/local.mk b/newlib/libc/local.mk
new file mode 100644
index 000000000000..f6b797f612c2
--- /dev/null
+++ b/newlib/libc/local.mk
@@ -0,0 +1,32 @@
+info_TEXINFOS += %D%/libc.texi
+%C%_libc_TEXINFOS = %D%/targetdep.tex $(LIBC_CHEWOUT_FILES)
+
+LIBC_CHEWOUT_FILES =
+
+LIBC_CHAPTERS = %D%/sys.tex
+
+%D%/libc.dvi: %D%/targetdep.tex $(LIBC_CHEWOUT_FILES)
+
+%D%/targetdep.tex: $(LIBC_CHAPTERS)
+	$(AM_V_GEN)cat $^ > $@.tmp
+	$(AM_V_at)$(SHELL) $(newlib_basedir)/../move-if-change $@.tmp $@
+	$(AM_V_at)touch $@
+
+include %D%/ctype/local.mk
+include %D%/iconv/local.mk
+include %D%/locale/local.mk
+include %D%/misc/local.mk
+include %D%/posix/local.mk
+include %D%/reent/local.mk
+include %D%/search/local.mk
+include %D%/signal/local.mk
+include %D%/ssp/local.mk
+include %D%/stdio64/local.mk
+include %D%/stdio/local.mk
+include %D%/stdlib/local.mk
+include %D%/string/local.mk
+include %D%/time/local.mk
+
+CLEANFILES += \
+	%D%/targetdep.tex \
+	$(LIBC_CHEWOUT_FILES)
diff --git a/newlib/libc/locale/Makefile.am b/newlib/libc/locale/Makefile.am
index 1fd2530f7c43..0fc51ffd4d74 100644
--- a/newlib/libc/locale/Makefile.am
+++ b/newlib/libc/locale/Makefile.am
@@ -36,11 +36,8 @@ endif # USE_LIBTOOL
 
 include $(srcdir)/../../Makefile.shared
 
-CHEWOUT_FILES = \
-	duplocale.def \
-	freelocale.def \
-	locale.def \
-	newlocale.def \
-	uselocale.def
-
-CHAPTERS = locale.tex
+LIBC_CHEWOUT_FILES =
+LIBC_CHAPTERS =
+include ./local.mk
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
diff --git a/newlib/libc/locale/local.mk b/newlib/libc/locale/local.mk
new file mode 100644
index 000000000000..7af1534c8f96
--- /dev/null
+++ b/newlib/libc/locale/local.mk
@@ -0,0 +1,8 @@
+LIBC_CHEWOUT_FILES += \
+	%D%/duplocale.def \
+	%D%/freelocale.def \
+	%D%/locale.def \
+	%D%/newlocale.def \
+	%D%/uselocale.def
+
+LIBC_CHAPTERS += %D%/locale.tex
diff --git a/newlib/libc/machine/Makefile.am b/newlib/libc/machine/Makefile.am
index 49c85fb2087d..1b941d0e06e1 100644
--- a/newlib/libc/machine/Makefile.am
+++ b/newlib/libc/machine/Makefile.am
@@ -18,9 +18,5 @@ endif
 
 $(machine_dir)/lib.a:
 
-doc:
-
-docbook:
-
 ACLOCAL_AMFLAGS = -I ../.. -I ../../.. -I ../../../config
 CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
diff --git a/newlib/libc/misc/Makefile.am b/newlib/libc/misc/Makefile.am
index da4f90f46815..c9fb96c68696 100644
--- a/newlib/libc/misc/Makefile.am
+++ b/newlib/libc/misc/Makefile.am
@@ -24,5 +24,8 @@ endif # USE_LIBTOOL
 
 include $(srcdir)/../../Makefile.shared
 
-CHEWOUT_FILES = unctrl.def lock.def ffs.def
-CHAPTERS = misc.tex
+LIBC_CHEWOUT_FILES =
+LIBC_CHAPTERS =
+include ./local.mk
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
diff --git a/newlib/libc/misc/local.mk b/newlib/libc/misc/local.mk
new file mode 100644
index 000000000000..54a53efff220
--- /dev/null
+++ b/newlib/libc/misc/local.mk
@@ -0,0 +1,6 @@
+LIBC_CHEWOUT_FILES += \
+	%D%/ffs.def \
+	%D%/lock.def \
+	%D%/unctrl.def
+
+LIBC_CHAPTERS += %D%/misc.tex
diff --git a/newlib/libc/posix/Makefile.am b/newlib/libc/posix/Makefile.am
index 5fb1fa2afa1c..88976a14d4a9 100644
--- a/newlib/libc/posix/Makefile.am
+++ b/newlib/libc/posix/Makefile.am
@@ -49,10 +49,10 @@ endif # USE_LIBTOOL
 
 include $(srcdir)/../../Makefile.shared
 
-CHEWOUT_FILES = \
-	popen.def \
-	posix_spawn.def
-
-CHAPTERS = posix.tex
+LIBC_CHEWOUT_FILES =
+LIBC_CHAPTERS =
+include ./local.mk
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
 
 AM_CFLAGS = -D_GNU_SOURCE
diff --git a/newlib/libc/posix/local.mk b/newlib/libc/posix/local.mk
new file mode 100644
index 000000000000..74539dddbe72
--- /dev/null
+++ b/newlib/libc/posix/local.mk
@@ -0,0 +1,5 @@
+LIBC_CHEWOUT_FILES += \
+	%D%/popen.def \
+	%D%/posix_spawn.def
+
+LIBC_CHAPTERS += %D%/posix.tex
diff --git a/newlib/libc/reent/Makefile.am b/newlib/libc/reent/Makefile.am
index 622a74c82cea..c5396890d067 100644
--- a/newlib/libc/reent/Makefile.am
+++ b/newlib/libc/reent/Makefile.am
@@ -61,30 +61,10 @@ endif # USE_LIBTOOL
 
 include $(srcdir)/../../Makefile.shared
 
-CHEWOUT_FILES = \
-	closer.def \
-	reent.def \
-	execr.def \
-	fcntlr.def \
-	fstat64r.def \
-	fstatr.def \
-	gettimeofdayr.def \
-	linkr.def \
-	lseek64r.def \
-	lseekr.def \
-	mkdirr.def \
-	open64r.def \
-	openr.def \
-	readr.def \
-	renamer.def \
-	signalr.def \
-	sbrkr.def \
-	stat64r.def \
-	statr.def \
-	timesr.def \
-	unlinkr.def \
-	writer.def
-
-CHAPTERS = reent.tex
+LIBC_CHEWOUT_FILES =
+LIBC_CHAPTERS =
+include ./local.mk
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
 
 $(lpfx)impure.$(oext): $(srcdir)/impure.c $(srcdir)/../include/sys/reent.h
diff --git a/newlib/libc/reent/local.mk b/newlib/libc/reent/local.mk
new file mode 100644
index 000000000000..975a8d82a83a
--- /dev/null
+++ b/newlib/libc/reent/local.mk
@@ -0,0 +1,25 @@
+LIBC_CHEWOUT_FILES += \
+	%D%/closer.def \
+	%D%/reent.def \
+	%D%/execr.def \
+	%D%/fcntlr.def \
+	%D%/fstatr.def \
+	%D%/gettimeofdayr.def \
+	%D%/linkr.def \
+	%D%/lseekr.def \
+	%D%/mkdirr.def \
+	%D%/openr.def \
+	%D%/readr.def \
+	%D%/renamer.def \
+	%D%/signalr.def \
+	%D%/sbrkr.def \
+	%D%/statr.def \
+	%D%/timesr.def \
+	%D%/unlinkr.def \
+	%D%/fstat64r.def \
+	%D%/lseek64r.def \
+	%D%/stat64r.def \
+	%D%/open64r.def \
+	%D%/writer.def
+
+LIBC_CHAPTERS += %D%/reent.tex
diff --git a/newlib/libc/search/Makefile.am b/newlib/libc/search/Makefile.am
index 5c5e0dcf6264..ef1c1e223376 100644
--- a/newlib/libc/search/Makefile.am
+++ b/newlib/libc/search/Makefile.am
@@ -61,11 +61,10 @@ lib_a_CFLAGS = $(AM_CFLAGS)
 noinst_DATA =
 endif # USE_LIBTOOL
 
-CHEWOUT_FILES = \
-	bsearch.def \
-	qsort.def \
-	qsort_r.def
-
-CHAPTERS =
-
 include $(srcdir)/../../Makefile.shared
+
+LIBC_CHEWOUT_FILES =
+LIBC_CHAPTERS =
+include ./local.mk
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
diff --git a/newlib/libc/search/local.mk b/newlib/libc/search/local.mk
new file mode 100644
index 000000000000..a1704539b04c
--- /dev/null
+++ b/newlib/libc/search/local.mk
@@ -0,0 +1,4 @@
+LIBC_CHEWOUT_FILES += \
+	%D%/bsearch.def \
+	%D%/qsort.def \
+	%D%/qsort_r.def
diff --git a/newlib/libc/signal/Makefile.am b/newlib/libc/signal/Makefile.am
index 4b5bc209ca26..1f644b9c9ef3 100644
--- a/newlib/libc/signal/Makefile.am
+++ b/newlib/libc/signal/Makefile.am
@@ -19,6 +19,8 @@ endif # USE_LIBTOOL
 
 include $(srcdir)/../../Makefile.shared
 
-CHEWOUT_FILES = psignal.def raise.def signal.def sig2str.def
-
-CHAPTERS = signal.tex
+LIBC_CHEWOUT_FILES =
+LIBC_CHAPTERS =
+include ./local.mk
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
diff --git a/newlib/libc/signal/local.mk b/newlib/libc/signal/local.mk
new file mode 100644
index 000000000000..e0da75349a18
--- /dev/null
+++ b/newlib/libc/signal/local.mk
@@ -0,0 +1,7 @@
+LIBC_CHEWOUT_FILES += \
+	%D%/psignal.def \
+	%D%/raise.def \
+	%D%/signal.def \
+	%D%/sig2str.def
+
+LIBC_CHAPTERS += %D%/signal.tex
diff --git a/newlib/libc/ssp/Makefile.am b/newlib/libc/ssp/Makefile.am
index 937741cd62d2..2d0a25d0c63f 100644
--- a/newlib/libc/ssp/Makefile.am
+++ b/newlib/libc/ssp/Makefile.am
@@ -61,7 +61,10 @@ lib_a_CFLAGS = $(AM_CFLAGS)
 noinst_DATA =
 endif # USE_LIBTOOL
 
-CHEWOUT_FILES =
-CHAPTERS = ssp.tex
-
 include $(srcdir)/../../Makefile.shared
+
+LIBC_CHEWOUT_FILES =
+LIBC_CHAPTERS =
+include ./local.mk
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
diff --git a/newlib/libc/ssp/local.mk b/newlib/libc/ssp/local.mk
new file mode 100644
index 000000000000..e87115b50025
--- /dev/null
+++ b/newlib/libc/ssp/local.mk
@@ -0,0 +1,3 @@
+LIBC_CHEWOUT_FILES +=
+
+LIBC_CHAPTERS += %D%/ssp.tex
diff --git a/newlib/libc/stdio/Makefile.am b/newlib/libc/stdio/Makefile.am
index 30339033c8f6..25207cea26bb 100644
--- a/newlib/libc/stdio/Makefile.am
+++ b/newlib/libc/stdio/Makefile.am
@@ -6,91 +6,91 @@ if NEWLIB_NANO_FORMATTED_IO
 GENERAL_INT_FORMATTED_IO_SOURCES =
 else
 GENERAL_INT_FORMATTED_IO_SOURCES = \
-	fiprintf.c			\
-	fiscanf.c			\
-	iprintf.c			\
-	iscanf.c			\
-	siprintf.c			\
-	siscanf.c			\
-	sniprintf.c			\
-	vdiprintf.c			\
-	vfprintf.c			\
-	vfwprintf.c			\
-	viprintf.c			\
-	viscanf.c			\
-	vsiprintf.c			\
-	vsiscanf.c			\
-	vsniprintf.c
+	%D%/fiprintf.c			\
+	%D%/fiscanf.c			\
+	%D%/iprintf.c			\
+	%D%/iscanf.c			\
+	%D%/siprintf.c			\
+	%D%/siscanf.c			\
+	%D%/sniprintf.c			\
+	%D%/vdiprintf.c			\
+	%D%/vfprintf.c			\
+	%D%/vfwprintf.c			\
+	%D%/viprintf.c			\
+	%D%/viscanf.c			\
+	%D%/vsiprintf.c			\
+	%D%/vsiscanf.c			\
+	%D%/vsniprintf.c
 endif
 
 GENERAL_SOURCES = \
-	$(GENERAL_INT_FORMATTED_IO_SOURCES) \
-	clearerr.c			\
-	fclose.c			\
-	fdopen.c			\
-	feof.c				\
-	ferror.c			\
-	fflush.c			\
-	fgetc.c			\
-	fgetpos.c			\
-	fgets.c			\
-	fileno.c			\
-	findfp.c			\
-	flags.c			\
-	fopen.c			\
-	fprintf.c			\
-	fputc.c			\
-	fputs.c			\
-	fread.c			\
-	freopen.c			\
-	fscanf.c			\
-	fseek.c			\
-	fsetpos.c			\
-	ftell.c			\
-	fvwrite.c			\
-	fwalk.c			\
-	fwrite.c			\
-	getc.c				\
-	getchar.c			\
-	getc_u.c			\
-	getchar_u.c			\
-	getdelim.c			\
-	getline.c			\
-	gets.c				\
-	makebuf.c			\
-	perror.c			\
-	printf.c			\
-	putc.c				\
-	putchar.c			\
-	putc_u.c			\
-	putchar_u.c			\
-	puts.c				\
-	refill.c			\
-	remove.c			\
-	rename.c			\
-	rewind.c			\
-	rget.c				\
-	scanf.c			\
-	sccl.c				\
-	setbuf.c			\
-	setbuffer.c			\
-	setlinebuf.c			\
-	setvbuf.c			\
-	snprintf.c			\
-	sprintf.c			\
-	sscanf.c			\
-	stdio.c			\
-	tmpfile.c			\
-	tmpnam.c			\
-	ungetc.c			\
-	vdprintf.c			\
-	vprintf.c			\
-	vscanf.c			\
-	vsnprintf.c			\
-	vsprintf.c			\
-	vsscanf.c			\
-	wbuf.c				\
-	wsetup.c
+	%D%/$(GENERAL_INT_FORMATTED_IO_SOURCES) \
+	%D%/clearerr.c			\
+	%D%/fclose.c			\
+	%D%/fdopen.c			\
+	%D%/feof.c				\
+	%D%/ferror.c			\
+	%D%/fflush.c			\
+	%D%/fgetc.c			\
+	%D%/fgetpos.c			\
+	%D%/fgets.c			\
+	%D%/fileno.c			\
+	%D%/findfp.c			\
+	%D%/flags.c			\
+	%D%/fopen.c			\
+	%D%/fprintf.c			\
+	%D%/fputc.c			\
+	%D%/fputs.c			\
+	%D%/fread.c			\
+	%D%/freopen.c			\
+	%D%/fscanf.c			\
+	%D%/fseek.c			\
+	%D%/fsetpos.c			\
+	%D%/ftell.c			\
+	%D%/fvwrite.c			\
+	%D%/fwalk.c			\
+	%D%/fwrite.c			\
+	%D%/getc.c				\
+	%D%/getchar.c			\
+	%D%/getc_u.c			\
+	%D%/getchar_u.c			\
+	%D%/getdelim.c			\
+	%D%/getline.c			\
+	%D%/gets.c				\
+	%D%/makebuf.c			\
+	%D%/perror.c			\
+	%D%/printf.c			\
+	%D%/putc.c				\
+	%D%/putchar.c			\
+	%D%/putc_u.c			\
+	%D%/putchar_u.c			\
+	%D%/puts.c				\
+	%D%/refill.c			\
+	%D%/remove.c			\
+	%D%/rename.c			\
+	%D%/rewind.c			\
+	%D%/rget.c				\
+	%D%/scanf.c			\
+	%D%/sccl.c				\
+	%D%/setbuf.c			\
+	%D%/setbuffer.c			\
+	%D%/setlinebuf.c			\
+	%D%/setvbuf.c			\
+	%D%/snprintf.c			\
+	%D%/sprintf.c			\
+	%D%/sscanf.c			\
+	%D%/stdio.c			\
+	%D%/tmpfile.c			\
+	%D%/tmpnam.c			\
+	%D%/ungetc.c			\
+	%D%/vdprintf.c			\
+	%D%/vprintf.c			\
+	%D%/vscanf.c			\
+	%D%/vsnprintf.c			\
+	%D%/vsprintf.c			\
+	%D%/vsscanf.c			\
+	%D%/wbuf.c				\
+	%D%/wsetup.c
 
 ## The following are EL/IX level 2 interfaces
 if ELIX_LEVEL_1
@@ -100,20 +100,20 @@ if NEWLIB_NANO_FORMATTED_IO
 ELIX_2_INT_FORMATTED_IO_SOURCES =
 else
 ELIX_2_INT_FORMATTED_IO_SOURCES = \
-	asiprintf.c		\
-	vasiprintf.c
+	%D%/asiprintf.c		\
+	%D%/vasiprintf.c
 
 endif !NEWLIB_NANO_FORMATTED_IO
 ELIX_2_SOURCES = \
-	$(ELIX_2_INT_FORMATTED_IO_SOURCES) \
-	asprintf.c		\
-	fcloseall.c		\
-	fseeko.c		\
-	ftello.c		\
-	getw.c			\
-	mktemp.c		\
-	putw.c			\
-	vasprintf.c
+	%D%/$(ELIX_2_INT_FORMATTED_IO_SOURCES) \
+	%D%/asprintf.c		\
+	%D%/fcloseall.c		\
+	%D%/fseeko.c		\
+	%D%/ftello.c		\
+	%D%/getw.c			\
+	%D%/mktemp.c		\
+	%D%/putw.c			\
+	%D%/vasprintf.c
 endif !ELIX_LEVEL_1
 
 ## The following are EL/IX level 2 interfaces
@@ -130,62 +130,62 @@ if NEWLIB_NANO_FORMATTED_IO
 ELIX_4_INT_FORMATTED_IO_SOURCES =
 else
 ELIX_4_INT_FORMATTED_IO_SOURCES = \
-	asniprintf.c		\
-	diprintf.c		\
-	vasniprintf.c
+	%D%/asniprintf.c		\
+	%D%/diprintf.c		\
+	%D%/vasniprintf.c
 
 endif !NEWLIB_NANO_FORMATTED_IO
 ELIX_4_SOURCES = \
-	$(ELIX_4_INT_FORMATTED_IO_SOURCES) \
-	asnprintf.c		\
-	clearerr_u.c		\
-	dprintf.c		\
-	feof_u.c		\
-	ferror_u.c		\
-	fflush_u.c		\
-	fgetc_u.c		\
-	fgets_u.c		\
-	fgetwc.c		\
-	fgetwc_u.c		\
-	fgetws.c		\
-	fgetws_u.c		\
-	fileno_u.c		\
-	fmemopen.c		\
-	fopencookie.c		\
-	fpurge.c		\
-	fputc_u.c		\
-	fputs_u.c		\
-	fputwc.c		\
-	fputwc_u.c		\
-	fputws.c		\
-	fputws_u.c		\
-	fread_u.c		\
-	fsetlocking.c		\
-	funopen.c		\
-	fwide.c			\
-	fwprintf.c		\
-	fwrite_u.c		\
-	fwscanf.c		\
-	getwc.c			\
-	getwc_u.c		\
-	getwchar.c		\
-	getwchar_u.c		\
-	open_memstream.c	\
-	putwc.c			\
-	putwc_u.c		\
-	putwchar.c		\
-	putwchar_u.c		\
-	stdio_ext.c		\
-	swprintf.c		\
-	swscanf.c		\
-	ungetwc.c		\
-	vasnprintf.c		\
-	vswprintf.c		\
-	vswscanf.c		\
-	vwprintf.c		\
-	vwscanf.c		\
-	wprintf.c		\
-	wscanf.c
+	%D%/$(ELIX_4_INT_FORMATTED_IO_SOURCES) \
+	%D%/asnprintf.c		\
+	%D%/clearerr_u.c		\
+	%D%/dprintf.c		\
+	%D%/feof_u.c		\
+	%D%/ferror_u.c		\
+	%D%/fflush_u.c		\
+	%D%/fgetc_u.c		\
+	%D%/fgets_u.c		\
+	%D%/fgetwc.c		\
+	%D%/fgetwc_u.c		\
+	%D%/fgetws.c		\
+	%D%/fgetws_u.c		\
+	%D%/fileno_u.c		\
+	%D%/fmemopen.c		\
+	%D%/fopencookie.c		\
+	%D%/fpurge.c		\
+	%D%/fputc_u.c		\
+	%D%/fputs_u.c		\
+	%D%/fputwc.c		\
+	%D%/fputwc_u.c		\
+	%D%/fputws.c		\
+	%D%/fputws_u.c		\
+	%D%/fread_u.c		\
+	%D%/fsetlocking.c		\
+	%D%/funopen.c		\
+	%D%/fwide.c			\
+	%D%/fwprintf.c		\
+	%D%/fwrite_u.c		\
+	%D%/fwscanf.c		\
+	%D%/getwc.c			\
+	%D%/getwc_u.c		\
+	%D%/getwchar.c		\
+	%D%/getwchar_u.c		\
+	%D%/open_memstream.c	\
+	%D%/putwc.c			\
+	%D%/putwc_u.c		\
+	%D%/putwchar.c		\
+	%D%/putwchar_u.c		\
+	%D%/stdio_ext.c		\
+	%D%/swprintf.c		\
+	%D%/swscanf.c		\
+	%D%/ungetwc.c		\
+	%D%/vasnprintf.c		\
+	%D%/vswprintf.c		\
+	%D%/vswscanf.c		\
+	%D%/vwprintf.c		\
+	%D%/vwscanf.c		\
+	%D%/wprintf.c		\
+	%D%/wscanf.c
 
 endif !ELIX_LEVEL_3
 endif !ELIX_LEVEL_2
@@ -193,31 +193,31 @@ endif !ELIX_LEVEL_1
 
 if NEWLIB_NANO_FORMATTED_IO
 LIBADD_OBJS = \
-	$(lpfx)nano-vfprintf_float.$(oext)	\
-	$(lpfx)nano-svfprintf.$(oext)		\
-	$(lpfx)nano-svfscanf.$(oext)		\
-	$(lpfx)nano-vfprintf.$(oext)		\
-	$(lpfx)nano-vfprintf_i.$(oext)		\
-	$(lpfx)nano-vfscanf.$(oext)		\
-	$(lpfx)nano-vfscanf_i.$(oext)		\
-	$(lpfx)nano-vfscanf_float.$(oext)	\
-	$(lpfx)svfiwprintf.$(oext)		\
-	$(lpfx)svfwprintf.$(oext)		\
-	$(lpfx)vfiwprintf.$(oext)		\
-	$(lpfx)svfiwscanf.$(oext)		\
-	$(lpfx)svfwscanf.$(oext)		\
-	$(lpfx)vfiwscanf.$(oext)		\
-	$(lpfx)vfwscanf.$(oext)
+	%D%/$(lpfx)nano-vfprintf_float.$(oext)	\
+	%D%/$(lpfx)nano-svfprintf.$(oext)		\
+	%D%/$(lpfx)nano-svfscanf.$(oext)		\
+	%D%/$(lpfx)nano-vfprintf.$(oext)		\
+	%D%/$(lpfx)nano-vfprintf_i.$(oext)		\
+	%D%/$(lpfx)nano-vfscanf.$(oext)		\
+	%D%/$(lpfx)nano-vfscanf_i.$(oext)		\
+	%D%/$(lpfx)nano-vfscanf_float.$(oext)	\
+	%D%/$(lpfx)svfiwprintf.$(oext)		\
+	%D%/$(lpfx)svfwprintf.$(oext)		\
+	%D%/$(lpfx)vfiwprintf.$(oext)		\
+	%D%/$(lpfx)svfiwscanf.$(oext)		\
+	%D%/$(lpfx)svfwscanf.$(oext)		\
+	%D%/$(lpfx)vfiwscanf.$(oext)		\
+	%D%/$(lpfx)vfwscanf.$(oext)
 else
 LIBADD_OBJS = \
-	$(lpfx)svfiprintf.$(oext) $(lpfx)svfprintf.$(oext) \
-	$(lpfx)svfiscanf.$(oext) $(lpfx)svfscanf.$(oext) \
-	$(lpfx)vfiprintf.$(oext) \
-	$(lpfx)vfscanf.$(oext) $(lpfx)vfiscanf.$(oext) \
-	$(lpfx)svfiwprintf.$(oext) $(lpfx)svfwprintf.$(oext) \
-	$(lpfx)vfiwprintf.$(oext) \
-	$(lpfx)svfiwscanf.$(oext) $(lpfx)svfwscanf.$(oext) \
-	$(lpfx)vfiwscanf.$(oext) $(lpfx)vfwscanf.$(oext)
+	%D%/$(lpfx)svfiprintf.$(oext) $(lpfx)svfprintf.$(oext) \
+	%D%/$(lpfx)svfiscanf.$(oext) $(lpfx)svfscanf.$(oext) \
+	%D%/$(lpfx)vfiprintf.$(oext) \
+	%D%/$(lpfx)vfscanf.$(oext) $(lpfx)vfiscanf.$(oext) \
+	%D%/$(lpfx)svfiwprintf.$(oext) $(lpfx)svfwprintf.$(oext) \
+	%D%/$(lpfx)vfiwprintf.$(oext) \
+	%D%/$(lpfx)svfiwscanf.$(oext) $(lpfx)svfwscanf.$(oext) \
+	%D%/$(lpfx)vfiwscanf.$(oext) $(lpfx)vfwscanf.$(oext)
 endif
 
 libstdio_la_LDFLAGS = -Xcompiler -nostdlib
@@ -241,6 +241,11 @@ endif # USE_LIBTOOL
 
 include $(srcdir)/../../Makefile.shared
 
+LIBC_CHEWOUT_FILES =
+LIBC_CHAPTERS =
+include ./local.mk
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
 
 # Though small footprint nano-formatted-IO implementation is used
 # when NEWLIB_NANO_FORMATTED_IO is enabled, we keep all rules for
@@ -252,158 +257,77 @@ include $(srcdir)/../../Makefile.shared
 if NEWLIB_NANO_FORMATTED_IO
 # Rules compiling small-footprint nano-formatted-io implementation.
 $(lpfx)nano-vfprintf.$(oext): nano-vfprintf.c
-	$(LIB_COMPILE) -c $(srcdir)/nano-vfprintf.c -o $@
+	%D%/$(LIB_COMPILE) -c $(srcdir)/nano-vfprintf.c -o $@
 
 $(lpfx)nano-vfprintf_i.$(oext): nano-vfprintf_i.c
-	$(LIB_COMPILE) -c $(srcdir)/nano-vfprintf_i.c -o $@
+	%D%/$(LIB_COMPILE) -c $(srcdir)/nano-vfprintf_i.c -o $@
 
 $(lpfx)nano-vfprintf_float.$(oext): nano-vfprintf_float.c
-	$(LIB_COMPILE) -c $(srcdir)/nano-vfprintf_float.c -o $@
+	%D%/$(LIB_COMPILE) -c $(srcdir)/nano-vfprintf_float.c -o $@
 
 $(lpfx)nano-svfprintf.$(oext): nano-vfprintf.c
-	$(LIB_COMPILE) -DSTRING_ONLY -c $(srcdir)/nano-vfprintf.c -o $@
+	%D%/$(LIB_COMPILE) -DSTRING_ONLY -c $(srcdir)/nano-vfprintf.c -o $@
 endif
 
 # This rule is needed so that libtool compiles vfiprintf before vfprintf.
 # Otherwise libtool moves vfprintf.o and subsequently can't find it.
 
 $(lpfx)vfiprintf.$(oext): vfprintf.c
-	$(LIB_COMPILE) -DINTEGER_ONLY -c $(srcdir)/vfprintf.c -o $@
+	%D%/$(LIB_COMPILE) -DINTEGER_ONLY -c $(srcdir)/vfprintf.c -o $@
 
 $(lpfx)svfprintf.$(oext): vfprintf.c
-	$(LIB_COMPILE) -DSTRING_ONLY -c $(srcdir)/vfprintf.c -o $@
+	%D%/$(LIB_COMPILE) -DSTRING_ONLY -c $(srcdir)/vfprintf.c -o $@
 
 $(lpfx)svfiprintf.$(oext): vfprintf.c
-	$(LIB_COMPILE) -DINTEGER_ONLY -DSTRING_ONLY -c $(srcdir)/vfprintf.c -o $@
+	%D%/$(LIB_COMPILE) -DINTEGER_ONLY -DSTRING_ONLY -c $(srcdir)/vfprintf.c -o $@
 
 $(lpfx)vfiwprintf.$(oext): vfwprintf.c
-	$(LIB_COMPILE) -DINTEGER_ONLY -c $(srcdir)/vfwprintf.c -o $@
+	%D%/$(LIB_COMPILE) -DINTEGER_ONLY -c $(srcdir)/vfwprintf.c -o $@
 
 $(lpfx)svfwprintf.$(oext): vfwprintf.c
-	$(LIB_COMPILE) -DSTRING_ONLY -c $(srcdir)/vfwprintf.c -o $@
+	%D%/$(LIB_COMPILE) -DSTRING_ONLY -c $(srcdir)/vfwprintf.c -o $@
 
 $(lpfx)svfiwprintf.$(oext): vfwprintf.c
-	$(LIB_COMPILE) -DINTEGER_ONLY -DSTRING_ONLY -c $(srcdir)/vfwprintf.c -o $@
+	%D%/$(LIB_COMPILE) -DINTEGER_ONLY -DSTRING_ONLY -c $(srcdir)/vfwprintf.c -o $@
 
 if NEWLIB_NANO_FORMATTED_IO
 # Rules compiling small-footprint nano-formatted-io implementation.
 $(lpfx)nano-vfscanf.$(oext): nano-vfscanf.c
-	$(LIB_COMPILE) -c $(srcdir)/nano-vfscanf.c -o $@
+	%D%/$(LIB_COMPILE) -c $(srcdir)/nano-vfscanf.c -o $@
 
 $(lpfx)nano-vfscanf_i.$(oext): nano-vfscanf_i.c
-	$(LIB_COMPILE) -c $(srcdir)/nano-vfscanf_i.c -o $@
+	%D%/$(LIB_COMPILE) -c $(srcdir)/nano-vfscanf_i.c -o $@
 
 $(lpfx)nano-vfscanf_float.$(oext): nano-vfscanf_float.c
-	$(LIB_COMPILE) -c $(srcdir)/nano-vfscanf_float.c -o $@
+	%D%/$(LIB_COMPILE) -c $(srcdir)/nano-vfscanf_float.c -o $@
 
 $(lpfx)nano-svfscanf.$(oext): nano-vfscanf.c
-	$(LIB_COMPILE) -DSTRING_ONLY -c $(srcdir)/nano-vfscanf.c -o $@
+	%D%/$(LIB_COMPILE) -DSTRING_ONLY -c $(srcdir)/nano-vfscanf.c -o $@
 endif
 
 $(lpfx)vfscanf.$(oext): vfscanf.c
-	$(LIB_COMPILE) -c $(srcdir)/vfscanf.c -o $@
+	%D%/$(LIB_COMPILE) -c $(srcdir)/vfscanf.c -o $@
 
 $(lpfx)vfiscanf.$(oext): vfscanf.c
-	$(LIB_COMPILE) -DINTEGER_ONLY -c $(srcdir)/vfscanf.c -o $@
+	%D%/$(LIB_COMPILE) -DINTEGER_ONLY -c $(srcdir)/vfscanf.c -o $@
 
 $(lpfx)svfscanf.$(oext): vfscanf.c
-	$(LIB_COMPILE) -DSTRING_ONLY -c $(srcdir)/vfscanf.c -o $@
+	%D%/$(LIB_COMPILE) -DSTRING_ONLY -c $(srcdir)/vfscanf.c -o $@
 
 $(lpfx)svfiscanf.$(oext): vfscanf.c
-	$(LIB_COMPILE) -DINTEGER_ONLY -DSTRING_ONLY -c $(srcdir)/vfscanf.c -o $@
+	%D%/$(LIB_COMPILE) -DINTEGER_ONLY -DSTRING_ONLY -c $(srcdir)/vfscanf.c -o $@
 
 $(lpfx)vfwscanf.$(oext): vfwscanf.c
-	$(LIB_COMPILE) -c $(srcdir)/vfwscanf.c -o $@
+	%D%/$(LIB_COMPILE) -c $(srcdir)/vfwscanf.c -o $@
 
 $(lpfx)vfiwscanf.$(oext): vfwscanf.c
-	$(LIB_COMPILE) -DINTEGER_ONLY -c $(srcdir)/vfwscanf.c -o $@
+	%D%/$(LIB_COMPILE) -DINTEGER_ONLY -c $(srcdir)/vfwscanf.c -o $@
 
 $(lpfx)svfwscanf.$(oext): vfwscanf.c
-	$(LIB_COMPILE) -DSTRING_ONLY -c $(srcdir)/vfwscanf.c -o $@
+	%D%/$(LIB_COMPILE) -DSTRING_ONLY -c $(srcdir)/vfwscanf.c -o $@
 
 $(lpfx)svfiwscanf.$(oext): vfwscanf.c
-	$(LIB_COMPILE) -DINTEGER_ONLY -DSTRING_ONLY -c $(srcdir)/vfwscanf.c -o $@
-
-CHEWOUT_FILES = \
-	clearerr.def		\
-	diprintf.def		\
-	dprintf.def		\
-	fclose.def		\
-	fcloseall.def		\
-	fdopen.def		\
-	feof.def		\
-	ferror.def		\
-	fflush.def		\
-	fgetc.def		\
-	fgetpos.def		\
-	fgets.def		\
-	fgetwc.def		\
-	fgetws.def		\
-	fileno.def		\
-	fmemopen.def		\
-	fopen.def		\
-	fopencookie.def		\
-	fpurge.def		\
-	fputc.def		\
-	fputs.def		\
-	fputwc.def		\
-	fputws.def		\
-	fread.def		\
-	freopen.def		\
-	fseek.def		\
-	fsetlocking.def		\
-	fsetpos.def		\
-	ftell.def		\
-	funopen.def		\
-	fwide.def		\
-	fwrite.def		\
-	getc.def		\
-	getc_u.def		\
-	getchar.def		\
-	getchar_u.def		\
-	getdelim.def		\
-	getline.def		\
-	gets.def		\
-	getw.def		\
-	getwchar.def		\
-	mktemp.def		\
-	nano-vfprintf.def	\
-	nano-vfscanf.def	\
-	open_memstream.def	\
-	perror.def		\
-	putc.def		\
-	putc_u.def		\
-	putchar.def		\
-	putchar_u.def		\
-	puts.def		\
-	putw.def		\
-	putwchar.def		\
-	remove.def		\
-	rename.def		\
-	rewind.def		\
-	setbuf.def		\
-	setbuffer.def		\
-	setlinebuf.def		\
-	setvbuf.def		\
-	siprintf.def		\
-	siscanf.def		\
-	sprintf.def		\
-	sscanf.def		\
-	stdio_ext.def		\
-	swprintf.def		\
-	swscanf.def		\
-	tmpfile.def		\
-	tmpnam.def		\
-	ungetc.def		\
-	ungetwc.def		\
-	vfprintf.def		\
-	vfscanf.def		\
-	vfwprintf.def		\
-	vfwscanf.def		\
-	viprintf.def		\
-	viscanf.def
-
-CHAPTERS = stdio.tex
+	%D%/$(LIB_COMPILE) -DINTEGER_ONLY -DSTRING_ONLY -c $(srcdir)/vfwscanf.c -o $@
 
 $(lpfx)clearerr.$(oext): local.h
 $(lpfx)clearerr_u.$(oext): local.h
diff --git a/newlib/libc/stdio/local.mk b/newlib/libc/stdio/local.mk
new file mode 100644
index 000000000000..2e1b8c416ddf
--- /dev/null
+++ b/newlib/libc/stdio/local.mk
@@ -0,0 +1,80 @@
+LIBC_CHEWOUT_FILES += \
+	%D%/clearerr.def \
+	%D%/diprintf.def \
+	%D%/dprintf.def \
+	%D%/fcloseall.def \
+	%D%/fclose.def \
+	%D%/fdopen.def \
+	%D%/feof.def \
+	%D%/ferror.def \
+	%D%/fflush.def \
+	%D%/fgetc.def \
+	%D%/fgetpos.def \
+	%D%/fgets.def \
+	%D%/fgetwc.def \
+	%D%/fgetws.def \
+	%D%/fileno.def \
+	%D%/fmemopen.def \
+	%D%/fopen.def \
+	%D%/fopencookie.def \
+	%D%/fpurge.def \
+	%D%/fputc.def \
+	%D%/fputs.def \
+	%D%/fputwc.def \
+	%D%/fputws.def \
+	%D%/fread.def \
+	%D%/freopen.def \
+	%D%/fseek.def \
+	%D%/fsetlocking.def \
+	%D%/fsetpos.def \
+	%D%/ftell.def \
+	%D%/funopen.def \
+	%D%/fwide.def \
+	%D%/fwrite.def \
+	%D%/getc.def \
+	%D%/getc_u.def \
+	%D%/getchar.def \
+	%D%/getchar_u.def \
+	%D%/getdelim.def \
+	%D%/getline.def \
+	%D%/gets.def \
+	%D%/getw.def \
+	%D%/getwchar.def \
+	%D%/mktemp.def \
+	%D%/nano-vfprintf.def \
+	%D%/nano-vfscanf.def \
+	%D%/open_memstream.def \
+	%D%/perror.def \
+	%D%/putc.def \
+	%D%/putc_u.def \
+	%D%/putchar.def \
+	%D%/putchar_u.def \
+	%D%/puts.def \
+	%D%/putw.def \
+	%D%/putwchar.def \
+	%D%/remove.def \
+	%D%/rename.def \
+	%D%/rewind.def \
+	%D%/setbuf.def \
+	%D%/setbuffer.def \
+	%D%/setlinebuf.def \
+	%D%/setvbuf.def \
+	%D%/siprintf.def \
+	%D%/siscanf.def \
+	%D%/sprintf.def \
+	%D%/sscanf.def \
+	%D%/stdio_ext.def \
+	%D%/swprintf.def \
+	%D%/swscanf.def \
+	%D%/tmpfile.def \
+	%D%/tmpnam.def \
+	%D%/ungetc.def \
+	%D%/ungetwc.def \
+	%D%/vfprintf.def \
+	%D%/vfscanf.def \
+	%D%/vfwprintf.def \
+	%D%/vfwscanf.def \
+	%D%/viprintf.def \
+	%D%/viscanf.def
+
+LIBC_CHAPTERS += %D%/stdio.tex
diff --git a/newlib/libc/stdio64/Makefile.am b/newlib/libc/stdio64/Makefile.am
index 074107e0c5ae..e93f7056518c 100644
--- a/newlib/libc/stdio64/Makefile.am
+++ b/newlib/libc/stdio64/Makefile.am
@@ -38,16 +38,10 @@ endif # USE_LIBTOOL
 
 include $(srcdir)/../../Makefile.shared
 
-AM_CFLAGS = -I $(srcdir)/../stdio
+LIBC_CHEWOUT_FILES =
+LIBC_CHAPTERS =
+include ./local.mk
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
 
-CHEWOUT_FILES = \
-	fdopen64.def		\
-	fgetpos64.def		\
-	fopen64.def		\
-	freopen64.def		\
-	fseeko64.def		\
-	fsetpos64.def		\
-	ftello64.def		\
-	tmpfile64.def
-
-CHAPTERS = stdio64.tex
+AM_CFLAGS = -I $(srcdir)/../stdio
diff --git a/newlib/libc/stdio64/local.mk b/newlib/libc/stdio64/local.mk
new file mode 100644
index 000000000000..bfe252766f81
--- /dev/null
+++ b/newlib/libc/stdio64/local.mk
@@ -0,0 +1,11 @@
+LIBC_CHEWOUT_FILES += \
+	%D%/fdopen64.def \
+	%D%/fgetpos64.def \
+	%D%/fopen64.def \
+	%D%/freopen64.def \
+	%D%/fseeko64.def \
+	%D%/fsetpos64.def \
+	%D%/ftello64.def \
+	%D%/tmpfile64.def
+
+LIBC_CHAPTERS += %D%/stdio64.tex
diff --git a/newlib/libc/stdlib/Makefile.am b/newlib/libc/stdlib/Makefile.am
index f0e3b0003915..4cfcab39a9d6 100644
--- a/newlib/libc/stdlib/Makefile.am
+++ b/newlib/libc/stdlib/Makefile.am
@@ -222,6 +222,12 @@ endif # USE_LIBTOOL
 
 include $(srcdir)/../../Makefile.shared
 
+LIBC_CHEWOUT_FILES =
+LIBC_CHAPTERS =
+include ./local.mk
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
+
 MALLOC_COMPILE = $(LIB_COMPILE) -DINTERNAL_NEWLIB
 
 $(lpfx)$(MALLOCR).$(oext): $(MALLOCR).c
@@ -260,58 +266,6 @@ $(lpfx)$(MSIZER).$(oext): $(MALLOCR).c
 $(lpfx)$(MALLOPTR).$(oext): $(MALLOCR).c
 	$(MALLOC_COMPILE) -DDEFINE_MALLOPT -c $(srcdir)/$(MALLOCR).c -o $@
 
-CHEWOUT_FILES= \
-	_Exit.def	\
-	a64l.def	\
-	abort.def	\
-	abs.def		\
-	assert.def	\
-	atexit.def	\
-	atof.def 	\
-	atoi.def 	\
-	atoll.def 	\
-	calloc.def	\
-	div.def		\
-	ecvtbuf.def	\
-	efgcvt.def 	\
-	envlock.def	\
-	exit.def	\
-	getenv.def	\
-	itoa.def	\
-	labs.def	\
-	ldiv.def	\
-	llabs.def	\
-	lldiv.def	\
-	malloc.def	\
-	mblen.def	\
-	mbsnrtowcs.def	\
-	mbstowcs.def	\
-	mbtowc.def	\
-	mlock.def	\
-	mstats.def	\
-	on_exit.def	\
-	rand.def	\
-	rand48.def	\
-	random.def	\
-	rpmatch.def	\
-	strtod.def 	\
-	strtol.def 	\
-	strtoll.def 	\
-	strtoul.def 	\
-	strtoull.def 	\
-	utoa.def	\
-	wcsnrtombs.def	\
-	wcstod.def 	\
-	wcstol.def 	\
-	wcstoll.def 	\
-	wcstoul.def 	\
-	wcstoull.def 	\
-	system.def	\
-	wcstombs.def	\
-	wctomb.def	
-
-CHAPTERS = stdlib.tex
-
 $(lpfx)dtoa.$(oext): dtoa.c mprec.h
 $(lpfx)ldtoa.$(oext): ldtoa.c mprec.h gdtoa.h
 $(lpfx)gdtoa-ldtoa.$(oext): gdtoa-ldtoa.c mprec.h gdtoaimp.h gdtoa.h
diff --git a/newlib/libc/stdlib/local.mk b/newlib/libc/stdlib/local.mk
new file mode 100644
index 000000000000..d2f199d8cab3
--- /dev/null
+++ b/newlib/libc/stdlib/local.mk
@@ -0,0 +1,51 @@
+LIBC_CHEWOUT_FILES += \
+	%D%/_Exit.def \
+	%D%/a64l.def \
+	%D%/abort.def \
+	%D%/abs.def \
+	%D%/assert.def \
+	%D%/atexit.def \
+	%D%/atof.def \
+	%D%/atoi.def \
+	%D%/atoll.def \
+	%D%/calloc.def \
+	%D%/div.def \
+	%D%/ecvtbuf.def \
+	%D%/efgcvt.def \
+	%D%/envlock.def \
+	%D%/exit.def \
+	%D%/getenv.def \
+	%D%/itoa.def \
+	%D%/labs.def \
+	%D%/ldiv.def \
+	%D%/llabs.def \
+	%D%/lldiv.def \
+	%D%/malloc.def \
+	%D%/mblen.def \
+	%D%/mbsnrtowcs.def \
+	%D%/mbstowcs.def \
+	%D%/mbtowc.def \
+	%D%/mlock.def \
+	%D%/mstats.def \
+	%D%/on_exit.def \
+	%D%/rand.def \
+	%D%/rand48.def \
+	%D%/random.def \
+	%D%/rpmatch.def \
+	%D%/strtod.def \
+	%D%/strtol.def \
+	%D%/strtoll.def \
+	%D%/strtoul.def \
+	%D%/strtoull.def \
+	%D%/utoa.def \
+	%D%/wcsnrtombs.def \
+	%D%/wcstod.def \
+	%D%/wcstol.def \
+	%D%/wcstoll.def \
+	%D%/wcstoul.def \
+	%D%/wcstoull.def \
+	%D%/system.def \
+	%D%/wcstombs.def \
+	%D%/wctomb.def
+
+LIBC_CHAPTERS += %D%/stdlib.tex
diff --git a/newlib/libc/string/Makefile.am b/newlib/libc/string/Makefile.am
index 7eb9fcdbcf6a..70bf7afdc01f 100644
--- a/newlib/libc/string/Makefile.am
+++ b/newlib/libc/string/Makefile.am
@@ -144,25 +144,8 @@ endif # USE_LIBTOOL
 
 include $(srcdir)/../../Makefile.shared
 
-CHEWOUT_FILES=\
-bcmp.def	memcpy.def	strcmp.def	strncat.def strstr.def \
-bcopy.def	memmove.def	strcoll.def	strncmp.def strtok.def \
-bzero.def	memset.def	strcpy.def	strncpy.def strxfrm.def \
-index.def	rindex.def	strcspn.def	strpbrk.def swab.def \
-memchr.def	strcat.def	strerror.def	strerror_r.def strrchr.def \
-memcmp.def	strchr.def	strlen.def	strnlen.def strspn.def \
-strcasecmp.def	strncasecmp.def strcasestr.def	strlwr.def  strupr.def \
-memccpy.def 	mempcpy.def	stpcpy.def	stpncpy.def strsignal.def \
-wcscasecmp.def	wcscat.def	wcschr.def	wcscmp.def wcscoll.def \
-wcscpy.def	wcscspn.def	wcpcpy.def	wcpncpy.def wcsdup.def \
-wcslcat.def	wcslcpy.def	wcslen.def	wcsncasecmp.def wcsncat.def \
-wcsncmp.def	wcsncpy.def	wcsnlen.def	wcspbrk.def \
-wcsrchr.def	wcsspn.def	wcsstr.def 	wcstok.def  \
-wcswidth.def	wcsxfrm.def	wcwidth.def	wmemchr.def \
-wmemcmp.def	wmemcpy.def	wmemmove.def	wmemset.def \
-memmem.def	memrchr.def	rawmemchr.def	strchrnul.def \
-strcasecmp_l.def strcoll_l.def	strncasecmp_l.def strxfrm_l.def \
-wcscasecmp_l.def wcscoll_l.def	wcsncasecmp_l.def wcsxfrm_l.def \
-strverscmp.def	strnstr.def	wmempcpy.def
-
-CHAPTERS = strings.tex wcstrings.tex
+LIBC_CHEWOUT_FILES =
+LIBC_CHAPTERS =
+include ./local.mk
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
diff --git a/newlib/libc/string/local.mk b/newlib/libc/string/local.mk
new file mode 100644
index 000000000000..5bcec8dd4ca6
--- /dev/null
+++ b/newlib/libc/string/local.mk
@@ -0,0 +1,22 @@
+LIBC_CHEWOUT_FILES += \
+	%D%/bcmp.def	%D%/memcpy.def	%D%/strcmp.def	%D%/strncat.def %D%/strstr.def \
+	%D%/bcopy.def	%D%/memmove.def	%D%/strcoll.def	%D%/strncmp.def %D%/strtok.def \
+	%D%/bzero.def	%D%/memset.def	%D%/strcpy.def	%D%/strncpy.def %D%/strxfrm.def \
+	%D%/index.def	%D%/rindex.def	%D%/strcspn.def	%D%/strpbrk.def %D%/swab.def \
+	%D%/memchr.def	%D%/strcat.def	%D%/strerror.def	%D%/strerror_r.def %D%/strrchr.def \
+	%D%/memcmp.def	%D%/strchr.def	%D%/strlen.def	%D%/strnlen.def %D%/strspn.def \
+	%D%/strcasecmp.def	%D%/strncasecmp.def %D%/strcasestr.def	%D%/strlwr.def  %D%/strupr.def \
+	%D%/memccpy.def 	%D%/mempcpy.def	%D%/stpcpy.def	%D%/stpncpy.def %D%/strsignal.def \
+	%D%/wcscasecmp.def	%D%/wcscat.def	%D%/wcschr.def	%D%/wcscmp.def %D%/wcscoll.def \
+	%D%/wcscpy.def	%D%/wcscspn.def	%D%/wcpcpy.def	%D%/wcpncpy.def %D%/wcsdup.def \
+	%D%/wcslcat.def	%D%/wcslcpy.def	%D%/wcslen.def	%D%/wcsncasecmp.def %D%/wcsncat.def \
+	%D%/wcsncmp.def	%D%/wcsncpy.def	%D%/wcsnlen.def	%D%/wcspbrk.def \
+	%D%/wcsrchr.def	%D%/wcsspn.def	%D%/wcsstr.def 	%D%/wcstok.def  \
+	%D%/wcswidth.def	%D%/wcsxfrm.def	%D%/wcwidth.def	%D%/wmemchr.def \
+	%D%/wmemcmp.def	%D%/wmemcpy.def	%D%/wmemmove.def	%D%/wmemset.def \
+	%D%/memmem.def	%D%/memrchr.def	%D%/rawmemchr.def	%D%/strchrnul.def \
+	%D%/strcasecmp_l.def %D%/strcoll_l.def	%D%/strncasecmp_l.def %D%/strxfrm_l.def \
+	%D%/wcscasecmp_l.def %D%/wcscoll_l.def	%D%/wcsncasecmp_l.def %D%/wcsxfrm_l.def \
+	%D%/strverscmp.def	%D%/strnstr.def	%D%/wmempcpy.def
+
+LIBC_CHAPTERS += %D%/strings.tex %D%/wcstrings.tex
diff --git a/newlib/libc/sys/Makefile.am b/newlib/libc/sys/Makefile.am
index a8e65ec80345..9b515f5283ce 100644
--- a/newlib/libc/sys/Makefile.am
+++ b/newlib/libc/sys/Makefile.am
@@ -29,9 +29,5 @@ $(sys_dir)/$(CRT0): ; @true
 
 CLEANFILES = $(CRT0)
 
-doc:
-
-docbook:
-
 ACLOCAL_AMFLAGS = -I ../.. -I ../../.. -I ../../../config
 CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
diff --git a/newlib/libc/syscalls/Makefile.am b/newlib/libc/syscalls/Makefile.am
index 5895be430929..ada372a7aa1c 100644
--- a/newlib/libc/syscalls/Makefile.am
+++ b/newlib/libc/syscalls/Makefile.am
@@ -49,7 +49,3 @@ noinst_DATA =
 endif
 
 include $(srcdir)/../../Makefile.shared
-
-CHEWOUT_FILES =
-CHAPTERS =
-# No doc for syscalls.
diff --git a/newlib/libc/time/Makefile.am b/newlib/libc/time/Makefile.am
index 8871d1afb41f..90081823230e 100644
--- a/newlib/libc/time/Makefile.am
+++ b/newlib/libc/time/Makefile.am
@@ -42,20 +42,10 @@ endif # USE_LIBTOOL
 # This rule is needed so that wcsftime.o is rebuilt when strftime.c changes.
 include $(srcdir)/../../Makefile.shared
 
-$(lpfx)wcsftime.$(oext): strftime.c
-
-CHEWOUT_FILES = \
-	asctime.def	\
-	clock.def 	\
-	ctime.def	\
-	difftime.def	\
-	gmtime.def	\
-	lcltime.def	\
-	mktime.def	\
-	strftime.def	\
-	time.def	\
-	tzlock.def	\
-	tzset.def	\
-	wcsftime.def
+LIBC_CHEWOUT_FILES =
+LIBC_CHAPTERS =
+include ./local.mk
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
 
-CHAPTERS = time.tex
+$(lpfx)wcsftime.$(oext): strftime.c
diff --git a/newlib/libc/time/local.mk b/newlib/libc/time/local.mk
new file mode 100644
index 000000000000..3e7ba4157ea1
--- /dev/null
+++ b/newlib/libc/time/local.mk
@@ -0,0 +1,15 @@
+LIBC_CHEWOUT_FILES += \
+	%D%/asctime.def \
+	%D%/clock.def \
+	%D%/ctime.def \
+	%D%/difftime.def \
+	%D%/gmtime.def \
+	%D%/lcltime.def \
+	%D%/mktime.def \
+	%D%/strftime.def \
+	%D%/time.def \
+	%D%/tzlock.def \
+	%D%/tzset.def \
+	%D%/wcsftime.def
+
+LIBC_CHAPTERS += %D%/time.tex
diff --git a/newlib/libc/unix/Makefile.am b/newlib/libc/unix/Makefile.am
index a2d830f1adb3..a74738d74ca0 100644
--- a/newlib/libc/unix/Makefile.am
+++ b/newlib/libc/unix/Makefile.am
@@ -49,7 +49,3 @@ noinst_DATA =
 endif # USE_LIBTOOL
 
 include $(srcdir)/../../Makefile.shared
-
-CHEWOUT_FILES =
-CHAPTERS =
-# No doc for unix.
diff --git a/newlib/libc/xdr/Makefile.am b/newlib/libc/xdr/Makefile.am
index ad9968c9acf0..8f4ac7d04a33 100644
--- a/newlib/libc/xdr/Makefile.am
+++ b/newlib/libc/xdr/Makefile.am
@@ -56,8 +56,4 @@ lib_a_CFLAGS = $(AM_CFLAGS)
 noinst_DATA =
 endif # USE_LIBTOOL
 
-CHEWOUT_FILES =
-CHAPTERS =
-# No doc for xdr.
-
 include $(srcdir)/../../Makefile.shared
-- 
2.34.1


  parent reply	other threads:[~2022-01-22  4:32 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 ` Mike Frysinger [this message]
2022-01-24 14:30   ` [PATCH 3/5] newlib: libc: move manual into top-level build 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 ` [PATCH 1/5 v3] " Mike Frysinger
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=20220122043208.21962-4-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).