1 # Makefile for the GNU C Library manual.
3 # Copyright (C) 1992, 1993 Free Software Foundation, Inc.
4 # This file is part of the GNU C Library.
6 # The GNU C Library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Library General Public License
8 # as published by the Free Software Foundation; either version 2 of
9 # the License, or (at your option) any later version.
11 # The GNU C Library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Library General Public License for more details.
16 # You should have received a copy of the GNU Library General Public
17 # License along with the GNU C Library; see the file COPYING.LIB. If
18 # not, write to the Free Software Foundation, Inc., 675 Mass Ave,
19 # Cambridge, MA 02139, USA.
28 # Set chapters and chapters-incl.
30 chapters: library.texinfo
34 chapters-incl: $(chapters)
40 awk '$$1 == "@include" { print $$2 " \\" }' $^) > $@.new
44 library.dvi library.info: $(chapters) summary.texinfo $(chapters-incl)
45 library.dvi: texinfo.tex
47 # Generate the summary from the Texinfo source files for each chapter.
48 summary.texinfo: stamp-summary ;
49 stamp-summary: summary.awk $(chapters)
51 | sort +1 -2 | tr '\014' '\012' > summary-tmp
52 move-if-change summary-tmp summary.texinfo
55 # Generate Texinfo files from the C source for the example programs.
56 %.c.texi: examples/%.c
57 sed -e 's,[{}],@&,g' \
58 -e 's,/\*\(@.*\)\*/,\1,g' \
59 -e 's,/\* *\(.*\) *\*/,/* @r{\1} */,g' \
60 -e 's/\(@[a-z][a-z]*\)@{\([^}]*\)@}/\1{\2}/'\
65 minimal-dist = library.texinfo summary.awk Makefile move-if-change \
67 $(patsubst %.c.texi,examples/%.c, \
68 $(filter-out summary.texinfo,$(chapters-incl)))
69 distribute = $(minimal-dist) \
70 $(patsubst examples/%.c,%.c.texi,$(filter examples/%.c, \
72 library.?? library.??s texinfo.tex summary.texinfo \
73 stamp-summary chapters chapters-incl
75 tar-it = tar chvf $@ $^
77 manual.tar: $(minimal-dist) ; $(tar-it)
78 mandist.tar: $(distribute) ; $(tar-it)
81 compress -c $< > $@.new
85 uuencode $< < $< > $@.new
91 $(MAKE) -f $< $(Make-dist-args)