libc/newlib/libm/Makefile.am
Jon Turney 0b4cbd2fb8 Make newlib manpages (v3)
Add makedocbook, a tool to process makedoc markup and output DocBook XML
refentries.

Process all the source files which are processed with makedoc with
makedocbook as well

Add chapter-texi2docbook, a tool to automatically generate DocBook XML
chapter files from the chapter .texi files.  For generating man pages all we
care about is the content of the refentries, so all this needs to do is
convert the @include of the makedoc generated .def files to xi:include of
the makedocbook generated .xml files.

Add skeleton Docbook XML book files, lib[cm].in.xml which include these
generated chapters, which in turn include the generated files containing
refentries, which is processed with xsltproc to generate the lib[cm].xml

Add new make targets to generate and install man pages from lib[cm].xml
2016-07-04 14:17:10 +01:00

85 lines
1.9 KiB
Makefile

## Process this file with automake to generate Makefile.in
AUTOMAKE_OPTIONS = cygnus
if NEWLIB_HW_FP
MATHDIR = mathfp
else
MATHDIR = math
endif
SUBDIRS = $(MATHDIR) common complex machine
libm_la_LDFLAGS = -Xcompiler -nostdlib
if USE_LIBTOOL
SUBLIBS = $(MATHDIR)/lib$(MATHDIR).$(aext) common/libcommon.$(aext) complex/libcomplex.$(aext) $(LIBM_MACHINE_LIB)
noinst_LTLIBRARIES = libm.la
libm_la_SOURCES =
libm_la_LIBADD = $(SUBLIBS)
else
SUBLIBS = $(MATHDIR)/lib.$(aext) common/lib.$(aext) complex/lib.$(aext) $(LIBM_MACHINE_LIB)
noinst_LIBRARIES = libm.a
libm.a: $(SUBLIBS)
rm -f $@
rm -rf tmp
mkdir tmp
cd tmp; \
for i in $(SUBLIBS); do \
$(AR) x ../$$i; \
done; \
$(AR) $(AR_FLAGS) ../$@ *.o
$(RANLIB) $@
rm -rf tmp
endif
$(SUBLIBS):
info_TEXINFOS = libm.texinfo
libm_TEXINFOS = targetdep.tex
libm.dvi: targetdep.tex math/stmp-def complex/stmp-def
stmp-targetdep: force
rm -f tmp.texi
targetdoc=`pwd`/tmp.texi; \
for d in $(SUBDIRS); do \
if test "$$d" != "."; then \
(cd $$d && $(MAKE) doc) || exit 1; \
fi; \
done
$(SHELL) $(newlib_basedir)/../move-if-change tmp.texi targetdep.tex
touch $@
targetdep.tex: stmp-targetdep ; @true
math/stmp-def: stmp-targetdep ; @true
complex/stmp-def: stmp-targetdep ; @true
docbook-recursive: force
for d in $(SUBDIRS); do \
if test "$$d" != "."; then \
(cd $$d && $(MAKE) docbook) || exit 1; \
fi; \
done
math/stmp-xml complex/stmp-xml: docbook-recursive
man: math/stmp-xml complex/stmp-xml libm.in.xml
xsltproc --xinclude --path ${builddir} --nonet ${srcdir}/../refcontainers.xslt ${srcdir}/libm.in.xml >libm.xml
xmlto --skip-validation --searchpath ${builddir} man -m ${srcdir}/../man.xsl libm.xml
install-man: man
mkdir -p $(DESTDIR)$(mandir)/man3
$(INSTALL_DATA) *.3 $(DESTDIR)$(mandir)/man3/
.PHONY: force
force:
CLEANFILES = tmp.texi targetdep.tex stmp-targetdep *.xml *.3
ACLOCAL_AMFLAGS = -I .. -I ../..
CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host