Merge branch 'master' into 'core-updates'.
[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/monad-repl.scm \
41 guix/gexp.scm \
42 guix/profiles.scm \
43 guix/serialization.scm \
44 guix/nar.scm \
45 guix/derivations.scm \
46 guix/gnu-maintenance.scm \
47 guix/licenses.scm \
48 guix/build-system.scm \
49 guix/build-system/cmake.scm \
50 guix/build-system/glib-or-gtk.scm \
51 guix/build-system/gnu.scm \
52 guix/build-system/perl.scm \
53 guix/build-system/python.scm \
54 guix/build-system/ruby.scm \
55 guix/build-system/trivial.scm \
56 guix/ftp-client.scm \
57 guix/http-client.scm \
58 guix/gnupg.scm \
59 guix/elf.scm \
60 guix/store.scm \
61 guix/svn-download.scm \
62 guix/ui.scm \
63 guix/build/download.scm \
64 guix/build/cmake-build-system.scm \
65 guix/build/git.scm \
66 guix/build/glib-or-gtk-build-system.scm \
67 guix/build/gnu-build-system.scm \
68 guix/build/gnu-dist.scm \
69 guix/build/perl-build-system.scm \
70 guix/build/python-build-system.scm \
71 guix/build/ruby-build-system.scm \
72 guix/build/store-copy.scm \
73 guix/build/utils.scm \
74 guix/build/union.scm \
75 guix/build/pull.scm \
76 guix/build/rpath.scm \
77 guix/build/svn.scm \
78 guix/build/syscalls.scm \
79 guix/build/emacs-utils.scm \
80 guix/build/graft.scm \
81 guix/packages.scm \
82 guix/import/utils.scm \
83 guix/import/gnu.scm \
84 guix/import/snix.scm \
85 guix/scripts/download.scm \
86 guix/scripts/build.scm \
87 guix/scripts/archive.scm \
88 guix/scripts/import.scm \
89 guix/scripts/package.scm \
90 guix/scripts/gc.scm \
91 guix/scripts/hash.scm \
92 guix/scripts/pull.scm \
93 guix/scripts/substitute-binary.scm \
94 guix/scripts/authenticate.scm \
95 guix/scripts/refresh.scm \
96 guix/scripts/system.scm \
97 guix/scripts/lint.scm \
98 guix/scripts/import/gnu.scm \
99 guix/scripts/import/nix.scm \
100 guix/scripts/environment.scm \
101 guix.scm \
102 $(GNU_SYSTEM_MODULES)
103
104 if BUILD_DAEMON_OFFLOAD
105
106 MODULES += \
107 guix/scripts/offload.scm
108
109 endif BUILD_DAEMON_OFFLOAD
110
111 # Internal module with test suite support.
112 dist_noinst_DATA = guix/tests.scm
113
114 # Because of the autoload hack in (guix build download), we must build it
115 # first to avoid errors on systems where (gnutls) is unavailable.
116 guix/scripts/download.go: guix/build/download.go
117 guix/download.go: guix/build/download.go
118
119 # Linux-Libre configurations.
120 KCONFIGS = \
121 gnu/packages/linux-libre-i686.conf \
122 gnu/packages/linux-libre-x86_64.conf
123
124 # Templates, examples.
125 EXAMPLES = \
126 gnu/system/os-config.tmpl
127
128 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go guix/tests.go
129
130 nobase_dist_guilemodule_DATA = $(MODULES) $(KCONFIGS) $(EXAMPLES)
131 nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
132
133 # Do we need to provide our own non-broken (srfi srfi-37) module?
134 if INSTALL_SRFI_37
135
136 nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
137 GOBJECTS += srfi/srfi-37.go
138
139 srfi/srfi-37.scm: srfi/srfi-37.scm.in
140 $(MKDIR_P) srfi
141 cp "$<" "$@"
142
143 endif INSTALL_SRFI_37
144
145 # Handy way to remove the .go files without removing all the rest.
146 clean-go:
147 -$(RM) -f $(GOBJECTS)
148
149
150 SCM_TESTS = \
151 tests/base32.scm \
152 tests/base64.scm \
153 tests/hash.scm \
154 tests/pk-crypto.scm \
155 tests/pki.scm \
156 tests/substitute-binary.scm \
157 tests/builders.scm \
158 tests/derivations.scm \
159 tests/ui.scm \
160 tests/records.scm \
161 tests/utils.scm \
162 tests/build-utils.scm \
163 tests/packages.scm \
164 tests/snix.scm \
165 tests/store.scm \
166 tests/monads.scm \
167 tests/gexp.scm \
168 tests/nar.scm \
169 tests/union.scm \
170 tests/profiles.scm \
171 tests/syscalls.scm \
172 tests/lint.scm
173
174 if HAVE_GUILE_JSON
175
176 MODULES += \
177 guix/import/pypi.scm \
178 guix/scripts/import/pypi.scm
179
180 SCM_TESTS += tests/pypi.scm
181
182 endif
183
184 SH_TESTS = \
185 tests/guix-build.sh \
186 tests/guix-download.sh \
187 tests/guix-gc.sh \
188 tests/guix-hash.sh \
189 tests/guix-package.sh \
190 tests/guix-system.sh \
191 tests/guix-archive.sh \
192 tests/guix-authenticate.sh \
193 tests/guix-lint.sh
194
195 if BUILD_DAEMON
196
197 SH_TESTS += tests/guix-register.sh
198
199 endif BUILD_DAEMON
200
201
202 TESTS = $(SCM_TESTS) $(SH_TESTS)
203
204 TEST_EXTENSIONS = .scm .sh
205
206 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
207
208 SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE)
209 AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)"
210
211 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
212 AM_SH_LOG_FLAGS = -x -e
213
214 # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
215 # could end up removing files from the store while they are being used by
216 # other instances of the daemon.
217 tests/guix-gc.log: \
218 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
219 $(SCM_TESTS:%.scm=%.log)
220
221 # Public key used to sign substitutes from hydra.gnu.org.
222 dist_pkgdata_DATA = hydra.gnu.org.pub
223
224 EXTRA_DIST = \
225 HACKING \
226 ROADMAP \
227 TODO \
228 .dir-locals.el \
229 build-aux/build-self.scm \
230 build-aux/hydra/gnu-system.scm \
231 build-aux/hydra/demo-os.scm \
232 build-aux/hydra/guix.scm \
233 build-aux/check-available-binaries.scm \
234 build-aux/check-final-inputs-self-contained.scm \
235 build-aux/download.scm \
236 build-aux/list-packages.scm \
237 srfi/srfi-37.scm.in \
238 srfi/srfi-64.scm \
239 srfi/srfi-64.upstream.scm \
240 tests/test.drv \
241 tests/signing-key.pub \
242 tests/signing-key.sec \
243 build-aux/config.rpath \
244 bootstrap \
245 release.nix \
246 $(TESTS)
247
248 if !BUILD_DAEMON_OFFLOAD
249
250 EXTRA_DIST += \
251 guix/scripts/offload.scm
252
253 endif !BUILD_DAEMON_OFFLOAD
254
255
256 CLEANFILES = \
257 $(GOBJECTS) \
258 $(SCM_TESTS:tests/%.scm=%.log)
259
260 AM_V_GUILEC = $(AM_V_GUILEC_$(V))
261 AM_V_GUILEC_ = $(AM_V_GUILEC_$(AM_DEFAULT_VERBOSITY))
262 AM_V_GUILEC_0 = @echo " GUILEC" $@;
263
264 # XXX: Use the C locale for when Guile lacks
265 # <http://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f>.
266 .scm.go:
267 $(AM_V_GUILEC)$(MKDIR_P) `dirname "$@"` ; \
268 LC_ALL=C \
269 $(top_builddir)/pre-inst-env \
270 $(GUILD) compile -L "$(top_builddir)" -L "$(top_srcdir)" \
271 -Wformat -Wunbound-variable -Warity-mismatch \
272 --target="$(host)" \
273 -o "$@" "$<"
274
275 SUFFIXES = .go
276
277 # Make sure source files are installed first, so that the mtime of
278 # installed compiled files is greater than that of installed source
279 # files. See
280 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
281 # for details.
282 guix_install_go_files = install-nobase_nodist_guilemoduleDATA
283 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
284
285 # The above trick doesn't work for 'config.go' because both 'config.scm' and
286 # 'config.go' are listed in $(nobase_nodist_guilemodule_DATA). Thus, give it
287 # special treatment.
288 install-data-hook: set-bootstrap-executable-permissions
289 touch "$(DESTDIR)$(guilemoduledir)/guix/config.go"
290
291
292 SUBDIRS = po/guix po/packages
293 BUILT_SOURCES =
294
295 include doc.am
296
297 if BUILD_DAEMON
298
299 include daemon.am
300
301 endif BUILD_DAEMON
302
303 ACLOCAL_AMFLAGS = -I m4
304 AM_DISTCHECK_CONFIGURE_FLAGS = \
305 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
306 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
307 --with-nix-prefix="$(NIX_PREFIX)" \
308 --enable-daemon
309
310 dist_emacsui_DATA = emacs/guix-main.scm
311 nodist_emacsui_DATA = emacs/guix-helper.scm
312 include emacs.am
313
314 dist-hook: sync-descriptions gen-ChangeLog assert-no-store-file-names
315 distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
316
317 sync-descriptions:
318 -$(top_builddir)/pre-inst-env guix lint --checkers=gnu-description
319
320 gen-ChangeLog:
321 if test -d .git; then \
322 $(top_srcdir)/build-aux/gitlog-to-changelog \
323 > $(distdir)/cl-t; \
324 rm -f $(distdir)/ChangeLog; \
325 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
326 fi
327
328 # Make sure we're not shipping a file that embeds a local /gnu/store file name.
329 assert-no-store-file-names:
330 if grep -r --exclude=*.texi --exclude=*.info \
331 "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
332 then \
333 echo "error: store file names embedded in the distribution" >&2 ; \
334 exit 1 ; \
335 fi
336
337 # Make sure hydra.gnu.org has the important binaries.
338 assert-binaries-available:
339 $(top_builddir)/pre-inst-env "$(GUILE)" \
340 "$(top_srcdir)/build-aux/check-available-binaries.scm"
341
342 # Make sure the final inputs don't refer to bootstrap tools.
343 assert-final-inputs-self-contained:
344 $(top_builddir)/pre-inst-env "$(GUILE)" \
345 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
346
347 .PHONY: sync-descriptions gen-ChangeLog clean-go
348 .PHONY: assert-no-store-file-names assert-binaries-available
349 .PHONY: assert-final-inputs-self-contained