1 # Copyright (C) 1992, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
4 # The GNU C Library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Library General Public License
6 # as published by the Free Software Foundation; either version 2 of
7 # the License, or (at your option) any later version.
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
12 # Library General Public License for more details.
14 # You should have received a copy of the GNU Library General Public
15 # License along with the GNU C Library; see the file COPYING.LIB. If not,
16 # write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 # Boston, MA 02111-1307, USA.
19 # Makefile for the GNU C Library manual.
22 export subdir
:= $(subdir
)
24 # We need GNU awk for the xtract-typefun script.
32 # Get glibc's configuration info.
33 ifneq (,$(wildcard ..
/Makeconfig
))
37 # Set chapters and chapters-incl.
39 chapters
: libc.texinfo
42 -include chapters-incl
43 chapters-incl
: $(chapters
)
45 chapters-incl
:= $(filter-out summary.texi
,$(chapters-incl
))
49 (echo
'$(@F) :=' \\ ;\
50 awk
'$$1 == "@include" { print $$2 " \\" }' $^
) > $@.new
54 libc.
dvi libc.
info: $(chapters
) summary.texi
$(chapters-incl
)
57 # Generate the summary from the Texinfo source files for each chapter.
58 summary.texi
: stamp-summary
;
59 stamp-summary
: summary.awk
$(chapters
) $(chapters-incl
)
61 |
sort -df
+1 -2 | tr
'\014' '\012' > summary-tmp
62 .
/move-if-change summary-tmp summary.texi
63 # touch is broken on our machines. Sigh.
66 # Generate a file which can be added to the `dir' content to provide direct
67 # access to the documentation of the function, variables, and other
69 dir-add.texi
: manual
/xtract-typefun.awk
$(chapters-incl
)
70 if
test -n
"$(chapters-incl)"; then \
71 (for i in
$(chapters-incl
); do \
73 done
) |
sort > $@.new
; \
74 .
/move-if-change
$@.new
$@
; \
77 # Generate Texinfo files from the C source for the example programs.
78 %.c.texi
: examples
/%.c
79 sed
-e
's,[{}],@&,g' \
80 -e
's,/\*\(@.*\)\*/,\1,g' \
81 -e
's,/\* *,/* @r{,g' -e
's, *\*/,} */,' \
82 -e
's/\(@[a-z][a-z]*\)@{\([^}]*\)@}/\1{\2}/'\
87 minimal-dist
= summary.awk move-if-change libc.texinfo
$(chapters
) \
88 $(patsubst %.c.texi
,examples
/%.c
, \
89 $(filter-out summary.texi
,$(chapters-incl
)))
90 doc-only-dist
= Makefile COPYING.LIB mkinstalldirs
91 distribute
= $(minimal-dist
) \
92 $(patsubst examples
/%.c
,%.c.texi
,$(filter examples
/%.c
, \
94 libc.
info* libc.?? libc.??s texinfo.
tex summary.texi \
95 stamp-summary chapters chapters-incl \
97 export distribute
:= $(distribute
)
99 tar-it
= tar chovf
$@
$^
101 manual.
tar: $(doc-only-dist
) $(minimal-dist
) ; $(tar-it
)
102 mandist.
tar: $(doc-only-dist
) $(distribute
) ; $(tar-it
)
104 edition
:= $(shell sed
-n
's/^@set EDITION \([0-9][0-9.]*\)[^0-9.]*.*$$/\1/p' \
107 glibc-doc-
$(edition
).
tar: $(doc-only-dist
) $(distribute
)
108 @
rm -f glibc-doc-
$(edition
)
109 ln
-s . glibc-doc-
$(edition
)
110 tar chovf
$@
$(addprefix glibc-doc-
$(edition
)/,$^
)
111 rm -f glibc-doc-
$(edition
)
114 compress
-c
$< > $@.new
117 gzip
-9 -c
$< > $@.new
120 uuencode
$< < $< > $@.new
123 .PHONY
: mostlyclean distclean realclean clean
125 -rm -f libc.
dvi libc.
info*
128 indices
= cp fn pg tp vr ky
130 -rm -f chapters chapters-incl summary.texi stamp-summary
*.c.texi
131 -rm -f
$(foreach index
,$(indices
),libc.
$(index
) libc.
$(index
)s
)
132 -rm -f libc.log libc.aux libc.toc
134 .PHONY
: install subdir_install
installdirs install-data
135 install-data subdir_install
: install
136 install: $(inst_infodir
)/libc.
info
137 # Catchall implicit rule for other installation targets from the parent.
140 $(inst_infodir
)/libc.
info: libc.
info installdirs
141 for file in
$<*; do \
142 name
=`basename $$file`; \
143 $(INSTALL_DATA
) $$file \
144 `echo $@ | sed "s,$<\$$,$$name,"`; \
147 installdirs: $(firstword $(wildcard mkinstalldirs ..
/mkinstalldirs
))
148 $(dir $<)$(notdir $<) $(inst_infodir
)
151 dist: # glibc-doc-$(edition).tar.gz
153 ifneq (,$(wildcard ..
/Make-dist
))
155 $(MAKE
) -f
$< $(Make-dist-args
)
161 TAGS
: $(minimal-dist
)
164 # The parent makefile sometimes invokes us with targets `subdir_REAL-TARGET'.
166 # For targets we don't define, do nothing.
169 # These are targets that each glibc subdirectory is expected to understand.
170 # ../Rules defines them for code subdirectories; for us, they are no-ops.
171 # None of these should be `subdir_TARGET'; those targets are transformed
172 # by the implicit rule above into `TARGET' deps.
173 glibc-targets
:= lib objects objs others tests lint.out \
174 echo-headers echo-distinfo stubs
175 .PHONY
: $(glibc-targets
)
178 # Create stamp files if they don't exist, so the parent makefile's rules for
179 # updating the library archives are happy with us, and never think we have
180 # changed the library.
181 lib
: $(foreach o
,$(object-suffixes
),$(objpfx
)stamp
$o-$(subdir
))
182 stubs
: $(common-objpfx
)stub-manual
183 $(common-objpfx
)stub-manual ..
/po
/manual.pot
$(objpfx
)stamp
%-$(subdir
):
184 $(make-target-directory
)
188 # Make the target directory if it doesn't exist, using the `mkinstalldirs'
189 # script that does `mkdir -p' even if `mkdir' doesn't support that flag.
190 define make-target-directory
191 $(addprefix $(..
).
/mkinstalldirs
,\
192 $(filter-out $(wildcard $(@D
:%/=%)),$(@D
:%/=%)))
195 # The top-level glibc Makefile expects subdir_install to update the stubs file.
196 subdir_install
: stubs
198 # Get rid of these variables if they came from the parent.