build: Add 'EMACS' silent rule.
[jackhill/guix/guix.git] / Makefile.am
CommitLineData
233e7676 1# GNU Guix --- Functional package management for GNU
bb251307 2# Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
f2499672 3# Copyright © 2013 Andreas Enge <andreas@enge.fr>
a8ac45b1 4# Copyright © 2015 Alex Kost <alezost@gmail.com>
8c3d8894 5# Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
af51c820 6#
233e7676 7# This file is part of GNU Guix.
af51c820 8#
233e7676 9# GNU Guix is free software; you can redistribute it and/or modify it
af51c820
LC
10# under the terms of the GNU General Public License as published by
11# the Free Software Foundation; either version 3 of the License, or (at
12# your option) any later version.
13#
233e7676 14# GNU Guix is distributed in the hope that it will be useful, but
af51c820
LC
15# WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
233e7676 20# along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
af51c820 21
c52a5bf0 22bin_SCRIPTS = \
e49951eb 23 scripts/guix
14a1c319 24
58867ae7
MW
25nodist_noinst_SCRIPTS = \
26 pre-inst-env \
27 test-env
28
d516736c
LC
29include gnu-system.am
30
af51c820 31MODULES = \
ddc29a78 32 guix/base32.scm \
e9c6c584 33 guix/base64.scm \
7a18c3cc 34 guix/cpio.scm \
c0cd1b3e 35 guix/records.scm \
4862bc4a 36 guix/gcrypt.scm \
72626a71 37 guix/hash.scm \
3476ded9 38 guix/pk-crypto.scm \
8b420f74 39 guix/pki.scm \
73fbb904 40 guix/utils.scm \
d326767e 41 guix/sets.scm \
de1355f1 42 guix/download.scm \
9b5b5c17 43 guix/git-download.scm \
b860f382 44 guix/monads.scm \
b9b86078 45 guix/monad-repl.scm \
21b679f6 46 guix/gexp.scm \
cc4ecc2d 47 guix/profiles.scm \
0f41c26f
LC
48 guix/serialization.scm \
49 guix/nar.scm \
af51c820 50 guix/derivations.scm \
22189ed1 51 guix/gnu-maintenance.scm \
0a7c5a09 52 guix/upstream.scm \
838d78e3 53 guix/licenses.scm \
8fb58371 54 guix/graph.scm \
0eef7551 55 guix/cve.scm \
208f7cd1 56 guix/build-system.scm \
c6bded8a 57 guix/build-system/cmake.scm \
e9137a53 58 guix/build-system/emacs.scm \
be3425e5 59 guix/build-system/glib-or-gtk.scm \
208f7cd1 60 guix/build-system/gnu.scm \
ce6fc7d6 61 guix/build-system/haskell.scm \
08fd1ebe 62 guix/build-system/perl.scm \
40506d5d 63 guix/build-system/python.scm \
a677c726 64 guix/build-system/waf.scm \
f8f3bef6 65 guix/build-system/r.scm \
c08f9818 66 guix/build-system/ruby.scm \
be13fbfa 67 guix/build-system/trivial.scm \
457dd86d 68 guix/ftp-client.scm \
3b8258c5 69 guix/http-client.scm \
0fdd3bea 70 guix/gnupg.scm \
d5d16686 71 guix/elf.scm \
af51c820 72 guix/store.scm \
89328d24 73 guix/cvs-download.scm \
b3acf365 74 guix/svn-download.scm \
073c34d7 75 guix/ui.scm \
62cab99c 76 guix/build/download.scm \
c6bded8a 77 guix/build/cmake-build-system.scm \
e9137a53 78 guix/build/emacs-build-system.scm \
9b5b5c17 79 guix/build/git.scm \
be3425e5 80 guix/build/glib-or-gtk-build-system.scm \
af51c820 81 guix/build/gnu-build-system.scm \
fe12c345 82 guix/build/gnu-dist.scm \
08fd1ebe 83 guix/build/perl-build-system.scm \
40506d5d 84 guix/build/python-build-system.scm \
f8f3bef6 85 guix/build/r-build-system.scm \
c08f9818 86 guix/build/ruby-build-system.scm \
a677c726 87 guix/build/waf-build-system.scm \
9fd6c2ba 88 guix/build/haskell-build-system.scm \
6fd1a796 89 guix/build/store-copy.scm \
1273d44a 90 guix/build/utils.scm \
c8c88afa 91 guix/build/union.scm \
611adb1e 92 guix/build/profiles.scm \
3dbeecd2 93 guix/build/pull.scm \
3309e3a1 94 guix/build/rpath.scm \
89328d24 95 guix/build/cvs.scm \
b3acf365 96 guix/build/svn.scm \
15aa2c38 97 guix/build/gremlin.scm \
75f3b1a1 98 guix/build/emacs-utils.scm \
fb59e275 99 guix/build/graft.scm \
e89431bf 100 guix/search-paths.scm \
e3ce5d70 101 guix/packages.scm \
1b3e9685 102 guix/import/utils.scm \
7047133f 103 guix/import/gnu.scm \
1b3e9685 104 guix/import/snix.scm \
a4154748 105 guix/import/cabal.scm \
e1248602 106 guix/import/cran.scm \
a4154748 107 guix/import/hackage.scm \
7f74a931 108 guix/import/elpa.scm \
88981dd3 109 guix/scripts.scm \
de1355f1
LC
110 guix/scripts/download.scm \
111 guix/scripts/build.scm \
760c60d6 112 guix/scripts/archive.scm \
de1355f1
LC
113 guix/scripts/import.scm \
114 guix/scripts/package.scm \
115 guix/scripts/gc.scm \
116 guix/scripts/hash.scm \
117 guix/scripts/pull.scm \
2c74fde0 118 guix/scripts/substitute.scm \
526382ff 119 guix/scripts/authenticate.scm \
de1355f1 120 guix/scripts/refresh.scm \
523e4896 121 guix/scripts/system.scm \
b4f5e0e8 122 guix/scripts/lint.scm \
d23c20f1 123 guix/scripts/challenge.scm \
e1248602 124 guix/scripts/import/cran.scm \
7047133f 125 guix/scripts/import/gnu.scm \
1b3e9685 126 guix/scripts/import/nix.scm \
a4154748 127 guix/scripts/import/hackage.scm \
7f74a931 128 guix/scripts/import/elpa.scm \
372c4bbc 129 guix/scripts/environment.scm \
aff8ce7c 130 guix/scripts/publish.scm \
39bee8a2 131 guix/scripts/edit.scm \
fcc58db6 132 guix/scripts/size.scm \
88856916 133 guix/scripts/graph.scm \
32efa254
DT
134 guix/scripts/container.scm \
135 guix/scripts/container/exec.scm \
e3ce5d70 136 guix.scm \
d516736c 137 $(GNU_SYSTEM_MODULES)
af51c820 138
bb251307
LC
139if HAVE_GUILE_JSON
140
141MODULES += \
142 guix/import/json.scm \
143 guix/import/pypi.scm \
144 guix/scripts/import/pypi.scm \
145 guix/import/cpan.scm \
146 guix/scripts/import/gem.scm \
147 guix/import/gem.scm
148
149endif
150
12e5b266
LC
151if BUILD_SYSCALLS_MODULE
152
153MODULES += \
154 guix/build/syscalls.scm
155
156endif
157
49e6291a
LC
158if BUILD_DAEMON_OFFLOAD
159
160MODULES += \
161 guix/scripts/offload.scm
162
163endif BUILD_DAEMON_OFFLOAD
164
c1bc358f 165# Internal module with test suite support.
02754a5e 166dist_noinst_DATA = guix/tests.scm
c1bc358f 167
a94546ec
LC
168# Linux-Libre configurations.
169KCONFIGS = \
170 gnu/packages/linux-libre-i686.conf \
171 gnu/packages/linux-libre-x86_64.conf
1959fb04 172
ebc32b31
LC
173# Templates, examples.
174EXAMPLES = \
36ffaca2
LC
175 gnu/system/examples/bare-bones.tmpl \
176 gnu/system/examples/desktop.tmpl
ebc32b31 177
c1bc358f 178GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go guix/tests.go
af51c820 179
74574fd1
RW
180nobase_dist_guilemodule_DATA = \
181 $(MODULES) $(KCONFIGS) $(EXAMPLES) \
182 $(MISC_DISTRO_FILES)
1959fb04 183nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
800cdeef 184
1959fb04
LC
185# Do we need to provide our own non-broken (srfi srfi-37) module?
186if INSTALL_SRFI_37
187
188nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
189GOBJECTS += srfi/srfi-37.go
190
191srfi/srfi-37.scm: srfi/srfi-37.scm.in
192 $(MKDIR_P) srfi
193 cp "$<" "$@"
194
195endif INSTALL_SRFI_37
ac5aa288 196
70a9c720
LC
197# Handy way to remove the .go files without removing all the rest.
198clean-go:
199 -$(RM) -f $(GOBJECTS)
200
af51c820 201
bb251307
LC
202# Test extensions; has to be unconditional.
203TEST_EXTENSIONS = .scm .sh
204
205if CAN_RUN_TESTS
206
30dd8310 207SCM_TESTS = \
ddc29a78 208 tests/base32.scm \
e9c6c584 209 tests/base64.scm \
7a18c3cc 210 tests/cpio.scm \
69927e78 211 tests/hash.scm \
3476ded9 212 tests/pk-crypto.scm \
8b420f74 213 tests/pki.scm \
d326767e 214 tests/sets.scm \
202440e0 215 tests/gnu-maintenance.scm \
2c74fde0 216 tests/substitute.scm \
af51c820
LC
217 tests/builders.scm \
218 tests/derivations.scm \
299112d3 219 tests/ui.scm \
c0cd1b3e 220 tests/records.scm \
e3ce5d70 221 tests/utils.scm \
b0e0d0e9 222 tests/build-utils.scm \
c8c88afa 223 tests/packages.scm \
10226c05 224 tests/snix.scm \
a4154748 225 tests/hackage.scm \
e1248602 226 tests/cran.scm \
7f74a931 227 tests/elpa.scm \
3259877d 228 tests/store.scm \
b860f382 229 tests/monads.scm \
21b679f6 230 tests/gexp.scm \
53c63ee9 231 tests/nar.scm \
a2078770 232 tests/union.scm \
29fa45f4 233 tests/profiles.scm \
b4f5e0e8 234 tests/syscalls.scm \
15aa2c38 235 tests/gremlin.scm \
aff8ce7c 236 tests/lint.scm \
fcc58db6 237 tests/publish.scm \
88981dd3 238 tests/scripts.scm \
c1f6a0c2 239 tests/size.scm \
88856916 240 tests/graph.scm \
d23c20f1 241 tests/challenge.scm \
0eef7551 242 tests/cve.scm \
661a1d79 243 tests/file-systems.scm \
6b779207 244 tests/system.scm \
0adfe95a 245 tests/services.scm \
a132f7d6
BW
246 tests/containers.scm \
247 tests/import-utils.scm
30dd8310 248
1b3e9685
DT
249if HAVE_GUILE_JSON
250
d45dc6da
EB
251SCM_TESTS += \
252 tests/pypi.scm \
a96524cc
DT
253 tests/cpan.scm \
254 tests/gem.scm
1b3e9685
DT
255
256endif
257
30dd8310 258SH_TESTS = \
0afdc485 259 tests/guix-build.sh \
37d19403 260 tests/guix-download.sh \
fe8ff028 261 tests/guix-gc.sh \
ccbce848 262 tests/guix-hash.sh \
0820098d 263 tests/guix-package.sh \
57b86237 264 tests/guix-package-net.sh \
c1202fb1 265 tests/guix-system.sh \
760c60d6 266 tests/guix-archive.sh \
dd7c013d 267 tests/guix-authenticate.sh \
cad25264 268 tests/guix-environment.sh \
f535dcbe 269 tests/guix-environment-container.sh \
88856916 270 tests/guix-graph.sh \
dd7c013d 271 tests/guix-lint.sh
af51c820 272
a7a4e6a4
LC
273if BUILD_DAEMON
274
275SH_TESTS += tests/guix-register.sh
276
277endif BUILD_DAEMON
278
279
30dd8310
LC
280TESTS = $(SCM_TESTS) $(SH_TESTS)
281
352ec143
LC
282AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
283
69cfce50 284SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE)
97298ffa
LC
285AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)"
286
69cfce50 287SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
97298ffa 288AM_SH_LOG_FLAGS = -x -e
af51c820 289
3a33730a
LC
290# Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
291# could end up removing files from the store while they are being used by
292# other instances of the daemon.
293tests/guix-gc.log: \
294 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
295 $(SCM_TESTS:%.scm=%.log)
296
bb251307
LC
297else !CAN_RUN_TESTS
298
299TESTS =
300SH_TESTS =
301SCM_TESTS =
302
303# Automake always generates a 'check' target, so better not override it.
304check-local:
305 @echo
306 @echo "Cannot run tests because file name limits would be exceeded." >&2
307 @echo "Look for 'length' in the 'config.log' file for details." >&2
308 @echo
309 @exit 1
310
311endif !CAN_RUN_TESTS
312
bf59c06d 313# Public key used to sign substitutes from hydra.gnu.org.
6c110833 314dist_pkgdata_DATA = hydra.gnu.org.pub
3a33730a 315
ee3e157d
LC
316# Bash completion file.
317dist_bashcompletion_DATA = etc/completion/bash/guix
318
81f61c17
LC
319EXTRA_DIST = \
320 HACKING \
321 ROADMAP \
322 TODO \
e15fcdd1 323 CODE-OF-CONDUCT \
81f61c17 324 .dir-locals.el \
f81ac34d 325 build-aux/build-self.scm \
de6af327 326 build-aux/compile-all.scm \
81f61c17
LC
327 build-aux/hydra/gnu-system.scm \
328 build-aux/hydra/demo-os.scm \
329 build-aux/hydra/guix.scm \
330 build-aux/check-available-binaries.scm \
331 build-aux/check-final-inputs-self-contained.scm \
332 build-aux/download.scm \
8bc35f85 333 build-aux/make-binary-tarball.scm \
1c2ae810 334 build-aux/generate-authors.scm \
81f61c17
LC
335 srfi/srfi-37.scm.in \
336 srfi/srfi-64.scm \
337 srfi/srfi-64.upstream.scm \
338 tests/test.drv \
339 tests/signing-key.pub \
340 tests/signing-key.sec \
0eef7551 341 tests/cve-sample.xml \
81f61c17
LC
342 build-aux/config.rpath \
343 bootstrap \
344 release.nix \
ed795c06 345 $(TESTS)
d7672884 346
49e6291a
LC
347if !BUILD_DAEMON_OFFLOAD
348
349EXTRA_DIST += \
350 guix/scripts/offload.scm
351
352endif !BUILD_DAEMON_OFFLOAD
353
12e5b266
LC
354if !BUILD_SYSCALLS_MODULE
355
356EXTRA_DIST += \
357 guix/build/syscalls.scm
358
359endif !BUILD_SYSCALLS_MODULE
360
49e6291a 361
30dd8310
LC
362CLEANFILES = \
363 $(GOBJECTS) \
9bff16b3 364 $(SCM_TESTS:tests/%.scm=%.log)
af51c820 365
28561d85
LC
366# Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
367# $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
368# there that are newer than the local .scm files (for instance because the
369# user ran 'make install' recently). When that happens, we end up loading
370# those previously-installed .go files, which may be stale, thereby breaking
371# the whole thing.
de6af327
TUBK
372%.go: make-go ; @:
373make-go: $(MODULES) guix/config.scm guix/tests.scm
374 $(AM_V_at)echo "Compiling Scheme modules..." ; \
28561d85 375 unset GUILE_LOAD_COMPILED_PATH ; \
de6af327 376 host=$(host) srcdir="$(top_srcdir)" \
671d8f5e 377 $(top_builddir)/pre-inst-env \
de6af327
TUBK
378 $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)" \
379 --no-auto-compile \
380 -s "$(top_srcdir)"/build-aux/compile-all.scm $^
af51c820
LC
381
382SUFFIXES = .go
383
384# Make sure source files are installed first, so that the mtime of
385# installed compiled files is greater than that of installed source
386# files. See
387# <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
388# for details.
389guix_install_go_files = install-nobase_nodist_guilemoduleDATA
390$(guix_install_go_files): install-nobase_dist_guilemoduleDATA
f68b0893 391
6005bd07
LC
392# The above trick doesn't work for 'config.go' because both 'config.scm' and
393# 'config.go' are listed in $(nobase_nodist_guilemodule_DATA). Thus, give it
394# special treatment.
395install-data-hook: set-bootstrap-executable-permissions
396 touch "$(DESTDIR)$(guilemoduledir)/guix/config.go"
397
398
ee764179 399SUBDIRS = po/guix po/packages
931c132a 400BUILT_SOURCES =
a9424c08
LC
401
402include doc.am
568717fd 403
c2033df4
LC
404if BUILD_DAEMON
405
406include daemon.am
407
408endif BUILD_DAEMON
409
f68b0893 410ACLOCAL_AMFLAGS = -I m4
e76bdf8b 411AM_DISTCHECK_CONFIGURE_FLAGS = \
d388c2c4 412 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
14af289e 413 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
aca54b39
LC
414 --with-nix-prefix="$(NIX_PREFIX)" \
415 --enable-daemon
0e993428 416
457f60fa
AK
417dist_emacsui_DATA = emacs/guix-main.scm
418nodist_emacsui_DATA = emacs/guix-helper.scm
419include emacs.am
420
9d3fb6c7
LC
421# The self-contained tarball.
422guix-binary.%.tar.xz:
423 -GUIX_PACKAGE_PATH= \
424 $(top_builddir)/pre-inst-env "$(GUILE)" \
425 "$(top_srcdir)/build-aux/make-binary-tarball.scm" "$*" "$@"
426
427
a8ac45b1
AK
428dist-hook: sync-descriptions gen-ChangeLog gen-AUTHORS
429dist-hook: assert-no-store-file-names
430
81f61c17 431distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
e793178a 432
668d48a6 433sync-descriptions:
36c45230
LC
434 -GUIX_PACKAGE_PATH= \
435 $(top_builddir)/pre-inst-env guix lint --checkers=gnu-description
e793178a
LC
436
437gen-ChangeLog:
438 if test -d .git; then \
439 $(top_srcdir)/build-aux/gitlog-to-changelog \
440 > $(distdir)/cl-t; \
441 rm -f $(distdir)/ChangeLog; \
442 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
443 fi
444
a8ac45b1 445gen-AUTHORS:
ac140f79
LC
446 if test -d .git; then \
447 rm -f "$(distdir)/AUTHORS"; \
448 $(top_builddir)/pre-inst-env "$(GUILE)" \
449 "$(top_srcdir)/build-aux/generate-authors.scm" \
450 "$(top_srcdir)" "$(distdir)/AUTHORS"; \
451 fi
a8ac45b1 452
834129e0 453# Make sure we're not shipping a file that embeds a local /gnu/store file name.
a463ffd9
LC
454assert-no-store-file-names:
455 if grep -r --exclude=*.texi --exclude=*.info \
456 "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
457 then \
458 echo "error: store file names embedded in the distribution" >&2 ; \
459 exit 1 ; \
460 fi
461
56fbf262
LC
462# Make sure hydra.gnu.org has the important binaries.
463assert-binaries-available:
464 $(top_builddir)/pre-inst-env "$(GUILE)" \
465 "$(top_srcdir)/build-aux/check-available-binaries.scm"
466
81f61c17
LC
467# Make sure the final inputs don't refer to bootstrap tools.
468assert-final-inputs-self-contained:
469 $(top_builddir)/pre-inst-env "$(GUILE)" \
470 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
471
de6af327 472.PHONY: sync-descriptions gen-ChangeLog gen-AUTHORS clean-go make-go
56fbf262 473.PHONY: assert-no-store-file-names assert-binaries-available
81f61c17 474.PHONY: assert-final-inputs-self-contained
8c3d8894
ML
475
476## -------------- ##
477## Silent rules. ##
478## -------------- ##
479
480AM_V_DL = $(AM_V_DL_$(V))
481AM_V_DL_ = $(AM_V_DL_$(AM_DEFAULT_VERBOSITY))
482AM_V_DL_0 = @echo " DL " $@;
4c48878d
ML
483
484AM_V_DOT = $(AM_V_DOT_$(V))
485AM_V_DOT_ = $(AM_V_DOT_$(AM_DEFAULT_VERBOSITY))
486AM_V_DOT_0 = @echo " DOT " $@;
71ed439b
ML
487
488AM_V_EMACS = $(AM_V_EMACS_$(V))
489AM_V_EMACS_ = $(AM_V_EMACS_$(AM_DEFAULT_VERBOSITY))
490AM_V_EMACS_0 = @echo " EMACS " $@;