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