public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] newlib: libc: move manual into top-level build
@ 2022-02-05  5:20 Michael Frysinger
  0 siblings, 0 replies; only message in thread
From: Michael Frysinger @ 2022-02-05  5:20 UTC (permalink / raw)
  To: newlib-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=fc2b4ffee0ec7697a02ae7185f1acb7927f2f115

commit fc2b4ffee0ec7697a02ae7185f1acb7927f2f115
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Fri Jan 21 21:50:20 2022 -0500

    newlib: libc: move manual into top-level build
    
    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 Makefile.inc files easily.

Diff:
---
 newlib/Makefile.am                 |   1 +
 newlib/Makefile.in                 | 238 +++++++++++++++++--
 newlib/libc/Makefile.inc           |  34 +++
 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/Makefile.inc     |  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/Makefile.inc     |   3 +
 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/Makefile.inc |   1 +
 newlib/libc/locale/Makefile.am     |  13 +-
 newlib/libc/locale/Makefile.in     |  17 +-
 newlib/libc/locale/Makefile.inc    |   8 +
 newlib/libc/misc/Makefile.am       |   7 +-
 newlib/libc/misc/Makefile.in       |  10 +-
 newlib/libc/misc/Makefile.inc      |   6 +
 newlib/libc/posix/Makefile.am      |  10 +-
 newlib/libc/posix/Makefile.in      |  13 +-
 newlib/libc/posix/Makefile.inc     |   5 +
 newlib/libc/reent/Makefile.am      |  30 +--
 newlib/libc/reent/Makefile.in      |  37 +--
 newlib/libc/reent/Makefile.inc     |  25 ++
 newlib/libc/search/Makefile.am     |  13 +-
 newlib/libc/search/Makefile.in     |  14 +-
 newlib/libc/search/Makefile.inc    |   4 +
 newlib/libc/signal/Makefile.am     |   8 +-
 newlib/libc/signal/Makefile.in     |  10 +-
 newlib/libc/signal/Makefile.inc    |   7 +
 newlib/libc/ssp/Makefile.am        |   9 +-
 newlib/libc/ssp/Makefile.in        |  10 +-
 newlib/libc/ssp/Makefile.inc       |   3 +
 newlib/libc/stdio/Makefile.am      | 468 ++++++++++++++++---------------------
 newlib/libc/stdio/Makefile.in      | 104 ++-------
 newlib/libc/stdio/Makefile.inc     |  80 +++++++
 newlib/libc/stdio64/Makefile.am    |  18 +-
 newlib/libc/stdio64/Makefile.in    |  21 +-
 newlib/libc/stdio64/Makefile.inc   |  11 +
 newlib/libc/stdlib/Makefile.am     |  58 +----
 newlib/libc/stdlib/Makefile.in     |  68 ++----
 newlib/libc/stdlib/Makefile.inc    |  51 ++++
 newlib/libc/string/Makefile.am     |  27 +--
 newlib/libc/string/Makefile.in     |  48 ++--
 newlib/libc/string/Makefile.inc    |  22 ++
 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/Makefile.inc      |  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 -
 63 files changed, 948 insertions(+), 868 deletions(-)

diff --git a/newlib/Makefile.am b/newlib/Makefile.am
index a4cb965c2..99fa0d77f 100644
--- a/newlib/Makefile.am
+++ b/newlib/Makefile.am
@@ -524,6 +524,7 @@ endif
 if HAVE_ICONVDATA
 include iconvdata/Makefile.inc
 endif
+include libc/Makefile.inc
 include libm/Makefile.inc
 
 .PHONY: $(PHONY)
diff --git a/newlib/Makefile.in b/newlib/Makefile.in
index 6a5573b6f..a77de7281 100644
--- a/newlib/Makefile.in
+++ b/newlib/Makefile.in
@@ -312,13 +312,13 @@ AM_V_texidevnull = $(am__v_texidevnull_@AM_V@)
 am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@)
 am__v_texidevnull_0 = > /dev/null
 am__v_texidevnull_1 = 
-INFO_DEPS = $(srcdir)/libm/libm.info
+INFO_DEPS = $(srcdir)/libc/libc.info $(srcdir)/libm/libm.info
 am__TEXINFO_TEX_DIR = $(srcdir)/../texinfo
-DVIS = libm/libm.dvi
-PDFS = libm/libm.pdf
-PSS = libm/libm.ps
-HTMLS = libm/libm.html
-TEXINFOS = libm/libm.texi
+DVIS = libc/libc.dvi libm/libm.dvi
+PDFS = libc/libc.pdf libm/libm.pdf
+PSS = libc/libc.ps libm/libm.ps
+HTMLS = libc/libc.html libm/libm.html
+TEXINFOS = libc/libc.texi libm/libm.texi
 TEXI2PDF = $(TEXI2DVI) --pdf --batch
 MAKEINFOHTML = $(MAKEINFO) --html
 AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
@@ -527,7 +527,7 @@ ACLOCAL_AMFLAGS = -I . -I .. -I ../config
 # Variables that will accumulate in subdirs.
 PHONY = $(am__append_4)
 SUFFIXES = $(am__append_5)
-info_TEXINFOS = libm/libm.texi
+info_TEXINFOS = libc/libc.texi libm/libm.texi
 noinst_DATA = stmp-targ-include $(am__append_1) $(am__append_2) \
 	$(am__append_3)
 pkglib_LTLIBRARIES = $(am__append_6)
@@ -642,8 +642,10 @@ libc_la_LDFLAGS = -version-info $(LIBTOOL_VERSION_INFO) -release newlib -no-unde
 @USE_LIBTOOL_TRUE@libm_la_DEPENDENCIES = libm-libtool-objectlist
 @USE_LIBTOOL_TRUE@libc_la_SOURCES = 
 @USE_LIBTOOL_TRUE@libc_la_DEPENDENCIES = libc-libtool-objectlist
-CLEANFILES = stmp-targ-include libm/targetdep.tex \
-	libm/targetdep.tex.stamp $(LIBM_CHEWOUT_FILES)
+CLEANFILES = stmp-targ-include libc/targetdep.tex \
+	libc/targetdep.tex.stamp $(LIBC_CHEWOUT_FILES) \
+	libm/targetdep.tex libm/targetdep.tex.stamp \
+	$(LIBM_CHEWOUT_FILES)
 CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
 MULTISRCTOP = 
 MULTIBUILDTOP = 
@@ -674,6 +676,162 @@ TEXINFO_TEX = ../texinfo/texinfo.tex
 @HAVE_ICONVDATA_TRUE@iconvdata_EUC_JP_la_LDFLAGS = -module -no-undefined -Xcompiler -Wl,-rpath-link=. -Xcompiler -nostdlib -L. -lc
 @HAVE_ICONVDATA_TRUE@gconvdir = $(pkglibdir)
 @HAVE_ICONVDATA_TRUE@gconv_DATA = iconvdata/gconv-modules
+libc_libc_TEXINFOS = libc/targetdep.tex $(LIBC_CHEWOUT_FILES)
+LIBC_CHEWOUT_FILES = libc/ctype/isalnum.def libc/ctype/isalpha.def \
+	libc/ctype/isascii.def libc/ctype/isblank.def \
+	libc/ctype/iscntrl.def libc/ctype/isdigit.def \
+	libc/ctype/islower.def libc/ctype/isprint.def \
+	libc/ctype/ispunct.def libc/ctype/isspace.def \
+	libc/ctype/isupper.def libc/ctype/iswalnum.def \
+	libc/ctype/iswalpha.def libc/ctype/iswblank.def \
+	libc/ctype/iswcntrl.def libc/ctype/iswctype.def \
+	libc/ctype/iswdigit.def libc/ctype/iswgraph.def \
+	libc/ctype/iswlower.def libc/ctype/iswprint.def \
+	libc/ctype/iswpunct.def libc/ctype/iswspace.def \
+	libc/ctype/iswupper.def libc/ctype/iswxdigit.def \
+	libc/ctype/isxdigit.def libc/ctype/toascii.def \
+	libc/ctype/tolower.def libc/ctype/toupper.def \
+	libc/ctype/towctrans.def libc/ctype/towlower.def \
+	libc/ctype/towupper.def libc/ctype/wctrans.def \
+	libc/ctype/wctype.def libc/iconv/lib/iconv.def \
+	libc/locale/duplocale.def libc/locale/freelocale.def \
+	libc/locale/locale.def libc/locale/newlocale.def \
+	libc/locale/uselocale.def libc/misc/ffs.def libc/misc/lock.def \
+	libc/misc/unctrl.def libc/posix/popen.def \
+	libc/posix/posix_spawn.def libc/reent/closer.def \
+	libc/reent/reent.def libc/reent/execr.def \
+	libc/reent/fcntlr.def libc/reent/fstatr.def \
+	libc/reent/gettimeofdayr.def libc/reent/linkr.def \
+	libc/reent/lseekr.def libc/reent/mkdirr.def \
+	libc/reent/openr.def libc/reent/readr.def \
+	libc/reent/renamer.def libc/reent/signalr.def \
+	libc/reent/sbrkr.def libc/reent/statr.def \
+	libc/reent/timesr.def libc/reent/unlinkr.def \
+	libc/reent/fstat64r.def libc/reent/lseek64r.def \
+	libc/reent/stat64r.def libc/reent/open64r.def \
+	libc/reent/writer.def libc/search/bsearch.def \
+	libc/search/qsort.def libc/search/qsort_r.def \
+	libc/signal/psignal.def libc/signal/raise.def \
+	libc/signal/signal.def libc/signal/sig2str.def \
+	libc/stdio64/fdopen64.def libc/stdio64/fgetpos64.def \
+	libc/stdio64/fopen64.def libc/stdio64/freopen64.def \
+	libc/stdio64/fseeko64.def libc/stdio64/fsetpos64.def \
+	libc/stdio64/ftello64.def libc/stdio64/tmpfile64.def \
+	libc/stdio/clearerr.def libc/stdio/diprintf.def \
+	libc/stdio/dprintf.def libc/stdio/fcloseall.def \
+	libc/stdio/fclose.def libc/stdio/fdopen.def \
+	libc/stdio/feof.def libc/stdio/ferror.def \
+	libc/stdio/fflush.def libc/stdio/fgetc.def \
+	libc/stdio/fgetpos.def libc/stdio/fgets.def \
+	libc/stdio/fgetwc.def libc/stdio/fgetws.def \
+	libc/stdio/fileno.def libc/stdio/fmemopen.def \
+	libc/stdio/fopen.def libc/stdio/fopencookie.def \
+	libc/stdio/fpurge.def libc/stdio/fputc.def \
+	libc/stdio/fputs.def libc/stdio/fputwc.def \
+	libc/stdio/fputws.def libc/stdio/fread.def \
+	libc/stdio/freopen.def libc/stdio/fseek.def \
+	libc/stdio/fsetlocking.def libc/stdio/fsetpos.def \
+	libc/stdio/ftell.def libc/stdio/funopen.def \
+	libc/stdio/fwide.def libc/stdio/fwrite.def libc/stdio/getc.def \
+	libc/stdio/getc_u.def libc/stdio/getchar.def \
+	libc/stdio/getchar_u.def libc/stdio/getdelim.def \
+	libc/stdio/getline.def libc/stdio/gets.def libc/stdio/getw.def \
+	libc/stdio/getwchar.def libc/stdio/mktemp.def \
+	libc/stdio/nano-vfprintf.def libc/stdio/nano-vfscanf.def \
+	libc/stdio/open_memstream.def libc/stdio/perror.def \
+	libc/stdio/putc.def libc/stdio/putc_u.def \
+	libc/stdio/putchar.def libc/stdio/putchar_u.def \
+	libc/stdio/puts.def libc/stdio/putw.def \
+	libc/stdio/putwchar.def libc/stdio/remove.def \
+	libc/stdio/rename.def libc/stdio/rewind.def \
+	libc/stdio/setbuf.def libc/stdio/setbuffer.def \
+	libc/stdio/setlinebuf.def libc/stdio/setvbuf.def \
+	libc/stdio/siprintf.def libc/stdio/siscanf.def \
+	libc/stdio/sprintf.def libc/stdio/sscanf.def \
+	libc/stdio/stdio_ext.def libc/stdio/swprintf.def \
+	libc/stdio/swscanf.def libc/stdio/tmpfile.def \
+	libc/stdio/tmpnam.def libc/stdio/ungetc.def \
+	libc/stdio/ungetwc.def libc/stdio/vfprintf.def \
+	libc/stdio/vfscanf.def libc/stdio/vfwprintf.def \
+	libc/stdio/vfwscanf.def libc/stdio/viprintf.def \
+	libc/stdio/viscanf.def libc/stdlib/_Exit.def \
+	libc/stdlib/a64l.def libc/stdlib/abort.def libc/stdlib/abs.def \
+	libc/stdlib/assert.def libc/stdlib/atexit.def \
+	libc/stdlib/atof.def libc/stdlib/atoi.def \
+	libc/stdlib/atoll.def libc/stdlib/calloc.def \
+	libc/stdlib/div.def libc/stdlib/ecvtbuf.def \
+	libc/stdlib/efgcvt.def libc/stdlib/envlock.def \
+	libc/stdlib/exit.def libc/stdlib/getenv.def \
+	libc/stdlib/itoa.def libc/stdlib/labs.def libc/stdlib/ldiv.def \
+	libc/stdlib/llabs.def libc/stdlib/lldiv.def \
+	libc/stdlib/malloc.def libc/stdlib/mblen.def \
+	libc/stdlib/mbsnrtowcs.def libc/stdlib/mbstowcs.def \
+	libc/stdlib/mbtowc.def libc/stdlib/mlock.def \
+	libc/stdlib/mstats.def libc/stdlib/on_exit.def \
+	libc/stdlib/rand.def libc/stdlib/rand48.def \
+	libc/stdlib/random.def libc/stdlib/rpmatch.def \
+	libc/stdlib/strtod.def libc/stdlib/strtol.def \
+	libc/stdlib/strtoll.def libc/stdlib/strtoul.def \
+	libc/stdlib/strtoull.def libc/stdlib/utoa.def \
+	libc/stdlib/wcsnrtombs.def libc/stdlib/wcstod.def \
+	libc/stdlib/wcstol.def libc/stdlib/wcstoll.def \
+	libc/stdlib/wcstoul.def libc/stdlib/wcstoull.def \
+	libc/stdlib/system.def libc/stdlib/wcstombs.def \
+	libc/stdlib/wctomb.def libc/string/bcmp.def \
+	libc/string/memcpy.def libc/string/strcmp.def \
+	libc/string/strncat.def libc/string/strstr.def \
+	libc/string/bcopy.def libc/string/memmove.def \
+	libc/string/strcoll.def libc/string/strncmp.def \
+	libc/string/strtok.def libc/string/bzero.def \
+	libc/string/memset.def libc/string/strcpy.def \
+	libc/string/strncpy.def libc/string/strxfrm.def \
+	libc/string/index.def libc/string/rindex.def \
+	libc/string/strcspn.def libc/string/strpbrk.def \
+	libc/string/swab.def libc/string/memchr.def \
+	libc/string/strcat.def libc/string/strerror.def \
+	libc/string/strerror_r.def libc/string/strrchr.def \
+	libc/string/memcmp.def libc/string/strchr.def \
+	libc/string/strlen.def libc/string/strnlen.def \
+	libc/string/strspn.def libc/string/strcasecmp.def \
+	libc/string/strncasecmp.def libc/string/strcasestr.def \
+	libc/string/strlwr.def libc/string/strupr.def \
+	libc/string/memccpy.def libc/string/mempcpy.def \
+	libc/string/stpcpy.def libc/string/stpncpy.def \
+	libc/string/strsignal.def libc/string/wcscasecmp.def \
+	libc/string/wcscat.def libc/string/wcschr.def \
+	libc/string/wcscmp.def libc/string/wcscoll.def \
+	libc/string/wcscpy.def libc/string/wcscspn.def \
+	libc/string/wcpcpy.def libc/string/wcpncpy.def \
+	libc/string/wcsdup.def libc/string/wcslcat.def \
+	libc/string/wcslcpy.def libc/string/wcslen.def \
+	libc/string/wcsncasecmp.def libc/string/wcsncat.def \
+	libc/string/wcsncmp.def libc/string/wcsncpy.def \
+	libc/string/wcsnlen.def libc/string/wcspbrk.def \
+	libc/string/wcsrchr.def libc/string/wcsspn.def \
+	libc/string/wcsstr.def libc/string/wcstok.def \
+	libc/string/wcswidth.def libc/string/wcsxfrm.def \
+	libc/string/wcwidth.def libc/string/wmemchr.def \
+	libc/string/wmemcmp.def libc/string/wmemcpy.def \
+	libc/string/wmemmove.def libc/string/wmemset.def \
+	libc/string/memmem.def libc/string/memrchr.def \
+	libc/string/rawmemchr.def libc/string/strchrnul.def \
+	libc/string/strcasecmp_l.def libc/string/strcoll_l.def \
+	libc/string/strncasecmp_l.def libc/string/strxfrm_l.def \
+	libc/string/wcscasecmp_l.def libc/string/wcscoll_l.def \
+	libc/string/wcsncasecmp_l.def libc/string/wcsxfrm_l.def \
+	libc/string/strverscmp.def libc/string/strnstr.def \
+	libc/string/wmempcpy.def libc/time/asctime.def \
+	libc/time/clock.def libc/time/ctime.def libc/time/difftime.def \
+	libc/time/gmtime.def libc/time/lcltime.def \
+	libc/time/mktime.def libc/time/strftime.def libc/time/time.def \
+	libc/time/tzlock.def libc/time/tzset.def \
+	libc/time/wcsftime.def
+LIBC_CHAPTERS = libc/sys.tex libc/ctype/ctype.tex libc/iconv/iconv.tex \
+	libc/locale/locale.tex libc/misc/misc.tex libc/posix/posix.tex \
+	libc/reent/reent.tex libc/signal/signal.tex libc/ssp/ssp.tex \
+	libc/stdio64/stdio64.tex libc/stdio/stdio.tex \
+	libc/stdlib/stdlib.tex libc/string/strings.tex \
+	libc/string/wcstrings.tex libc/time/time.tex
 libm_libm_TEXINFOS = libm/targetdep.tex $(LIBM_CHEWOUT_FILES)
 LIBM_CHEWOUT_FILES = libm/common/s_cbrt.def libm/common/s_copysign.def \
 	libm/common/s_exp10.def libm/common/s_expm1.def \
@@ -716,7 +874,7 @@ all: newlib.h _newlib_version.h
 .SUFFIXES: .def .c .dvi .lo .o .obj .ps
 am--refresh: Makefile
 	@:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../multilib.am $(srcdir)/doc/local.mk $(srcdir)/iconvdata/Makefile.inc $(srcdir)/libm/Makefile.inc $(srcdir)/libm/common/Makefile.inc $(srcdir)/libm/complex/Makefile.inc $(srcdir)/libm/fenv/Makefile.inc $(srcdir)/libm/mathfp/Makefile.inc $(srcdir)/libm/math/Makefile.inc $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../multilib.am $(srcdir)/doc/local.mk $(srcdir)/iconvdata/Makefile.inc $(srcdir)/libc/Makefile.inc $(srcdir)/libc/ctype/Makefile.inc $(srcdir)/libc/iconv/Makefile.inc $(srcdir)/libc/iconv/lib/Makefile.inc $(srcdir)/libc/locale/Makefile.inc $(srcdir)/libc/misc/Makefile.inc $(srcdir)/libc/posix/Makefile.inc $(srcdir)/libc/reent/Makefile.inc $(srcdir)/libc/search/Makefile.inc $(srcdir)/libc/signal/Makefile.inc $(srcdir)/libc/ssp/Makefile.inc $(srcdir)/libc/stdio64/Makefile.inc $(srcdir)/libc/stdio/Makefile.inc $(srcdir)/libc/stdlib/Makefile.inc $(srcdir)/libc/string/Makefile.inc $(srcdir)/libc/time/Makefile.inc $(srcdir)/libm/Makefile.inc $(srcdir)/libm/common/Makefile.inc $(srcdir)/libm/complex/Makefile.inc $(srcdir)/libm/fenv/Makefile.inc $(srcdir)/libm/mathfp/Makefile.inc $(srcdir)/libm/math/Makefile.inc $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
@@ -738,7 +896,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
 	esac;
-$(srcdir)/../multilib.am $(srcdir)/doc/local.mk $(srcdir)/iconvdata/Makefile.inc $(srcdir)/libm/Makefile.inc $(srcdir)/libm/common/Makefile.inc $(srcdir)/libm/complex/Makefile.inc $(srcdir)/libm/fenv/Makefile.inc $(srcdir)/libm/mathfp/Makefile.inc $(srcdir)/libm/math/Makefile.inc $(am__empty):
+$(srcdir)/../multilib.am $(srcdir)/doc/local.mk $(srcdir)/iconvdata/Makefile.inc $(srcdir)/libc/Makefile.inc $(srcdir)/libc/ctype/Makefile.inc $(srcdir)/libc/iconv/Makefile.inc $(srcdir)/libc/iconv/lib/Makefile.inc $(srcdir)/libc/locale/Makefile.inc $(srcdir)/libc/misc/Makefile.inc $(srcdir)/libc/posix/Makefile.inc $(srcdir)/libc/reent/Makefile.inc $(srcdir)/libc/search/Makefile.inc $(srcdir)/libc/signal/Makefile.inc $(srcdir)/libc/ssp/Makefile.inc $(srcdir)/libc/stdio64/Makefile.inc $(srcdir)/libc/stdio/Makefile.inc $(srcdir)/libc/stdlib/Makefile.inc $(srcdir)/libc/string/Makefile.inc $(srcdir)/libc/time/Makefile.inc $(srcdir)/libm/Makefile.inc $(srcdir)/libm/common/Makefile.inc $(srcdir)/libm/complex/Makefile.inc $(srcdir)/libm/fenv/Makefile.inc $(srcdir)/libm/mathfp/Makefile.inc $(srcdir)/libm/math/Makefile.inc $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	$(SHELL) ./config.status --recheck
@@ -941,6 +1099,47 @@ clean-libtool:
 
 distclean-libtool:
 	-rm -f libtool config.lt
+libc/$(am__dirstamp):
+	@$(MKDIR_P) libc
+	@: > libc/$(am__dirstamp)
+
+$(srcdir)/libc/libc.info: libc/libc.texi $(libc_libc_TEXINFOS)
+	$(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \
+	am__cwd=`pwd` && $(am__cd) $(srcdir) && \
+	rm -rf $$backupdir && mkdir $$backupdir && \
+	if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
+	  for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
+	    if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
+	  done; \
+	else :; fi && \
+	cd "$$am__cwd"; \
+	if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I libc -I $(srcdir)/libc \
+	 -o $@ $(srcdir)/libc/libc.texi; \
+	then \
+	  rc=0; \
+	  $(am__cd) $(srcdir); \
+	else \
+	  rc=$$?; \
+	  $(am__cd) $(srcdir) && \
+	  $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
+	fi; \
+	rm -rf $$backupdir; exit $$rc
+
+libc/libc.pdf: libc/libc.texi $(libc_libc_TEXINFOS) libc/$(am__dirstamp)
+	$(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+	MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I libc -I $(srcdir)/libc' \
+	$(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \
+	`test -f 'libc/libc.texi' || echo '$(srcdir)/'`libc/libc.texi
+
+libc/libc.html: libc/libc.texi $(libc_libc_TEXINFOS) libc/$(am__dirstamp)
+	$(AM_V_MAKEINFO)rm -rf $(@:.html=.htp)
+	$(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I libc -I $(srcdir)/libc \
+	 -o $(@:.html=.htp) `test -f 'libc/libc.texi' || echo '$(srcdir)/'`libc/libc.texi; \
+	then \
+	  rm -rf $@ && mv $(@:.html=.htp) $@; \
+	else \
+	  rm -rf $(@:.html=.htp); exit 1; \
+	fi
 libm/$(am__dirstamp):
 	@$(MKDIR_P) libm
 	@: > libm/$(am__dirstamp)
@@ -1063,11 +1262,13 @@ dist-info: $(INFO_DEPS)
 	done
 
 mostlyclean-aminfo:
-	-rm -rf libm/libm.t2d libm/libm.t2p
+	-rm -rf libc/libc.t2d libc/libc.t2p libm/libm.t2d libm/libm.t2p
 
 clean-aminfo:
-	-test -z "libm/libm.dvi libm/libm.pdf libm/libm.ps libm/libm.html" \
-	|| rm -rf libm/libm.dvi libm/libm.pdf libm/libm.ps libm/libm.html
+	-test -z "libc/libc.dvi libc/libc.pdf libc/libc.ps libc/libc.html libm/libm.dvi \
+	  libm/libm.pdf libm/libm.ps libm/libm.html" \
+	|| rm -rf libc/libc.dvi libc/libc.pdf libc/libc.ps libc/libc.html libm/libm.dvi \
+	  libm/libm.pdf libm/libm.ps libm/libm.html
 
 maintainer-clean-aminfo:
 	@list='$(INFO_DEPS)'; for i in $$list; do \
@@ -1267,6 +1468,7 @@ distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
 	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 	-rm -f iconvdata/$(am__dirstamp)
+	-rm -f libc/$(am__dirstamp)
 	-rm -f libm/$(am__dirstamp)
 
 maintainer-clean-generic:
@@ -1862,6 +2064,14 @@ clean-local:
 @HAVE_DOC_TRUE@.c.def:
 @HAVE_DOC_TRUE@	$(AM_V_GEN)$(CHEW) < $< > $*.def || ( rm $*.def && false )
 
+libc/libc.dvi: libc/targetdep.tex $(LIBC_CHEWOUT_FILES)
+
+libc/targetdep.tex.stamp: $(LIBC_CHAPTERS)
+	$(AM_V_GEN)cat $^ > $@.tmp
+	$(AM_V_at)$(SHELL) $(newlib_basedir)/../move-if-change $@.tmp $(@:.stamp=)
+	$(AM_V_at)touch $@
+libc/targetdep.tex: libc/targetdep.tex.stamp; @true
+
 libm/libm.dvi: libm/targetdep.tex $(LIBM_CHEWOUT_FILES)
 
 libm/targetdep.tex.stamp: $(LIBM_CHAPTERS)
diff --git a/newlib/libc/Makefile.inc b/newlib/libc/Makefile.inc
new file mode 100644
index 000000000..afd016b9d
--- /dev/null
+++ b/newlib/libc/Makefile.inc
@@ -0,0 +1,34 @@
+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.stamp: $(LIBC_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%/ctype/Makefile.inc
+include %D%/iconv/Makefile.inc
+include %D%/locale/Makefile.inc
+include %D%/misc/Makefile.inc
+include %D%/posix/Makefile.inc
+include %D%/reent/Makefile.inc
+include %D%/search/Makefile.inc
+include %D%/signal/Makefile.inc
+include %D%/ssp/Makefile.inc
+include %D%/stdio64/Makefile.inc
+include %D%/stdio/Makefile.inc
+include %D%/stdlib/Makefile.inc
+include %D%/string/Makefile.inc
+include %D%/time/Makefile.inc
+
+CLEANFILES += \
+	%D%/targetdep.tex \
+	%D%/targetdep.tex.stamp \
+	$(LIBC_CHEWOUT_FILES)
diff --git a/newlib/libc/argz/Makefile.am b/newlib/libc/argz/Makefile.am
index 0f73cd2b8..a8351b8e2 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/argz/Makefile.in b/newlib/libc/argz/Makefile.in
index a826a1dcf..fea62989d 100644
--- a/newlib/libc/argz/Makefile.in
+++ b/newlib/libc/argz/Makefile.in
@@ -394,8 +394,6 @@ libargz_la_LDFLAGS = -Xcompiler -nostdlib
 @USE_LIBTOOL_FALSE@noinst_LIBRARIES = lib.a
 @USE_LIBTOOL_FALSE@lib_a_SOURCES = dummy.c $(ELIX_SOURCES)
 @USE_LIBTOOL_FALSE@lib_a_CFLAGS = $(AM_CFLAGS)
-CHEWOUT_FILES = 
-CHAPTERS = 
 
 #
 # documentation rules
@@ -805,7 +803,6 @@ docbook: $(DOCBOOK_OUT_FILES)
 	do \
 	  ${top_srcdir}/../doc/chapter-texi2docbook.py <$(srcdir)/$${chapter%.xml}.tex >../$$chapter ; \
 	done
-# No doc for argz.
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/newlib/libc/ctype/Makefile.am b/newlib/libc/ctype/Makefile.am
index 447b7afde..e074e4d7f 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 ./Makefile.inc
+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/Makefile.in b/newlib/libc/ctype/Makefile.in
index 831373b39..df7dfab77 100644
--- a/newlib/libc/ctype/Makefile.in
+++ b/newlib/libc/ctype/Makefile.in
@@ -514,47 +514,22 @@ DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py
 DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml)
 DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml)
 CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES)
-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 = 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
+LIBC_CHAPTERS = ctype.tex
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
 all: all-am
 
 .SUFFIXES:
 .SUFFIXES: .def .xml .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(srcdir)/./Makefile.inc $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
@@ -574,7 +549,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(srcdir)/../../Makefile.shared $(am__empty):
+$(srcdir)/../../Makefile.shared $(srcdir)/./Makefile.inc $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
diff --git a/newlib/libc/ctype/Makefile.inc b/newlib/libc/ctype/Makefile.inc
new file mode 100644
index 000000000..8cef16630
--- /dev/null
+++ b/newlib/libc/ctype/Makefile.inc
@@ -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 77a0b8b83..3470abd0b 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/errno/Makefile.in b/newlib/libc/errno/Makefile.in
index 57420c6cd..7c0e4ad8a 100644
--- a/newlib/libc/errno/Makefile.in
+++ b/newlib/libc/errno/Makefile.in
@@ -356,8 +356,6 @@ DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py
 DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml)
 DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml)
 CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES)
-CHEWOUT_FILES = 
-CHAPTERS = 
 all: all-am
 
 .SUFFIXES:
@@ -643,7 +641,6 @@ docbook: $(DOCBOOK_OUT_FILES)
 	do \
 	  ${top_srcdir}/../doc/chapter-texi2docbook.py <$(srcdir)/$${chapter%.xml}.tex >../$$chapter ; \
 	done
-# No doc for errno.
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/newlib/libc/iconv/Makefile.am b/newlib/libc/iconv/Makefile.am
index 4123c7acb..835709861 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 ./Makefile.inc
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
diff --git a/newlib/libc/iconv/Makefile.in b/newlib/libc/iconv/Makefile.in
index 4cf69debd..3fc3c82e4 100644
--- a/newlib/libc/iconv/Makefile.in
+++ b/newlib/libc/iconv/Makefile.in
@@ -339,7 +339,6 @@ SUBDIRS = ces ccs lib .
 cctdir = $(datadir)/iconv_data
 cct_DATA = encoding.aliases
 AM_CPPFLAGS = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
-SUBDEFS = lib/stmp-def
 
 #
 # documentation rules
@@ -350,13 +349,15 @@ DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py
 DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml)
 DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml)
 CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES)
-CHEWOUT_FILES = iconv.def
-CHAPTERS = iconv.tex
+LIBC_CHEWOUT_FILES = lib/iconv.def
+LIBC_CHAPTERS = iconv.tex
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
 all: all-recursive
 
 .SUFFIXES:
 .SUFFIXES: .def .xml .c
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(srcdir)/./Makefile.inc $(srcdir)/lib/Makefile.inc $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
@@ -376,7 +377,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(srcdir)/../../Makefile.shared $(am__empty):
+$(srcdir)/../../Makefile.shared $(srcdir)/./Makefile.inc $(srcdir)/lib/Makefile.inc $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
@@ -664,25 +665,6 @@ docbook: $(DOCBOOK_OUT_FILES)
 	  ${top_srcdir}/../doc/chapter-texi2docbook.py <$(srcdir)/$${chapter%.xml}.tex >../$$chapter ; \
 	done
 
-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
-
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/newlib/libc/iconv/Makefile.inc b/newlib/libc/iconv/Makefile.inc
new file mode 100644
index 000000000..1c331a5fa
--- /dev/null
+++ b/newlib/libc/iconv/Makefile.inc
@@ -0,0 +1,3 @@
+LIBC_CHAPTERS += %D%/iconv.tex
+
+include %D%/lib/Makefile.inc
diff --git a/newlib/libc/iconv/ccs/Makefile.am b/newlib/libc/iconv/ccs/Makefile.am
index f87d072b8..071b75b8e 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/ccs/Makefile.in b/newlib/libc/iconv/ccs/Makefile.in
index 2d1608fb6..61398acda 100644
--- a/newlib/libc/iconv/ccs/Makefile.in
+++ b/newlib/libc/iconv/ccs/Makefile.in
@@ -439,8 +439,6 @@ lib_a_SOURCES = $(GENERAL_SOURCES) $(ELIX_SOURCES)
 lib_a_CFLAGS = $(AM_CFLAGS)
 noinst_DATA = 
 SUBDIRS = binary
-CHEWOUT_FILES = 
-CHAPTERS = 
 
 #
 # documentation rules
diff --git a/newlib/libc/iconv/ces/Makefile.am b/newlib/libc/iconv/ces/Makefile.am
index 21a37b7b8..9f129c997 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/ces/Makefile.in b/newlib/libc/iconv/ces/Makefile.in
index 68f9ebb6a..0dc1711bd 100644
--- a/newlib/libc/iconv/ces/Makefile.in
+++ b/newlib/libc/iconv/ces/Makefile.in
@@ -383,8 +383,6 @@ DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py
 DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml)
 DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml)
 CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES)
-CHEWOUT_FILES = 
-CHAPTERS = 
 all: all-am
 
 .SUFFIXES:
diff --git a/newlib/libc/iconv/iconv.tex b/newlib/libc/iconv/iconv.tex
index 46ced296b..42d04c0b6 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 4e495573a..0114b2aa3 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/Makefile.in b/newlib/libc/iconv/lib/Makefile.in
index b78a21833..02217c4a5 100644
--- a/newlib/libc/iconv/lib/Makefile.in
+++ b/newlib/libc/iconv/lib/Makefile.in
@@ -366,8 +366,6 @@ DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py
 DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml)
 DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml)
 CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES)
-CHEWOUT_FILES = iconv.def
-CHAPTER = 
 all: all-am
 
 .SUFFIXES:
diff --git a/newlib/libc/iconv/lib/Makefile.inc b/newlib/libc/iconv/lib/Makefile.inc
new file mode 100644
index 000000000..62a2be87b
--- /dev/null
+++ b/newlib/libc/iconv/lib/Makefile.inc
@@ -0,0 +1 @@
+LIBC_CHEWOUT_FILES += %D%/iconv.def
diff --git a/newlib/libc/locale/Makefile.am b/newlib/libc/locale/Makefile.am
index 1fd2530f7..3055d0ceb 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 ./Makefile.inc
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
diff --git a/newlib/libc/locale/Makefile.in b/newlib/libc/locale/Makefile.in
index 4e151cd04..708c4d550 100644
--- a/newlib/libc/locale/Makefile.in
+++ b/newlib/libc/locale/Makefile.in
@@ -385,19 +385,16 @@ DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py
 DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml)
 DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml)
 CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES)
-CHEWOUT_FILES = \
-	duplocale.def \
-	freelocale.def \
-	locale.def \
-	newlocale.def \
-	uselocale.def
-
-CHAPTERS = locale.tex
+LIBC_CHEWOUT_FILES = duplocale.def freelocale.def locale.def \
+	newlocale.def uselocale.def
+LIBC_CHAPTERS = locale.tex
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
 all: all-am
 
 .SUFFIXES:
 .SUFFIXES: .def .xml .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(srcdir)/./Makefile.inc $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
@@ -417,7 +414,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(srcdir)/../../Makefile.shared $(am__empty):
+$(srcdir)/../../Makefile.shared $(srcdir)/./Makefile.inc $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
diff --git a/newlib/libc/locale/Makefile.inc b/newlib/libc/locale/Makefile.inc
new file mode 100644
index 000000000..7af1534c8
--- /dev/null
+++ b/newlib/libc/locale/Makefile.inc
@@ -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/misc/Makefile.am b/newlib/libc/misc/Makefile.am
index da4f90f46..6d9fefaec 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 ./Makefile.inc
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
diff --git a/newlib/libc/misc/Makefile.in b/newlib/libc/misc/Makefile.in
index b687be429..02d6c2588 100644
--- a/newlib/libc/misc/Makefile.in
+++ b/newlib/libc/misc/Makefile.in
@@ -365,13 +365,15 @@ DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py
 DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml)
 DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml)
 CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES)
-CHEWOUT_FILES = unctrl.def lock.def ffs.def
-CHAPTERS = misc.tex
+LIBC_CHEWOUT_FILES = ffs.def lock.def unctrl.def
+LIBC_CHAPTERS = misc.tex
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
 all: all-am
 
 .SUFFIXES:
 .SUFFIXES: .def .xml .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(srcdir)/./Makefile.inc $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
@@ -391,7 +393,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(srcdir)/../../Makefile.shared $(am__empty):
+$(srcdir)/../../Makefile.shared $(srcdir)/./Makefile.inc $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
diff --git a/newlib/libc/misc/Makefile.inc b/newlib/libc/misc/Makefile.inc
new file mode 100644
index 000000000..54a53efff
--- /dev/null
+++ b/newlib/libc/misc/Makefile.inc
@@ -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 5fb1fa2af..984ae7fb5 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 ./Makefile.inc
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
 
 AM_CFLAGS = -D_GNU_SOURCE
diff --git a/newlib/libc/posix/Makefile.in b/newlib/libc/posix/Makefile.in
index 68926aad6..3b7612a0d 100644
--- a/newlib/libc/posix/Makefile.in
+++ b/newlib/libc/posix/Makefile.in
@@ -416,17 +416,16 @@ DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py
 DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml)
 DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml)
 CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES)
-CHEWOUT_FILES = \
-	popen.def \
-	posix_spawn.def
-
-CHAPTERS = posix.tex
+LIBC_CHEWOUT_FILES = popen.def posix_spawn.def
+LIBC_CHAPTERS = posix.tex
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
 AM_CFLAGS = -D_GNU_SOURCE
 all: all-am
 
 .SUFFIXES:
 .SUFFIXES: .def .xml .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(srcdir)/./Makefile.inc $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
@@ -446,7 +445,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(srcdir)/../../Makefile.shared $(am__empty):
+$(srcdir)/../../Makefile.shared $(srcdir)/./Makefile.inc $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
diff --git a/newlib/libc/posix/Makefile.inc b/newlib/libc/posix/Makefile.inc
new file mode 100644
index 000000000..74539dddb
--- /dev/null
+++ b/newlib/libc/posix/Makefile.inc
@@ -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 622a74c82..dad7efdbe 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 ./Makefile.inc
+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/Makefile.in b/newlib/libc/reent/Makefile.in
index 7307192e4..5317ea169 100644
--- a/newlib/libc/reent/Makefile.in
+++ b/newlib/libc/reent/Makefile.in
@@ -424,36 +424,19 @@ DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py
 DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml)
 DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml)
 CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES)
-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 = closer.def reent.def execr.def fcntlr.def \
+	fstatr.def gettimeofdayr.def linkr.def lseekr.def mkdirr.def \
+	openr.def readr.def renamer.def signalr.def sbrkr.def \
+	statr.def timesr.def unlinkr.def fstat64r.def lseek64r.def \
+	stat64r.def open64r.def writer.def
+LIBC_CHAPTERS = reent.tex
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
 all: all-am
 
 .SUFFIXES:
 .SUFFIXES: .def .xml .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(srcdir)/./Makefile.inc $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
@@ -473,7 +456,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(srcdir)/../../Makefile.shared $(am__empty):
+$(srcdir)/../../Makefile.shared $(srcdir)/./Makefile.inc $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
diff --git a/newlib/libc/reent/Makefile.inc b/newlib/libc/reent/Makefile.inc
new file mode 100644
index 000000000..975a8d82a
--- /dev/null
+++ b/newlib/libc/reent/Makefile.inc
@@ -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 5c5e0dcf6..eedb2bad6 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 ./Makefile.inc
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
diff --git a/newlib/libc/search/Makefile.in b/newlib/libc/search/Makefile.in
index e18be040f..1d564d927 100644
--- a/newlib/libc/search/Makefile.in
+++ b/newlib/libc/search/Makefile.in
@@ -401,12 +401,6 @@ libsearch_la_LDFLAGS = -Xcompiler -nostdlib
 @USE_LIBTOOL_FALSE@noinst_LIBRARIES = lib.a
 @USE_LIBTOOL_FALSE@lib_a_SOURCES = $(GENERAL_SOURCES) $(ELIX_2_SOURCES) $(ELIX_4_SOURCES)
 @USE_LIBTOOL_FALSE@lib_a_CFLAGS = $(AM_CFLAGS)
-CHEWOUT_FILES = \
-	bsearch.def \
-	qsort.def \
-	qsort_r.def
-
-CHAPTERS = 
 
 #
 # documentation rules
@@ -417,11 +411,15 @@ DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py
 DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml)
 DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml)
 CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES)
+LIBC_CHEWOUT_FILES = bsearch.def qsort.def qsort_r.def
+LIBC_CHAPTERS = 
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
 all: all-am
 
 .SUFFIXES:
 .SUFFIXES: .def .xml .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(srcdir)/./Makefile.inc $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
@@ -441,7 +439,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(srcdir)/../../Makefile.shared $(am__empty):
+$(srcdir)/../../Makefile.shared $(srcdir)/./Makefile.inc $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
diff --git a/newlib/libc/search/Makefile.inc b/newlib/libc/search/Makefile.inc
new file mode 100644
index 000000000..a1704539b
--- /dev/null
+++ b/newlib/libc/search/Makefile.inc
@@ -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 4b5bc209c..fdcd17d7e 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 ./Makefile.inc
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
diff --git a/newlib/libc/signal/Makefile.in b/newlib/libc/signal/Makefile.in
index 0dade2f1f..9ffdce6db 100644
--- a/newlib/libc/signal/Makefile.in
+++ b/newlib/libc/signal/Makefile.in
@@ -357,13 +357,15 @@ DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py
 DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml)
 DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml)
 CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES)
-CHEWOUT_FILES = psignal.def raise.def signal.def sig2str.def
-CHAPTERS = signal.tex
+LIBC_CHEWOUT_FILES = psignal.def raise.def signal.def sig2str.def
+LIBC_CHAPTERS = signal.tex
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
 all: all-am
 
 .SUFFIXES:
 .SUFFIXES: .def .xml .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(srcdir)/./Makefile.inc $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
@@ -383,7 +385,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(srcdir)/../../Makefile.shared $(am__empty):
+$(srcdir)/../../Makefile.shared $(srcdir)/./Makefile.inc $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
diff --git a/newlib/libc/signal/Makefile.inc b/newlib/libc/signal/Makefile.inc
new file mode 100644
index 000000000..e0da75349
--- /dev/null
+++ b/newlib/libc/signal/Makefile.inc
@@ -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 937741cd6..da5573202 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 ./Makefile.inc
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
diff --git a/newlib/libc/ssp/Makefile.in b/newlib/libc/ssp/Makefile.in
index 711948fd1..3f539958c 100644
--- a/newlib/libc/ssp/Makefile.in
+++ b/newlib/libc/ssp/Makefile.in
@@ -398,8 +398,6 @@ libssp_la_LDFLAGS = -Xcompiler -nostdlib
 @USE_LIBTOOL_FALSE@noinst_LIBRARIES = lib.a
 @USE_LIBTOOL_FALSE@lib_a_SOURCES = $(ELIX_SOURCES)
 @USE_LIBTOOL_FALSE@lib_a_CFLAGS = $(AM_CFLAGS)
-CHEWOUT_FILES = 
-CHAPTERS = ssp.tex
 
 #
 # documentation rules
@@ -410,11 +408,15 @@ DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py
 DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml)
 DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml)
 CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES)
+LIBC_CHEWOUT_FILES =
+LIBC_CHAPTERS = ssp.tex
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
 all: all-am
 
 .SUFFIXES:
 .SUFFIXES: .def .xml .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(srcdir)/./Makefile.inc $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
@@ -434,7 +436,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(srcdir)/../../Makefile.shared $(am__empty):
+$(srcdir)/../../Makefile.shared $(srcdir)/./Makefile.inc $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
diff --git a/newlib/libc/ssp/Makefile.inc b/newlib/libc/ssp/Makefile.inc
new file mode 100644
index 000000000..e87115b50
--- /dev/null
+++ b/newlib/libc/ssp/Makefile.inc
@@ -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 30339033c..c8d5f010f 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 ./Makefile.inc
+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/Makefile.in b/newlib/libc/stdio/Makefile.in
index b72392cd6..43ec1dce7 100644
--- a/newlib/libc/stdio/Makefile.in
+++ b/newlib/libc/stdio/Makefile.in
@@ -744,91 +744,31 @@ DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py
 DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml)
 DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml)
 CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES)
-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
+LIBC_CHEWOUT_FILES = clearerr.def diprintf.def dprintf.def \
+	fcloseall.def fclose.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
+LIBC_CHAPTERS = stdio.tex
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
 all: all-am
 
 .SUFFIXES:
 .SUFFIXES: .def .xml .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(srcdir)/./Makefile.inc $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
@@ -848,7 +788,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(srcdir)/../../Makefile.shared $(am__empty):
+$(srcdir)/../../Makefile.shared $(srcdir)/./Makefile.inc $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
diff --git a/newlib/libc/stdio/Makefile.inc b/newlib/libc/stdio/Makefile.inc
new file mode 100644
index 000000000..2e1b8c416
--- /dev/null
+++ b/newlib/libc/stdio/Makefile.inc
@@ -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 074107e0c..56ddbe31f 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 ./Makefile.inc
+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/Makefile.in b/newlib/libc/stdio64/Makefile.in
index 68c18c302..31bd0f2b3 100644
--- a/newlib/libc/stdio64/Makefile.in
+++ b/newlib/libc/stdio64/Makefile.in
@@ -387,23 +387,18 @@ DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py
 DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml)
 DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml)
 CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES)
-AM_CFLAGS = -I $(srcdir)/../stdio
-CHEWOUT_FILES = \
-	fdopen64.def		\
-	fgetpos64.def		\
-	fopen64.def		\
-	freopen64.def		\
-	fseeko64.def		\
-	fsetpos64.def		\
-	ftello64.def		\
+LIBC_CHEWOUT_FILES = fdopen64.def fgetpos64.def fopen64.def \
+	freopen64.def fseeko64.def fsetpos64.def ftello64.def \
 	tmpfile64.def
-
-CHAPTERS = stdio64.tex
+LIBC_CHAPTERS = stdio64.tex
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
+AM_CFLAGS = -I $(srcdir)/../stdio
 all: all-am
 
 .SUFFIXES:
 .SUFFIXES: .def .xml .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(srcdir)/./Makefile.inc $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
@@ -423,7 +418,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(srcdir)/../../Makefile.shared $(am__empty):
+$(srcdir)/../../Makefile.shared $(srcdir)/./Makefile.inc $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
diff --git a/newlib/libc/stdio64/Makefile.inc b/newlib/libc/stdio64/Makefile.inc
new file mode 100644
index 000000000..bfe252766
--- /dev/null
+++ b/newlib/libc/stdio64/Makefile.inc
@@ -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 f0e3b0003..b88aee40b 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 ./Makefile.inc
+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/Makefile.in b/newlib/libc/stdlib/Makefile.in
index f6a4f23f7..e3bb0d061 100644
--- a/newlib/libc/stdlib/Makefile.in
+++ b/newlib/libc/stdlib/Makefile.in
@@ -597,63 +597,25 @@ DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py
 DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml)
 DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml)
 CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES)
+LIBC_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
+LIBC_CHAPTERS = stdlib.tex
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
 MALLOC_COMPILE = $(LIB_COMPILE) -DINTERNAL_NEWLIB
-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
 all: all-am
 
 .SUFFIXES:
 .SUFFIXES: .def .xml .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(srcdir)/./Makefile.inc $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
@@ -673,7 +635,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(srcdir)/../../Makefile.shared $(am__empty):
+$(srcdir)/../../Makefile.shared $(srcdir)/./Makefile.inc $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
diff --git a/newlib/libc/stdlib/Makefile.inc b/newlib/libc/stdlib/Makefile.inc
new file mode 100644
index 000000000..d2f199d8c
--- /dev/null
+++ b/newlib/libc/stdlib/Makefile.inc
@@ -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 7eb9fcdbc..d85a51365 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 ./Makefile.inc
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
diff --git a/newlib/libc/string/Makefile.in b/newlib/libc/string/Makefile.in
index 22ac91a5d..cad0b4ac5 100644
--- a/newlib/libc/string/Makefile.in
+++ b/newlib/libc/string/Makefile.in
@@ -572,33 +572,33 @@ DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py
 DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml)
 DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml)
 CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES)
-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 = 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
+LIBC_CHAPTERS = strings.tex wcstrings.tex
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
 all: all-am
 
 .SUFFIXES:
 .SUFFIXES: .def .xml .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(srcdir)/./Makefile.inc $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
@@ -618,7 +618,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(srcdir)/../../Makefile.shared $(am__empty):
+$(srcdir)/../../Makefile.shared $(srcdir)/./Makefile.inc $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
diff --git a/newlib/libc/string/Makefile.inc b/newlib/libc/string/Makefile.inc
new file mode 100644
index 000000000..5bcec8dd4
--- /dev/null
+++ b/newlib/libc/string/Makefile.inc
@@ -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/syscalls/Makefile.am b/newlib/libc/syscalls/Makefile.am
index 5895be430..ada372a7a 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/syscalls/Makefile.in b/newlib/libc/syscalls/Makefile.in
index 21afc0f41..6db97eb13 100644
--- a/newlib/libc/syscalls/Makefile.in
+++ b/newlib/libc/syscalls/Makefile.in
@@ -398,8 +398,6 @@ DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py
 DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml)
 DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml)
 CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES)
-CHEWOUT_FILES = 
-CHAPTERS = 
 all: all-am
 
 .SUFFIXES:
@@ -793,7 +791,6 @@ docbook: $(DOCBOOK_OUT_FILES)
 	do \
 	  ${top_srcdir}/../doc/chapter-texi2docbook.py <$(srcdir)/$${chapter%.xml}.tex >../$$chapter ; \
 	done
-# No doc for syscalls.
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/newlib/libc/time/Makefile.am b/newlib/libc/time/Makefile.am
index 8871d1afb..e9dcee44c 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 ./Makefile.inc
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
 
-CHAPTERS = time.tex
+$(lpfx)wcsftime.$(oext): strftime.c
diff --git a/newlib/libc/time/Makefile.in b/newlib/libc/time/Makefile.in
index fba6fabe2..ac787d98f 100644
--- a/newlib/libc/time/Makefile.in
+++ b/newlib/libc/time/Makefile.in
@@ -393,26 +393,19 @@ DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py
 DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml)
 DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml)
 CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES)
-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
-
-CHAPTERS = time.tex
+
+# This rule is needed so that wcsftime.o is rebuilt when strftime.c changes.
+LIBC_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_CHAPTERS = time.tex
+CHEWOUT_FILES = $(LIBC_CHEWOUT_FILES)
+CHAPTERS = $(LIBC_CHAPTERS)
 all: all-am
 
 .SUFFIXES:
 .SUFFIXES: .def .xml .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(srcdir)/./Makefile.inc $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
@@ -432,7 +425,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(srcdir)/../../Makefile.shared $(am__empty):
+$(srcdir)/../../Makefile.shared $(srcdir)/./Makefile.inc $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
@@ -820,8 +813,6 @@ docbook: $(DOCBOOK_OUT_FILES)
 	  ${top_srcdir}/../doc/chapter-texi2docbook.py <$(srcdir)/$${chapter%.xml}.tex >../$$chapter ; \
 	done
 
-# This rule is needed so that wcsftime.o is rebuilt when strftime.c changes.
-
 $(lpfx)wcsftime.$(oext): strftime.c
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/newlib/libc/time/Makefile.inc b/newlib/libc/time/Makefile.inc
new file mode 100644
index 000000000..3e7ba4157
--- /dev/null
+++ b/newlib/libc/time/Makefile.inc
@@ -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 a2d830f1a..a74738d74 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/unix/Makefile.in b/newlib/libc/unix/Makefile.in
index 6752d7710..06143a58f 100644
--- a/newlib/libc/unix/Makefile.in
+++ b/newlib/libc/unix/Makefile.in
@@ -397,8 +397,6 @@ DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py
 DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml)
 DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml)
 CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES)
-CHEWOUT_FILES = 
-CHAPTERS = 
 all: all-am
 
 .SUFFIXES:
@@ -750,7 +748,6 @@ docbook: $(DOCBOOK_OUT_FILES)
 	do \
 	  ${top_srcdir}/../doc/chapter-texi2docbook.py <$(srcdir)/$${chapter%.xml}.tex >../$$chapter ; \
 	done
-# No doc for unix.
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/newlib/libc/xdr/Makefile.am b/newlib/libc/xdr/Makefile.am
index ad9968c9a..8f4ac7d04 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
diff --git a/newlib/libc/xdr/Makefile.in b/newlib/libc/xdr/Makefile.in
index c986a64bb..72c0e65b0 100644
--- a/newlib/libc/xdr/Makefile.in
+++ b/newlib/libc/xdr/Makefile.in
@@ -381,8 +381,6 @@ libxdr_la_LDFLAGS = -Xcompiler -nostdlib
 @USE_LIBTOOL_FALSE@noinst_LIBRARIES = lib.a
 @USE_LIBTOOL_FALSE@lib_a_SOURCES = dummy.c $(ELIX_SOURCES)
 @USE_LIBTOOL_FALSE@lib_a_CFLAGS = $(AM_CFLAGS)
-CHEWOUT_FILES = 
-CHAPTERS = 
 
 #
 # documentation rules
@@ -732,7 +730,6 @@ docbook: $(DOCBOOK_OUT_FILES)
 	do \
 	  ${top_srcdir}/../doc/chapter-texi2docbook.py <$(srcdir)/$${chapter%.xml}.tex >../$$chapter ; \
 	done
-# No doc for xdr.
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-05  5:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-05  5:20 [newlib-cygwin] newlib: libc: move manual into top-level build Michael Frysinger

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).