doc: Fix typos.
[jackhill/guix/guix.git] / Makefile.am
1 # GNU Guix --- Functional package management for GNU
2 # Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
3 # Copyright © 2013 Andreas Enge <andreas@enge.fr>
4 # Copyright © 2015 Alex Kost <alezost@gmail.com>
5 # Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
6 # Copyright © 2016 Mark H Weaver <mhw@netris.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 bin_SCRIPTS = \
24 scripts/guix
25
26 nodist_noinst_SCRIPTS = \
27 pre-inst-env \
28 test-env
29
30 include gnu/local.mk
31
32 MODULES = \
33 guix/base32.scm \
34 guix/base64.scm \
35 guix/cpio.scm \
36 guix/records.scm \
37 guix/gcrypt.scm \
38 guix/hash.scm \
39 guix/pk-crypto.scm \
40 guix/pki.scm \
41 guix/combinators.scm \
42 guix/utils.scm \
43 guix/sets.scm \
44 guix/download.scm \
45 guix/git-download.scm \
46 guix/hg-download.scm \
47 guix/monads.scm \
48 guix/monad-repl.scm \
49 guix/gexp.scm \
50 guix/profiles.scm \
51 guix/serialization.scm \
52 guix/nar.scm \
53 guix/derivations.scm \
54 guix/grafts.scm \
55 guix/gnu-maintenance.scm \
56 guix/upstream.scm \
57 guix/licenses.scm \
58 guix/graph.scm \
59 guix/cve.scm \
60 guix/build-system.scm \
61 guix/build-system/ant.scm \
62 guix/build-system/cmake.scm \
63 guix/build-system/emacs.scm \
64 guix/build-system/glib-or-gtk.scm \
65 guix/build-system/gnu.scm \
66 guix/build-system/haskell.scm \
67 guix/build-system/perl.scm \
68 guix/build-system/python.scm \
69 guix/build-system/waf.scm \
70 guix/build-system/r.scm \
71 guix/build-system/ruby.scm \
72 guix/build-system/trivial.scm \
73 guix/ftp-client.scm \
74 guix/http-client.scm \
75 guix/gnupg.scm \
76 guix/elf.scm \
77 guix/store.scm \
78 guix/cvs-download.scm \
79 guix/svn-download.scm \
80 guix/ui.scm \
81 guix/build/ant-build-system.scm \
82 guix/build/download.scm \
83 guix/build/cmake-build-system.scm \
84 guix/build/emacs-build-system.scm \
85 guix/build/git.scm \
86 guix/build/hg.scm \
87 guix/build/glib-or-gtk-build-system.scm \
88 guix/build/gnu-build-system.scm \
89 guix/build/gnu-dist.scm \
90 guix/build/perl-build-system.scm \
91 guix/build/python-build-system.scm \
92 guix/build/r-build-system.scm \
93 guix/build/ruby-build-system.scm \
94 guix/build/waf-build-system.scm \
95 guix/build/haskell-build-system.scm \
96 guix/build/store-copy.scm \
97 guix/build/utils.scm \
98 guix/build/union.scm \
99 guix/build/profiles.scm \
100 guix/build/pull.scm \
101 guix/build/rpath.scm \
102 guix/build/cvs.scm \
103 guix/build/svn.scm \
104 guix/build/gremlin.scm \
105 guix/build/emacs-utils.scm \
106 guix/build/graft.scm \
107 guix/build/bournish.scm \
108 guix/search-paths.scm \
109 guix/packages.scm \
110 guix/import/utils.scm \
111 guix/import/gnu.scm \
112 guix/import/snix.scm \
113 guix/import/cabal.scm \
114 guix/import/cran.scm \
115 guix/import/hackage.scm \
116 guix/import/elpa.scm \
117 guix/scripts.scm \
118 guix/scripts/download.scm \
119 guix/scripts/build.scm \
120 guix/scripts/archive.scm \
121 guix/scripts/import.scm \
122 guix/scripts/package.scm \
123 guix/scripts/gc.scm \
124 guix/scripts/hash.scm \
125 guix/scripts/pull.scm \
126 guix/scripts/substitute.scm \
127 guix/scripts/authenticate.scm \
128 guix/scripts/refresh.scm \
129 guix/scripts/system.scm \
130 guix/scripts/lint.scm \
131 guix/scripts/challenge.scm \
132 guix/scripts/import/cran.scm \
133 guix/scripts/import/gnu.scm \
134 guix/scripts/import/nix.scm \
135 guix/scripts/import/hackage.scm \
136 guix/scripts/import/elpa.scm \
137 guix/scripts/environment.scm \
138 guix/scripts/publish.scm \
139 guix/scripts/edit.scm \
140 guix/scripts/size.scm \
141 guix/scripts/graph.scm \
142 guix/scripts/container.scm \
143 guix/scripts/container/exec.scm \
144 guix.scm \
145 $(GNU_SYSTEM_MODULES)
146
147 if HAVE_GUILE_JSON
148
149 MODULES += \
150 guix/import/github.scm \
151 guix/import/json.scm \
152 guix/import/pypi.scm \
153 guix/scripts/import/pypi.scm \
154 guix/import/cpan.scm \
155 guix/scripts/import/gem.scm \
156 guix/import/gem.scm
157
158 endif
159
160 if BUILD_SYSCALLS_MODULE
161
162 MODULES += \
163 guix/build/syscalls.scm
164
165 endif
166
167 if BUILD_DAEMON_OFFLOAD
168
169 MODULES += \
170 guix/scripts/offload.scm
171
172 endif BUILD_DAEMON_OFFLOAD
173
174 # Internal module with test suite support.
175 dist_noinst_DATA = guix/tests.scm
176
177 # Linux-Libre configurations.
178 KCONFIGS = \
179 gnu/packages/linux-libre-4.6-i686.conf \
180 gnu/packages/linux-libre-4.6-x86_64.conf \
181 gnu/packages/linux-libre-4.4-i686.conf \
182 gnu/packages/linux-libre-4.4-x86_64.conf \
183 gnu/packages/linux-libre-4.1-i686.conf \
184 gnu/packages/linux-libre-4.1-x86_64.conf
185
186 # Templates, examples.
187 EXAMPLES = \
188 gnu/system/examples/bare-bones.tmpl \
189 gnu/system/examples/desktop.tmpl \
190 gnu/system/examples/lightweight-desktop.tmpl
191
192 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go guix/tests.go
193
194 nobase_dist_guilemodule_DATA = \
195 $(MODULES) $(KCONFIGS) $(EXAMPLES) \
196 $(MISC_DISTRO_FILES)
197 nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
198
199 # Do we need to provide our own non-broken (srfi srfi-37) module?
200 if INSTALL_SRFI_37
201
202 nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
203 GOBJECTS += srfi/srfi-37.go
204
205 srfi/srfi-37.scm: srfi/srfi-37.scm.in
206 $(MKDIR_P) srfi
207 cp "$<" "$@"
208
209 endif INSTALL_SRFI_37
210
211 # Handy way to remove the .go files without removing all the rest.
212 clean-go:
213 -$(RM) -f $(GOBJECTS)
214
215
216 # Test extensions; has to be unconditional.
217 TEST_EXTENSIONS = .scm .sh
218
219 if CAN_RUN_TESTS
220
221 SCM_TESTS = \
222 tests/base32.scm \
223 tests/base64.scm \
224 tests/cpio.scm \
225 tests/hash.scm \
226 tests/pk-crypto.scm \
227 tests/pki.scm \
228 tests/sets.scm \
229 tests/gnu-maintenance.scm \
230 tests/substitute.scm \
231 tests/builders.scm \
232 tests/derivations.scm \
233 tests/grafts.scm \
234 tests/ui.scm \
235 tests/records.scm \
236 tests/upstream.scm \
237 tests/combinators.scm \
238 tests/utils.scm \
239 tests/build-utils.scm \
240 tests/packages.scm \
241 tests/snix.scm \
242 tests/hackage.scm \
243 tests/cran.scm \
244 tests/elpa.scm \
245 tests/store.scm \
246 tests/monads.scm \
247 tests/gexp.scm \
248 tests/nar.scm \
249 tests/union.scm \
250 tests/profiles.scm \
251 tests/syscalls.scm \
252 tests/gremlin.scm \
253 tests/bournish.scm \
254 tests/lint.scm \
255 tests/publish.scm \
256 tests/scripts.scm \
257 tests/size.scm \
258 tests/graph.scm \
259 tests/challenge.scm \
260 tests/cve.scm \
261 tests/file-systems.scm \
262 tests/system.scm \
263 tests/services.scm \
264 tests/scripts-build.scm \
265 tests/containers.scm \
266 tests/import-utils.scm
267
268 if HAVE_GUILE_JSON
269
270 SCM_TESTS += \
271 tests/pypi.scm \
272 tests/cpan.scm \
273 tests/gem.scm
274
275 endif
276
277 SH_TESTS = \
278 tests/guix-build.sh \
279 tests/guix-download.sh \
280 tests/guix-gc.sh \
281 tests/guix-hash.sh \
282 tests/guix-package.sh \
283 tests/guix-package-net.sh \
284 tests/guix-system.sh \
285 tests/guix-archive.sh \
286 tests/guix-authenticate.sh \
287 tests/guix-environment.sh \
288 tests/guix-environment-container.sh \
289 tests/guix-graph.sh \
290 tests/guix-lint.sh
291
292 if BUILD_DAEMON
293
294 SH_TESTS += tests/guix-register.sh
295
296 endif BUILD_DAEMON
297
298
299 TESTS = $(SCM_TESTS) $(SH_TESTS)
300
301 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" GUILE_AUTO_COMPILE=0
302
303 SCM_LOG_DRIVER = \
304 $(top_builddir)/test-env --quiet-stderr \
305 $(GUILE) --no-auto-compile -e main \
306 $(top_srcdir)/build-aux/test-driver.scm
307
308 AM_SCM_LOG_DRIVER_FLAGS = --brief=yes
309
310 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
311 AM_SH_LOG_FLAGS = -x -e
312
313 # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
314 # could end up removing files from the store while they are being used by
315 # other instances of the daemon.
316 tests/guix-gc.log: \
317 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
318 $(SCM_TESTS:%.scm=%.log)
319
320 else !CAN_RUN_TESTS
321
322 TESTS =
323 SH_TESTS =
324 SCM_TESTS =
325
326 # Automake always generates a 'check' target, so better not override it.
327 check-local:
328 @echo
329 @echo "Cannot run tests because file name limits would be exceeded." >&2
330 @echo "Look for 'length' in the 'config.log' file for details." >&2
331 @echo
332 @exit 1
333
334 endif !CAN_RUN_TESTS
335
336 check-system: $(GOBJECTS)
337 $(AM_V_at)echo "Running system tests..."
338 $(AM_V_at)$(top_builddir)/pre-inst-env \
339 $(GUILE) --no-auto-compile \
340 -e '(@@ (run-system-tests) run-system-tests)' \
341 $(top_srcdir)/build-aux/run-system-tests.scm
342
343 # Public key used to sign substitutes from hydra.gnu.org.
344 dist_pkgdata_DATA = hydra.gnu.org.pub
345
346 # Bash completion file.
347 dist_bashcompletion_DATA = etc/completion/bash/guix
348
349 EXTRA_DIST = \
350 HACKING \
351 ROADMAP \
352 TODO \
353 CODE-OF-CONDUCT \
354 .dir-locals.el \
355 build-aux/build-self.scm \
356 build-aux/compile-all.scm \
357 build-aux/hydra/evaluate.scm \
358 build-aux/hydra/gnu-system.scm \
359 build-aux/hydra/demo-os.scm \
360 build-aux/hydra/guix.scm \
361 build-aux/check-available-binaries.scm \
362 build-aux/check-final-inputs-self-contained.scm \
363 build-aux/download.scm \
364 build-aux/make-binary-tarball.scm \
365 build-aux/generate-authors.scm \
366 build-aux/test-driver.scm \
367 build-aux/run-system-tests.scm \
368 srfi/srfi-37.scm.in \
369 srfi/srfi-64.scm \
370 srfi/srfi-64.upstream.scm \
371 tests/test.drv \
372 tests/signing-key.pub \
373 tests/signing-key.sec \
374 tests/cve-sample.xml \
375 build-aux/config.rpath \
376 bootstrap \
377 release.nix \
378 $(TESTS)
379
380 if !BUILD_DAEMON_OFFLOAD
381
382 EXTRA_DIST += \
383 guix/scripts/offload.scm
384
385 endif !BUILD_DAEMON_OFFLOAD
386
387 if !BUILD_SYSCALLS_MODULE
388
389 EXTRA_DIST += \
390 guix/build/syscalls.scm
391
392 endif !BUILD_SYSCALLS_MODULE
393
394
395 CLEANFILES = \
396 $(GOBJECTS) \
397 $(SCM_TESTS:tests/%.scm=%.log)
398
399 # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
400 # $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
401 # there that are newer than the local .scm files (for instance because the
402 # user ran 'make install' recently). When that happens, we end up loading
403 # those previously-installed .go files, which may be stale, thereby breaking
404 # the whole thing.
405 %.go: make-go ; @:
406 make-go: $(MODULES) guix/config.scm guix/tests.scm
407 $(AM_V_at)echo "Compiling Scheme modules..." ; \
408 unset GUILE_LOAD_COMPILED_PATH ; \
409 host=$(host) srcdir="$(top_srcdir)" \
410 $(top_builddir)/pre-inst-env \
411 $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)" \
412 --no-auto-compile \
413 -s "$(top_srcdir)"/build-aux/compile-all.scm $^
414
415 SUFFIXES = .go
416
417 # Make sure source files are installed first, so that the mtime of
418 # installed compiled files is greater than that of installed source
419 # files. See
420 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
421 # for details.
422 guix_install_go_files = install-nobase_nodist_guilemoduleDATA
423 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
424
425 # The above trick doesn't work for 'config.go' because both 'config.scm' and
426 # 'config.go' are listed in $(nobase_nodist_guilemodule_DATA). Thus, give it
427 # special treatment.
428 install-data-hook: set-bootstrap-executable-permissions
429 touch "$(DESTDIR)$(guilemoduledir)/guix/config.go"
430
431
432 SUBDIRS = po/guix po/packages
433 BUILT_SOURCES =
434
435 include doc/local.mk
436
437 if BUILD_DAEMON
438
439 include nix/local.mk
440
441 endif BUILD_DAEMON
442
443 ACLOCAL_AMFLAGS = -I m4
444
445 # Pass an explicit '--localstatedir' so that configure does not error out if
446 # it finds an existing installation with a different localstatedir.
447 AM_DISTCHECK_CONFIGURE_FLAGS = \
448 --localstatedir="$$dc_install_base/var" \
449 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
450 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
451 --with-nix-prefix="$(NIX_PREFIX)" \
452 --enable-daemon
453
454 dist_emacsui_DATA = emacs/guix-main.scm
455 nodist_emacsui_DATA = emacs/guix-helper.scm
456 include emacs/local.mk
457
458 # The self-contained tarball.
459 guix-binary.%.tar.xz:
460 $(AM_V_GEN)GUIX_PACKAGE_PATH= \
461 $(top_builddir)/pre-inst-env "$(GUILE)" \
462 "$(top_srcdir)/build-aux/make-binary-tarball.scm" "$*" "$@"
463
464
465 dist-hook: sync-descriptions gen-ChangeLog gen-AUTHORS
466 dist-hook: assert-no-store-file-names
467
468 distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
469
470 sync-descriptions:
471 $(AM_V_at)GUIX_PACKAGE_PATH= \
472 $(top_builddir)/pre-inst-env guix lint --checkers=gnu-description
473
474 gen-ChangeLog:
475 $(AM_V_GEN)if test -d .git; then \
476 $(top_srcdir)/build-aux/gitlog-to-changelog \
477 > $(distdir)/cl-t; \
478 rm -f $(distdir)/ChangeLog; \
479 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
480 fi
481
482 gen-AUTHORS:
483 $(AM_V_GEN)if test -d .git; then \
484 rm -f "$(distdir)/AUTHORS"; \
485 $(top_builddir)/pre-inst-env "$(GUILE)" \
486 "$(top_srcdir)/build-aux/generate-authors.scm" \
487 "$(top_srcdir)" "$(distdir)/AUTHORS"; \
488 fi
489
490 # Make sure we're not shipping a file that embeds a local /gnu/store file name.
491 assert-no-store-file-names:
492 $(AM_V_at)if grep -r --exclude=*.texi --exclude=*.info \
493 "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
494 then \
495 echo "error: store file names embedded in the distribution" >&2 ; \
496 exit 1 ; \
497 fi
498
499 # Make sure hydra.gnu.org has the important binaries.
500 assert-binaries-available: $(GOBJECTS)
501 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
502 "$(top_srcdir)/build-aux/check-available-binaries.scm"
503
504 # Make sure the final inputs don't refer to bootstrap tools.
505 assert-final-inputs-self-contained: $(GOBJECTS)
506 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
507 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
508
509 # Compute the Hydra jobs and write them in the target file.
510 hydra-jobs.scm: $(GOBJECTS)
511 $(AM_V_at)$(MKDIR_P) "`dirname "$@"`"
512 $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)" \
513 "$(top_srcdir)/build-aux/hydra/evaluate.scm" \
514 "$(top_srcdir)/build-aux/hydra/gnu-system.scm" > "$@.tmp"
515 $(AM_V_at)mv "$@.tmp" "$@"
516
517 .PHONY: sync-descriptions gen-ChangeLog gen-AUTHORS clean-go make-go
518 .PHONY: assert-no-store-file-names assert-binaries-available
519 .PHONY: assert-final-inputs-self-contained
520
521 ## -------------- ##
522 ## Silent rules. ##
523 ## -------------- ##
524
525 AM_V_DL = $(AM_V_DL_$(V))
526 AM_V_DL_ = $(AM_V_DL_$(AM_DEFAULT_VERBOSITY))
527 AM_V_DL_0 = @echo " DL " $@;
528
529 AM_V_DOT = $(AM_V_DOT_$(V))
530 AM_V_DOT_ = $(AM_V_DOT_$(AM_DEFAULT_VERBOSITY))
531 AM_V_DOT_0 = @echo " DOT " $@;
532
533 AM_V_EMACS = $(AM_V_EMACS_$(V))
534 AM_V_EMACS_ = $(AM_V_EMACS_$(AM_DEFAULT_VERBOSITY))
535 AM_V_EMACS_0 = @echo " EMACS " $@;
536
537 AM_V_HELP2MAN = $(AM_V_HELP2MAN_$(V))
538 AM_V_HELP2MAN_ = $(AM_V_HELP2MAN_$(AM_DEFAULT_VERBOSITY))
539 AM_V_HELP2MAN_0 = @echo " HELP2MAN" $@;