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