services: Introduce extensible services.
[jackhill/guix/guix.git] / doc.am
1 # GNU Guix --- Functional package management for GNU
2 # Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3 # Copyright © 2013 Andreas Enge <andreas@enge.fr>
4 #
5 # This file is part of GNU Guix.
6 #
7 # GNU Guix is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or (at
10 # your option) any later version.
11 #
12 # GNU Guix is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20 info_TEXINFOS = doc/guix.texi
21
22 DOT_FILES = \
23 doc/images/bootstrap-graph.dot \
24 doc/images/coreutils-graph.dot \
25 doc/images/coreutils-bag-graph.dot \
26 doc/images/service-graph.dot
27
28 DOT_VECTOR_GRAPHICS = \
29 $(DOT_FILES:%.dot=%.eps) \
30 $(DOT_FILES:%.dot=%.pdf)
31
32 EXTRA_DIST += \
33 doc/contributing.texi \
34 doc/emacs.texi \
35 doc/fdl-1.3.texi \
36 $(DOT_FILES) \
37 $(DOT_VECTOR_GRAPHICS) \
38 doc/images/coreutils-size-map.eps \
39 doc/environment-gdb.scm \
40 doc/package-hello.scm
41
42 OS_CONFIG_EXAMPLES_TEXI = \
43 doc/os-config-bare-bones.texi \
44 doc/os-config-desktop.texi
45
46 # Bundle this file so that makeinfo finds it in out-of-source-tree builds.
47 BUILT_SOURCES += $(OS_CONFIG_EXAMPLES_TEXI)
48 EXTRA_DIST += $(OS_CONFIG_EXAMPLES_TEXI)
49 MAINTAINERCLEANFILES = $(OS_CONFIG_EXAMPLES_TEXI)
50
51 doc/os-config-%.texi: gnu/system/examples/%.tmpl
52 $(MKDIR_P) "`dirname "$@"`"
53 cp "$<" "$@"
54
55 infoimagedir = $(infodir)/images
56 dist_infoimage_DATA = \
57 $(DOT_FILES:%.dot=%.png) \
58 doc/images/coreutils-size-map.png
59
60 # Try hard to obtain an image size and aspect that's reasonable for inclusion
61 # in an Info or PDF document.
62 DOT_OPTIONS = \
63 -Gratio=.9 -Gnodesep=.005 -Granksep=.00005 \
64 -Nfontsize=9 -Nheight=.1 -Nwidth=.1
65
66 .dot.png:
67 $(DOT) -Tpng $(DOT_OPTIONS) < "$<" > "$@.tmp"
68 mv "$@.tmp" "$@"
69
70 .dot.pdf:
71 $(DOT) -Tpdf $(DOT_OPTIONS) < "$<" > "$@.tmp"
72 mv "$@.tmp" "$@"
73
74 .dot.eps:
75 $(DOT) -Teps $(DOT_OPTIONS) < "$<" > "$@.tmp"
76 mv "$@.tmp" "$@"
77
78 .png.eps:
79 convert "$<" "$@-tmp.eps"
80 mv "$@-tmp.eps" "$@"
81
82 # We cannot add new dependencies to `doc/guix.pdf' & co. (info "(automake)
83 # Extending"). Using the `-local' rules is imperfect, because they may be
84 # triggered after the main rule. Oh, well.
85 pdf-local: $(DOT_FILES=%.dot=$(top_srcdir)/%.pdf)
86 info-local: $(DOT_FILES=%.dot=$(top_srcdir)/%.png)
87 ps-local: $(DOT_FILES=%.dot=$(top_srcdir)/%.eps) \
88 $(top_srcdir)/doc/images/coreutils-size-map.eps
89 dvi-local: ps-local
90
91 \f
92 # Manual pages.
93
94 doc/guix.1: $(SUBCOMMANDS:%=guix/scripts/%.scm)
95 -LANGUAGE= $(top_builddir)/pre-inst-env \
96 $(HELP2MAN) --output="$@" guix
97
98 # Note: Do not depend on 'guix-daemon' since that would trigger a rebuild even
99 # for people building from a tarball.
100 doc/guix-daemon.1: nix/nix-daemon/guix-daemon.cc
101 -LANGUAGE= $(top_builddir)/pre-inst-env \
102 $(HELP2MAN) --output="$@" guix-daemon
103
104 define subcommand-manual-target
105
106 doc/guix-$(1).1: guix/scripts/$(1).scm
107 -LANGUAGE= $(top_builddir)/pre-inst-env \
108 $(HELP2MAN) --output="$$@" "guix $(1)"
109
110 endef
111
112 SUBCOMMANDS := \
113 archive \
114 build \
115 download \
116 edit \
117 environment \
118 gc \
119 hash \
120 import \
121 lint \
122 package \
123 publish \
124 pull \
125 refresh \
126 size \
127 system
128
129 $(eval $(foreach subcommand,$(SUBCOMMANDS), \
130 $(call subcommand-manual-target,$(subcommand))))
131
132 dist_man1_MANS = \
133 doc/guix.1 \
134 $(SUBCOMMANDS:%=doc/guix-%.1)
135
136 if BUILD_DAEMON
137
138 dist_man1_MANS += \
139 doc/guix-daemon.1
140
141 endif