build-system/gnu: Add `dist-package'.
[jackhill/guix/guix.git] / Makefile.am
1 # GNU Guix --- Functional package management for GNU
2 # Copyright © 2012, 2013 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 bin_SCRIPTS = \
21 scripts/guix
22
23 nodist_noinst_SCRIPTS = \
24 pre-inst-env \
25 test-env
26
27 include gnu-system.am
28
29 MODULES = \
30 guix/scripts/build.scm \
31 guix/scripts/download.scm \
32 guix/scripts/import.scm \
33 guix/scripts/package.scm \
34 guix/scripts/gc.scm \
35 guix/scripts/hash.scm \
36 guix/scripts/pull.scm \
37 guix/scripts/substitute-binary.scm \
38 guix/scripts/refresh.scm \
39 guix/base32.scm \
40 guix/records.scm \
41 guix/hash.scm \
42 guix/utils.scm \
43 guix/serialization.scm \
44 guix/nar.scm \
45 guix/derivations.scm \
46 guix/download.scm \
47 guix/gnu-maintenance.scm \
48 guix/licenses.scm \
49 guix/build-system.scm \
50 guix/build-system/cmake.scm \
51 guix/build-system/gnu.scm \
52 guix/build-system/perl.scm \
53 guix/build-system/python.scm \
54 guix/build-system/trivial.scm \
55 guix/ftp-client.scm \
56 guix/http-client.scm \
57 guix/gnupg.scm \
58 guix/store.scm \
59 guix/ui.scm \
60 guix/build/download.scm \
61 guix/build/cmake-build-system.scm \
62 guix/build/gnu-build-system.scm \
63 guix/build/gnu-dist.scm \
64 guix/build/perl-build-system.scm \
65 guix/build/python-build-system.scm \
66 guix/build/utils.scm \
67 guix/build/union.scm \
68 guix/build/rpath.scm \
69 guix/packages.scm \
70 guix/snix.scm \
71 guix.scm \
72 $(GNU_SYSTEM_MODULES)
73
74 # Because of the autoload hack in (guix build download), we must build it
75 # first to avoid errors on systems where (gnutls) is unavailable.
76 guix/scripts/download.go: guix/build/download.go
77
78
79 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go
80
81 nobase_dist_guilemodule_DATA = $(MODULES)
82 nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
83
84 # Do we need to provide our own non-broken (srfi srfi-37) module?
85 if INSTALL_SRFI_37
86
87 nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
88 GOBJECTS += srfi/srfi-37.go
89
90 srfi/srfi-37.scm: srfi/srfi-37.scm.in
91 $(MKDIR_P) srfi
92 cp "$<" "$@"
93
94 endif INSTALL_SRFI_37
95
96
97 SCM_TESTS = \
98 tests/base32.scm \
99 tests/hash.scm \
100 tests/builders.scm \
101 tests/derivations.scm \
102 tests/ui.scm \
103 tests/records.scm \
104 tests/utils.scm \
105 tests/build-utils.scm \
106 tests/packages.scm \
107 tests/snix.scm \
108 tests/store.scm \
109 tests/nar.scm \
110 tests/union.scm
111
112 SH_TESTS = \
113 tests/guix-build.sh \
114 tests/guix-download.sh \
115 tests/guix-gc.sh \
116 tests/guix-hash.sh \
117 tests/guix-package.sh
118
119 TESTS = $(SCM_TESTS) $(SH_TESTS)
120
121 TEST_EXTENSIONS = .scm .sh
122
123 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
124
125 SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE)
126 AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)"
127
128 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
129 AM_SH_LOG_FLAGS = -x -e
130
131 # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
132 # could end up removing files from the store while they are being used by
133 # other instances of the daemon.
134 tests/guix-gc.log: \
135 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
136 $(SCM_TESTS:%.scm=%.log)
137
138
139 EXTRA_DIST = \
140 HACKING \
141 ROADMAP \
142 TODO \
143 .dir-locals.el \
144 build-aux/hydra/gnu-system.scm \
145 build-aux/check-available-binaries.scm \
146 build-aux/download.scm \
147 build-aux/list-packages.scm \
148 build-aux/sync-synopses.scm \
149 srfi/srfi-37.scm.in \
150 srfi/srfi-64.scm \
151 srfi/srfi-64.upstream.scm \
152 tests/test.drv \
153 build-aux/config.rpath \
154 bootstrap \
155 release.nix \
156 $(TESTS)
157
158 CLEANFILES = \
159 $(GOBJECTS) \
160 $(SCM_TESTS:tests/%.scm=%.log)
161
162 AM_V_GUILEC = $(AM_V_GUILEC_$(V))
163 AM_V_GUILEC_ = $(AM_V_GUILEC_$(AM_DEFAULT_VERBOSITY))
164 AM_V_GUILEC_0 = @echo " GUILEC" $@;
165
166 # XXX: Use the C locale for when Guile lacks
167 # <http://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f>.
168 .scm.go:
169 $(AM_V_GUILEC)$(MKDIR_P) `dirname "$@"` ; \
170 LC_ALL=C \
171 $(top_builddir)/pre-inst-env \
172 $(GUILD) compile -L "$(top_builddir)" -L "$(top_srcdir)" \
173 -Wformat -Wunbound-variable -Warity-mismatch \
174 --target="$(host)" \
175 -o "$@" "$<"
176
177 SUFFIXES = .go
178
179 # Make sure source files are installed first, so that the mtime of
180 # installed compiled files is greater than that of installed source
181 # files. See
182 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
183 # for details.
184 guix_install_go_files = install-nobase_nodist_guilemoduleDATA
185 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
186
187 SUBDIRS = po
188
189 info_TEXINFOS = doc/guix.texi
190 EXTRA_DIST += \
191 doc/fdl-1.3.texi \
192 doc/images/bootstrap-graph.dot \
193 doc/images/bootstrap-graph.eps
194
195 infoimagedir = $(infodir)/images
196 dist_infoimage_DATA = doc/images/bootstrap-graph.png
197
198 # Try hard to obtain an image size and aspect that's reasonable for inclusion
199 # in an Info or PDF document.
200 DOT_OPTIONS = \
201 -Tpng -Gratio=.9 -Gnodesep=.005 -Granksep=.00005 \
202 -Nfontsize=9 -Nheight=.1 -Nwidth=.1
203
204 .dot.png:
205 dot -Tpng $(DOT_OPTIONS) < "$<" > "$@.tmp"
206 mv "$@.tmp" "$@"
207
208 .dot.eps:
209 dot -Teps $(DOT_OPTIONS) < "$<" > "$@.tmp"
210 mv "$@.tmp" "$@"
211
212 doc/guix.pdf: doc/images/bootstrap-graph.png
213 doc/guix.info: doc/images/bootstrap-graph.png
214 doc/guix.ps: doc/images/bootstrap-graph.eps
215
216 if BUILD_DAEMON
217
218 include daemon.am
219
220 endif BUILD_DAEMON
221
222 ACLOCAL_AMFLAGS = -I m4
223 AM_DISTCHECK_CONFIGURE_FLAGS = \
224 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
225 --with-nix-prefix="$(NIX_PREFIX)" \
226 --enable-daemon
227
228 dist-hook: sync-synopses gen-ChangeLog assert-no-store-file-names
229 distcheck-hook: assert-binaries-available
230
231 sync-synopses:
232 -$(top_builddir)/pre-inst-env $(GUILE) \
233 $(top_srcdir)/build-aux/sync-synopses.scm
234
235 gen-ChangeLog:
236 if test -d .git; then \
237 $(top_srcdir)/build-aux/gitlog-to-changelog \
238 > $(distdir)/cl-t; \
239 rm -f $(distdir)/ChangeLog; \
240 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
241 fi
242
243 # Make sure we're not shipping a file that embeds a local /nix/store file name.
244 assert-no-store-file-names:
245 if grep -r --exclude=*.texi --exclude=*.info \
246 "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
247 then \
248 echo "error: store file names embedded in the distribution" >&2 ; \
249 exit 1 ; \
250 fi
251
252 # Make sure hydra.gnu.org has the important binaries.
253 assert-binaries-available:
254 $(top_builddir)/pre-inst-env "$(GUILE)" \
255 "$(top_srcdir)/build-aux/check-available-binaries.scm"
256
257 .PHONY: sync-synopses gen-ChangeLog
258 .PHONY: assert-no-store-file-names assert-binaries-available