]> git.ipfire.org Git - thirdparty/glibc.git/blame - manual/Makefile
Add the statx function
[thirdparty/glibc.git] / manual / Makefile
CommitLineData
688903eb 1# Copyright (C) 1992-2018 Free Software Foundation, Inc.
28f540f4
RM
2# This file is part of the GNU C Library.
3
4# The GNU C Library is free software; you can redistribute it and/or
41bdb6e2
AJ
5# modify it under the terms of the GNU Lesser General Public
6# License as published by the Free Software Foundation; either
7# version 2.1 of the License, or (at your option) any later version.
28f540f4
RM
8
9# The GNU C Library is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41bdb6e2 12# Lesser General Public License for more details.
28f540f4 13
41bdb6e2 14# You should have received a copy of the GNU Lesser General Public
59ba27a6
PE
15# License along with the GNU C Library; if not, see
16# <http://www.gnu.org/licenses/>.
0c5ecdc4
UD
17
18# Makefile for the GNU C Library manual.
28f540f4
RM
19
20subdir := manual
28f540f4 21
a5f891ac
JM
22include ../Makeconfig
23
6a4888ff 24.PHONY: dvi pdf info html
04be94a8 25
6a4888ff
AJ
26dvi: $(objpfx)libc.dvi
27pdf: $(objpfx)libc.pdf
28
4e681b5b 29TEXI2DVI = texi2dvi
fb0dd050 30TEXI2PDF = texi2dvi --pdf
1830a0d5 31
96888079 32ifneq ($(strip $(MAKEINFO)),:)
6a4888ff 33info: $(objpfx)libc.info
28f540f4
RM
34endif
35
7a68c94a 36chapters = $(addsuffix .texi, \
390955cb 37 intro errno memory ctype string charset locale \
07435eb4 38 message search pattern io stdio llio filesys \
d52b6462 39 pipe socket terminal syslog math arith time \
085d0e35 40 resource setjmp signal startup process ipc job \
b31b4d6a
SP
41 nss users sysinfo conf crypt debug threads \
42 probes tunables)
d9dc34cd
TMQMF
43appendices = lang.texi header.texi install.texi maint.texi platform.texi \
44 contrib.texi
66ab80bc 45licenses = freemanuals.texi lgpl-2.1.texi fdl-1.3.texi
7a68c94a 46
6a4888ff 47-include $(objpfx)texis
644d3857 48$(objpfx)texis: texis.awk $(chapters) $(appendices) $(licenses)
834f9b8d 49 $(make-target-directory)
07435eb4 50 $(AWK) -f $^ > $@.T
7a68c94a
UD
51 mv -f $@.T $@
52
644d3857
JM
53nonexamples = $(filter-out %.c.texi, $(texis))
54examples = $(filter %.c.texi, $(texis))
7a68c94a 55
6a4888ff
AJ
56# Generated files directly included from libc.texinfo.
57libc-texi-generated = chapters.texi top-menu.texi dir-add.texi \
8b748aed 58 libm-err.texi version.texi pkgvers.texi
6a4888ff
AJ
59
60# Add path to build dir for generated files
61texis-path := $(filter-out $(libc-texi-generated) summary.texi $(examples), \
62 $(texis)) \
63 $(addprefix $(objpfx),$(filter $(libc-texi-generated) summary.texi \
64 $(examples), $(texis)))
65
7a68c94a 66# Kludge: implicit rule so Make knows the one command does it all.
6a4888ff
AJ
67chapters.% top-menu.%: libc-texinfo.sh $(texis-path) Makefile
68 AWK=$(AWK) $(SHELL) $< $(objpfx) \
69 '$(chapters)' \
069e52f8 70 '$(appendices) $(licenses)'
7a68c94a 71
bb8b6697 72
6a4888ff
AJ
73$(objpfx)libc.dvi $(objpfx)libc.pdf $(objpfx)libc.info: \
74 $(addprefix $(objpfx),$(libc-texi-generated))
75$(objpfx)libc.dvi $(objpfx)libc.pdf: texinfo.tex
28f540f4 76
6a4888ff
AJ
77html: $(objpfx)libc/index.html
78$(objpfx)libc/index.html: $(addprefix $(objpfx),$(libc-texi-generated))
79 $(MAKEINFO) -P $(objpfx) -o $(objpfx)libc --html libc.texinfo
fef0b717 80
28f540f4 81# Generate the summary from the Texinfo source files for each chapter.
6a4888ff 82$(objpfx)summary.texi: $(objpfx)stamp-summary ;
d08a7e4c 83$(objpfx)stamp-summary: summary.pl $(filter-out $(objpfx)summary.texi, \
6a4888ff 84 $(texis-path))
a2b581cb 85 $(SHELL) ./check-safety.sh $(filter-out $(objpfx)%, $(texis-path))
d08a7e4c 86 LC_ALL=C $(PERL) $^ > $(objpfx)summary-tmp
6a4888ff 87 $(move-if-change) $(objpfx)summary-tmp $(objpfx)summary.texi
5bc2f642 88 touch $@
28f540f4 89
ceb2d9aa
UD
90# Generate a file which can be added to the `dir' content to provide direct
91# access to the documentation of the function, variables, and other
92# definitions.
6a4888ff 93$(objpfx)dir-add.texi: xtract-typefun.awk $(texis-path)
6e613d6a
RM
94 (echo "@dircategory GNU C library functions and macros"; \
95 echo "@direntry"; \
c0016081 96 $(AWK) -f $^ | sort; \
6e613d6a 97 echo "@end direntry") > $@.new
63551311 98 mv -f $@.new $@
ceb2d9aa 99
aaa1276e 100# The table with the math errors is generated.
6a4888ff
AJ
101$(objpfx)libm-err.texi: $(objpfx)stamp-libm-err
102$(objpfx)stamp-libm-err: libm-err-tab.pl $(wildcard $(foreach dir,$(sysdirs),\
aaa1276e
UD
103 $(dir)/libm-test-ulps))
104 pwd=`pwd`; \
6a4888ff
AJ
105 $(PERL) $< $$pwd/.. > $(objpfx)libm-err-tmp
106 $(move-if-change) $(objpfx)libm-err-tmp $(objpfx)libm-err.texi
aaa1276e
UD
107 touch $@
108
8b748aed
JM
109# Package version and bug reporting URL.
110$(objpfx)pkgvers.texi: $(objpfx)stamp-pkgvers ;
111$(objpfx)stamp-pkgvers: $(common-objpfx)config.make
112 echo "@ifclear PKGVERS" > $(objpfx)pkgvers-tmp
113 echo "@set PKGVERS" >> $(objpfx)pkgvers-tmp
114 echo "@set PKGVERSION $(PKGVERSION_TEXI)" >> $(objpfx)pkgvers-tmp
115 if [ "$(PKGVERSION_TEXI)" = "(GNU libc) " ]; then \
116 echo "@set PKGVERSION_DEFAULT" >> $(objpfx)pkgvers-tmp; \
117 fi
118 echo "@set REPORT_BUGS_TO $(REPORT_BUGS_TEXI)" >> $(objpfx)pkgvers-tmp
119 echo "@end ifclear" >> $(objpfx)pkgvers-tmp
120 $(move-if-change) $(objpfx)pkgvers-tmp $(objpfx)pkgvers.texi
121 touch $@
122
bb8b6697 123# Generate a file with the version number.
6a4888ff
AJ
124$(objpfx)version.texi: $(objpfx)stamp-version ;
125$(objpfx)stamp-version: $(common-objpfx)config.make
126 echo "@set VERSION $(version)" > $(objpfx)version-tmp
127 $(move-if-change) $(objpfx)version-tmp $(objpfx)version.texi
bb8b6697
JM
128 touch $@
129
28f540f4 130# Generate Texinfo files from the C source for the example programs.
6a4888ff 131$(objpfx)%.c.texi: examples/%.c
d9a17c07
RM
132 sed -e '1,/^\*\/$$/d' \
133 -e 's,[{}],@&,g' \
28f540f4
RM
134 -e 's,/\*\(@.*\)\*/,\1,g' \
135 -e 's,/\* *,/* @r{,g' -e 's, *\*/,} */,' \
b0de3e9e 136 -e 's/\(@[a-z][a-z]*\)@{\([^}]*\)@}/\1{\2}/g'\
28f540f4
RM
137 $< | expand > $@.new
138 mv -f $@.new $@
139
6a4888ff
AJ
140$(objpfx)%.info: %.texinfo
141 LANGUAGE=C LC_ALL=C $(MAKEINFO) -P $(objpfx) --output=$@ $<
7a68c94a 142
6a4888ff
AJ
143$(objpfx)%.dvi: %.texinfo
144 cd $(objpfx);$(TEXI2DVI) -I $(shell cd $(<D) && pwd) --output=$@ \
145 $(shell cd $(<D) && pwd)/$<
146
147$(objpfx)%.pdf: %.texinfo
148 cd $(objpfx);$(TEXI2PDF) -I $(shell cd $(<D) && pwd) --output=$@ \
149 $(shell cd $(<D) && pwd)/$<
7a68c94a 150
1830a0d5 151
7a68c94a 152# Distribution.
d08a7e4c 153minimal-dist = summary.pl texis.awk tsort.awk libc-texinfo.sh libc.texinfo \
ee196e3c 154 libm-err.texi stamp-libm-err check-safety.sh \
464d646f 155 $(filter-out summary.texi, $(nonexamples)) \
7a68c94a 156 $(patsubst %.c.texi,examples/%.c, $(examples))
28f540f4 157
28f540f4 158indices = cp fn pg tp vr ky
f08e9a26
RM
159generated-dirs += libc
160generated += libc.dvi libc.pdf libc.tmp libc.info* \
161 stubs \
162 texis summary.texi stamp-summary *.c.texi \
163 $(foreach index,$(indices),libc.$(index) libc.$(index)s) \
164 libc.log libc.aux libc.toc \
165 $(libc-texi-generated) \
166 stamp-libm-err stamp-version
6a4888ff
AJ
167
168include ../Rules
169
170.PHONY: install subdir_install install-data
28f540f4 171install-data subdir_install: install
d08a7e4c 172# Generated files requiring perl: libm-err.texi, summary.texi
1695cdae 173ifneq ($(PERL),no)
96888079 174ifneq ($(strip $(MAKEINFO)),:)
6e613d6a 175install: $(inst_infodir)/libc.info
907a1bac 176 @if $(SHELL) -c '$(INSTALL_INFO) --version' >/dev/null 2>&1; then \
b28dcd8e 177 test -f $(inst_infodir)/dir || $(INSTALL_DATA) dir $(inst_infodir);\
907a1bac 178 $(INSTALL_INFO) --info-dir=$(inst_infodir) $(inst_infodir)/libc.info;\
714a562f 179 else : ; fi
6591c335 180endif
1695cdae 181endif
28f540f4
RM
182# Catchall implicit rule for other installation targets from the parent.
183install-%: ;
184
6a4888ff
AJ
185$(inst_infodir)/libc.info: $(objpfx)libc.info
186 $(make-target-directory)
28f540f4 187 for file in $<*; do \
6a4888ff 188 $(INSTALL_DATA) $$file $(@D)/; \
28f540f4
RM
189 done
190
28f540f4
RM
191TAGS: $(minimal-dist)
192 $(ETAGS) -o $@ $^