Merge branch 'master' into gnome-updates
[jackhill/guix/guix.git] / doc / local.mk
1 # GNU Guix --- Functional package management for GNU
2 # Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
3 # Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
4 # Copyright © 2013 Andreas Enge <andreas@enge.fr>
5 # Copyright © 2016 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
6 # Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
7 #
8 # This file is part of GNU Guix.
9 #
10 # GNU Guix is free software; you can redistribute it and/or modify it
11 # under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 3 of the License, or (at
13 # your option) any later version.
14 #
15 # GNU Guix is distributed in the hope that it will be useful, but
16 # WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
19 #
20 # You should have received a copy of the GNU General Public License
21 # along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23 info_TEXINFOS = %D%/guix.texi
24
25 DOT_FILES = \
26 %D%/images/bootstrap-graph.dot \
27 %D%/images/bootstrap-packages.dot \
28 %D%/images/coreutils-graph.dot \
29 %D%/images/coreutils-bag-graph.dot \
30 %D%/images/service-graph.dot \
31 %D%/images/shepherd-graph.dot
32
33 DOT_VECTOR_GRAPHICS = \
34 $(DOT_FILES:%.dot=%.eps) \
35 $(DOT_FILES:%.dot=%.pdf)
36
37 EXTRA_DIST += \
38 %D%/htmlxref.cnf \
39 %D%/contributing.texi \
40 %D%/fdl-1.3.texi \
41 $(DOT_FILES) \
42 $(DOT_VECTOR_GRAPHICS) \
43 %D%/images/coreutils-size-map.eps \
44 %D%/environment-gdb.scm \
45 %D%/package-hello.scm
46
47 OS_CONFIG_EXAMPLES_TEXI = \
48 %D%/os-config-bare-bones.texi \
49 %D%/os-config-desktop.texi \
50 %D%/os-config-lightweight-desktop.texi
51
52 # Bundle this file so that makeinfo finds it in out-of-source-tree builds.
53 BUILT_SOURCES += $(OS_CONFIG_EXAMPLES_TEXI)
54 EXTRA_DIST += $(OS_CONFIG_EXAMPLES_TEXI)
55 MAINTAINERCLEANFILES = $(OS_CONFIG_EXAMPLES_TEXI)
56
57 %D%/os-config-%.texi: gnu/system/examples/%.tmpl
58 $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \
59 cp "$<" "$@"
60
61 infoimagedir = $(infodir)/images
62 dist_infoimage_DATA = \
63 $(DOT_FILES:%.dot=%.png) \
64 %D%/images/coreutils-size-map.png
65
66 # Try hard to obtain an image size and aspect that's reasonable for inclusion
67 # in an Info or PDF document.
68 DOT_OPTIONS = \
69 -Gratio=.9 -Gnodesep=.005 -Granksep=.00005 \
70 -Nfontsize=9 -Nheight=.1 -Nwidth=.1
71
72 .dot.png:
73 $(AM_V_DOT)$(DOT) -Tpng $(DOT_OPTIONS) < "$<" > "$(srcdir)/$@.tmp"; \
74 mv "$(srcdir)/$@.tmp" "$(srcdir)/$@"
75
76 .dot.pdf:
77 $(AM_V_DOT)$(DOT) -Tpdf $(DOT_OPTIONS) < "$<" > "$(srcdir)/$@.tmp"; \
78 mv "$(srcdir)/$@.tmp" "$(srcdir)/$@"
79
80 .dot.eps:
81 $(AM_V_DOT)$(DOT) -Teps $(DOT_OPTIONS) < "$<" > "$(srcdir)/$@.tmp"; \
82 mv "$(srcdir)/$@.tmp" "$(srcdir)/$@"
83
84 .png.eps:
85 $(AM_V_GEN)convert "$<" "$@-tmp.eps"; \
86 mv "$@-tmp.eps" "$@"
87
88 # We cannot add new dependencies to `%D%/guix.pdf' & co. (info "(automake)
89 # Extending"). Using the `-local' rules is imperfect, because they may be
90 # triggered after the main rule. Oh, well.
91 pdf-local: $(DOT_FILES=%.dot=$(top_srcdir)/%.pdf)
92 info-local: $(DOT_FILES=%.dot=$(top_srcdir)/%.png)
93 ps-local: $(DOT_FILES=%.dot=$(top_srcdir)/%.eps) \
94 $(top_srcdir)/%D%/images/coreutils-size-map.eps
95 dvi-local: ps-local
96
97 ## ----------- ##
98 ## Man pages. ##
99 ## ----------- ##
100
101 # The man pages are generated using GNU Help2man. In makefiles rules they
102 # depend not on the binary, but on the source files. This usage allows a
103 # manual page to be generated by the maintainer and included in the
104 # distribution without requiring the end-user to have 'help2man' installed.
105 # They are built in $(srcdir) like info manuals.
106
107 sub_commands_mans = \
108 $(srcdir)/%D%/guix-archive.1 \
109 $(srcdir)/%D%/guix-build.1 \
110 $(srcdir)/%D%/guix-challenge.1 \
111 $(srcdir)/%D%/guix-download.1 \
112 $(srcdir)/%D%/guix-edit.1 \
113 $(srcdir)/%D%/guix-environment.1 \
114 $(srcdir)/%D%/guix-gc.1 \
115 $(srcdir)/%D%/guix-hash.1 \
116 $(srcdir)/%D%/guix-import.1 \
117 $(srcdir)/%D%/guix-lint.1 \
118 $(srcdir)/%D%/guix-package.1 \
119 $(srcdir)/%D%/guix-publish.1 \
120 $(srcdir)/%D%/guix-pull.1 \
121 $(srcdir)/%D%/guix-refresh.1 \
122 $(srcdir)/%D%/guix-size.1 \
123 $(srcdir)/%D%/guix-system.1
124
125 dist_man1_MANS = \
126 $(srcdir)/%D%/guix.1 \
127 $(sub_commands_mans)
128
129 gen_man = \
130 LANGUAGE= $(top_builddir)/pre-inst-env $(HELP2MAN) \
131 $(HELP2MANFLAGS)
132
133 HELP2MANFLAGS = --source=GNU --info-page=$(PACKAGE_TARNAME)
134
135 $(srcdir)/%D%/guix.1: scripts/guix.in $(sub_commands_mans)
136 -$(AM_V_HELP2MAN)$(gen_man) --output="$@" `basename "$@" .1`
137
138 # The 'case' ensures the man pages are only generated if the corresponding
139 # source script (the first prerequisite) has been changed. The $(GOBJECTS)
140 # prerequisite is solely meant to force these docs to be made only after all
141 # Guile modules have been compiled.
142 $(srcdir)/%D%/guix-%.1: guix/scripts/%.scm $(GOBJECTS)
143 -@case '$?' in \
144 *$<*) $(AM_V_P) && set -x || echo " HELP2MAN $@"; \
145 $(gen_man) --output="$@" "guix $*";; \
146 *) : ;; \
147 esac
148
149 if BUILD_DAEMON
150
151 dist_man1_MANS += $(srcdir)/%D%/guix-daemon.1
152
153 $(srcdir)/%D%/guix-daemon.1: nix/nix-daemon/guix-daemon.cc
154 -$(AM_V_HELP2MAN)$(gen_man) --output="$@" `basename "$@" .1`
155
156 endif