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