substitute: 'http-multiple-get' follows 'fold' style.
[guix.git] / Makefile.am
blob4f90b1d15b5ef127bf8de9b7542ad49506e0f0e3
1 # GNU Guix --- Functional package management for GNU
2 # Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3 # Copyright © 2013 Andreas Enge <andreas@enge.fr>
4 # Copyright © 2015 Alex Kost <alezost@gmail.com>
6 # This file is part of GNU Guix.
8 # GNU Guix is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or (at
11 # your option) any later version.
13 # GNU Guix is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
21 bin_SCRIPTS =                                   \
22   scripts/guix
24 nodist_noinst_SCRIPTS =                         \
25   pre-inst-env                                  \
26   test-env
28 include gnu-system.am
30 MODULES =                                       \
31   guix/base32.scm                               \
32   guix/base64.scm                               \
33   guix/cpio.scm                                 \
34   guix/records.scm                              \
35   guix/gcrypt.scm                               \
36   guix/hash.scm                                 \
37   guix/pk-crypto.scm                            \
38   guix/pki.scm                                  \
39   guix/utils.scm                                \
40   guix/sets.scm                                 \
41   guix/download.scm                             \
42   guix/git-download.scm                         \
43   guix/monads.scm                               \
44   guix/monad-repl.scm                           \
45   guix/gexp.scm                                 \
46   guix/profiles.scm                             \
47   guix/serialization.scm                        \
48   guix/nar.scm                                  \
49   guix/derivations.scm                          \
50   guix/gnu-maintenance.scm                      \
51   guix/upstream.scm                             \
52   guix/licenses.scm                             \
53   guix/build-system.scm                         \
54   guix/build-system/cmake.scm                   \
55   guix/build-system/emacs.scm                   \
56   guix/build-system/glib-or-gtk.scm             \
57   guix/build-system/gnu.scm                     \
58   guix/build-system/haskell.scm                 \
59   guix/build-system/perl.scm                    \
60   guix/build-system/python.scm                  \
61   guix/build-system/waf.scm                     \
62   guix/build-system/r.scm                       \
63   guix/build-system/ruby.scm                    \
64   guix/build-system/trivial.scm                 \
65   guix/ftp-client.scm                           \
66   guix/http-client.scm                          \
67   guix/gnupg.scm                                \
68   guix/elf.scm                                  \
69   guix/store.scm                                \
70   guix/cvs-download.scm                         \
71   guix/svn-download.scm                         \
72   guix/ui.scm                                   \
73   guix/build/download.scm                       \
74   guix/build/cmake-build-system.scm             \
75   guix/build/emacs-build-system.scm             \
76   guix/build/git.scm                            \
77   guix/build/glib-or-gtk-build-system.scm       \
78   guix/build/gnu-build-system.scm               \
79   guix/build/gnu-dist.scm                       \
80   guix/build/perl-build-system.scm              \
81   guix/build/python-build-system.scm            \
82   guix/build/r-build-system.scm                 \
83   guix/build/ruby-build-system.scm              \
84   guix/build/waf-build-system.scm               \
85   guix/build/haskell-build-system.scm           \
86   guix/build/store-copy.scm                     \
87   guix/build/utils.scm                          \
88   guix/build/union.scm                          \
89   guix/build/profiles.scm                       \
90   guix/build/pull.scm                           \
91   guix/build/rpath.scm                          \
92   guix/build/cvs.scm                            \
93   guix/build/svn.scm                            \
94   guix/build/gremlin.scm                        \
95   guix/build/emacs-utils.scm                    \
96   guix/build/graft.scm                          \
97   guix/search-paths.scm                         \
98   guix/packages.scm                             \
99   guix/import/utils.scm                         \
100   guix/import/gnu.scm                           \
101   guix/import/snix.scm                          \
102   guix/import/cabal.scm                         \
103   guix/import/cran.scm                          \
104   guix/import/hackage.scm                       \
105   guix/import/elpa.scm                          \
106   guix/scripts.scm                              \
107   guix/scripts/download.scm                     \
108   guix/scripts/build.scm                        \
109   guix/scripts/archive.scm                      \
110   guix/scripts/import.scm                       \
111   guix/scripts/package.scm                      \
112   guix/scripts/gc.scm                           \
113   guix/scripts/hash.scm                         \
114   guix/scripts/pull.scm                         \
115   guix/scripts/substitute.scm                   \
116   guix/scripts/authenticate.scm                 \
117   guix/scripts/refresh.scm                      \
118   guix/scripts/system.scm                       \
119   guix/scripts/lint.scm                         \
120   guix/scripts/challenge.scm                    \
121   guix/scripts/import/cran.scm                  \
122   guix/scripts/import/gnu.scm                   \
123   guix/scripts/import/nix.scm                   \
124   guix/scripts/import/hackage.scm               \
125   guix/scripts/import/elpa.scm                  \
126   guix/scripts/environment.scm                  \
127   guix/scripts/publish.scm                      \
128   guix/scripts/edit.scm                         \
129   guix/scripts/size.scm                         \
130   guix/scripts/graph.scm                        \
131   guix.scm                                      \
132   $(GNU_SYSTEM_MODULES)
134 if BUILD_SYSCALLS_MODULE
136 MODULES +=                                      \
137   guix/build/syscalls.scm
139 endif
141 if BUILD_DAEMON_OFFLOAD
143 MODULES +=                                      \
144   guix/scripts/offload.scm
146 endif BUILD_DAEMON_OFFLOAD
148 # Internal module with test suite support.
149 dist_noinst_DATA = guix/tests.scm
151 # Because of the autoload hack in (guix build download), we must build it
152 # first to avoid errors on systems where (gnutls) is unavailable.
153 guix/scripts/download.go: guix/build/download.go
154 guix/download.go: guix/build/download.go
156 # Linux-Libre configurations.
157 KCONFIGS =                                      \
158   gnu/packages/linux-libre-i686.conf            \
159   gnu/packages/linux-libre-x86_64.conf
161 # Templates, examples.
162 EXAMPLES =                                      \
163   gnu/system/examples/bare-bones.tmpl           \
164   gnu/system/examples/desktop.tmpl
166 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go guix/tests.go
168 nobase_dist_guilemodule_DATA =                  \
169   $(MODULES) $(KCONFIGS) $(EXAMPLES)            \
170   $(MISC_DISTRO_FILES)
171 nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
173 # Do we need to provide our own non-broken (srfi srfi-37) module?
174 if INSTALL_SRFI_37
176 nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
177 GOBJECTS += srfi/srfi-37.go
179 srfi/srfi-37.scm: srfi/srfi-37.scm.in
180         $(MKDIR_P) srfi
181         cp "$<" "$@"
183 endif INSTALL_SRFI_37
185 # Handy way to remove the .go files without removing all the rest.
186 clean-go:
187         -$(RM) -f $(GOBJECTS)
190 SCM_TESTS =                                     \
191   tests/base32.scm                              \
192   tests/base64.scm                              \
193   tests/cpio.scm                                \
194   tests/hash.scm                                \
195   tests/pk-crypto.scm                           \
196   tests/pki.scm                                 \
197   tests/sets.scm                                \
198   tests/substitute.scm                          \
199   tests/builders.scm                            \
200   tests/derivations.scm                         \
201   tests/ui.scm                                  \
202   tests/records.scm                             \
203   tests/utils.scm                               \
204   tests/build-utils.scm                         \
205   tests/packages.scm                            \
206   tests/snix.scm                                \
207   tests/hackage.scm                             \
208   tests/cran.scm                                \
209   tests/elpa.scm                                \
210   tests/store.scm                               \
211   tests/monads.scm                              \
212   tests/gexp.scm                                \
213   tests/nar.scm                                 \
214   tests/union.scm                               \
215   tests/profiles.scm                            \
216   tests/syscalls.scm                            \
217   tests/gremlin.scm                             \
218   tests/lint.scm                                \
219   tests/publish.scm                             \
220   tests/scripts.scm                             \
221   tests/size.scm                                \
222   tests/graph.scm                               \
223   tests/challenge.scm                           \
224   tests/file-systems.scm                        \
225   tests/services.scm                            \
226   tests/containers.scm
228 if HAVE_GUILE_JSON
230 MODULES +=                                      \
231   guix/import/json.scm                          \
232   guix/import/pypi.scm                          \
233   guix/scripts/import/pypi.scm                  \
234   guix/import/cpan.scm                          \
235   guix/scripts/import/gem.scm                   \
236   guix/import/gem.scm
238 SCM_TESTS +=                                    \
239   tests/pypi.scm                                \
240   tests/cpan.scm                                \
241   tests/gem.scm
243 endif
245 SH_TESTS =                                      \
246   tests/guix-build.sh                           \
247   tests/guix-download.sh                        \
248   tests/guix-gc.sh                              \
249   tests/guix-hash.sh                            \
250   tests/guix-package.sh                         \
251   tests/guix-package-net.sh                     \
252   tests/guix-system.sh                          \
253   tests/guix-archive.sh                         \
254   tests/guix-authenticate.sh                    \
255   tests/guix-environment.sh                     \
256   tests/guix-environment-container.sh           \
257   tests/guix-graph.sh                           \
258   tests/guix-lint.sh
260 if BUILD_DAEMON
262 SH_TESTS += tests/guix-register.sh
264 endif BUILD_DAEMON
267 TESTS = $(SCM_TESTS) $(SH_TESTS)
269 TEST_EXTENSIONS = .scm .sh
271 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
273 SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE)
274 AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)"
276 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
277 AM_SH_LOG_FLAGS = -x -e
279 # Make sure `tests/guix-gc.sh' runs last, after all the others.  Otherwise it
280 # could end up removing files from the store while they are being used by
281 # other instances of the daemon.
282 tests/guix-gc.log:                                                      \
283   $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS)))     \
284   $(SCM_TESTS:%.scm=%.log)
286 # Public key used to sign substitutes from hydra.gnu.org.
287 dist_pkgdata_DATA = hydra.gnu.org.pub
289 # Bash completion file.
290 dist_bashcompletion_DATA = etc/completion/bash/guix
292 EXTRA_DIST =                                            \
293   HACKING                                               \
294   ROADMAP                                               \
295   TODO                                                  \
296   .dir-locals.el                                        \
297   build-aux/build-self.scm                              \
298   build-aux/hydra/gnu-system.scm                        \
299   build-aux/hydra/demo-os.scm                           \
300   build-aux/hydra/guix.scm                              \
301   build-aux/check-available-binaries.scm                \
302   build-aux/check-final-inputs-self-contained.scm       \
303   build-aux/download.scm                                \
304   build-aux/make-binary-tarball.scm                     \
305   build-aux/generate-authors.scm                        \
306   srfi/srfi-37.scm.in                                   \
307   srfi/srfi-64.scm                                      \
308   srfi/srfi-64.upstream.scm                             \
309   tests/test.drv                                        \
310   tests/signing-key.pub                                 \
311   tests/signing-key.sec                                 \
312   build-aux/config.rpath                                \
313   bootstrap                                             \
314   release.nix                                           \
315   $(TESTS)
317 if !BUILD_DAEMON_OFFLOAD
319 EXTRA_DIST +=                                   \
320   guix/scripts/offload.scm
322 endif !BUILD_DAEMON_OFFLOAD
324 if !BUILD_SYSCALLS_MODULE
326 EXTRA_DIST +=                                   \
327   guix/build/syscalls.scm
329 endif !BUILD_SYSCALLS_MODULE
332 CLEANFILES =                                    \
333   $(GOBJECTS)                                   \
334   $(SCM_TESTS:tests/%.scm=%.log)
336 AM_V_GUILEC = $(AM_V_GUILEC_$(V))
337 AM_V_GUILEC_ = $(AM_V_GUILEC_$(AM_DEFAULT_VERBOSITY))
338 AM_V_GUILEC_0 = @echo "  GUILEC" $@;
340 # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling.  Otherwise, if
341 # $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
342 # there that are newer than the local .scm files (for instance because the
343 # user ran 'make install' recently).  When that happens, we end up loading
344 # those previously-installed .go files, which may be stale, thereby breaking
345 # the whole thing.
347 # XXX: Use the C locale for when Guile lacks
348 # <http://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f>.
349 .scm.go:
350         $(AM_V_GUILEC)$(MKDIR_P) `dirname "$@"` ;                       \
351         unset GUILE_LOAD_COMPILED_PATH ;                                \
352         LC_ALL=C                                                        \
353         $(top_builddir)/pre-inst-env                                    \
354         $(GUILD) compile -L "$(top_builddir)" -L "$(top_srcdir)"        \
355           -Wformat -Wunbound-variable -Warity-mismatch                  \
356           --target="$(host)"                                            \
357           -o "$@" "$<"
359 SUFFIXES = .go
361 # Make sure source files are installed first, so that the mtime of
362 # installed compiled files is greater than that of installed source
363 # files.  See
364 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
365 # for details.
366 guix_install_go_files = install-nobase_nodist_guilemoduleDATA
367 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
369 # The above trick doesn't work for 'config.go' because both 'config.scm' and
370 # 'config.go' are listed in $(nobase_nodist_guilemodule_DATA).  Thus, give it
371 # special treatment.
372 install-data-hook: set-bootstrap-executable-permissions
373         touch "$(DESTDIR)$(guilemoduledir)/guix/config.go"
376 SUBDIRS = po/guix po/packages
377 BUILT_SOURCES =
379 include doc.am
381 if BUILD_DAEMON
383 include daemon.am
385 endif BUILD_DAEMON
387 ACLOCAL_AMFLAGS = -I m4
388 AM_DISTCHECK_CONFIGURE_FLAGS =                  \
389   --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
390   --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
391   --with-nix-prefix="$(NIX_PREFIX)"             \
392   --enable-daemon
394 dist_emacsui_DATA = emacs/guix-main.scm
395 nodist_emacsui_DATA = emacs/guix-helper.scm
396 include emacs.am
398 # The self-contained tarball.
399 guix-binary.%.tar.xz:
400         -GUIX_PACKAGE_PATH= \
401         $(top_builddir)/pre-inst-env "$(GUILE)"                 \
402           "$(top_srcdir)/build-aux/make-binary-tarball.scm" "$*" "$@"
405 dist-hook: sync-descriptions gen-ChangeLog gen-AUTHORS
406 dist-hook: assert-no-store-file-names
408 distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
410 sync-descriptions:
411         -GUIX_PACKAGE_PATH= \
412          $(top_builddir)/pre-inst-env guix lint --checkers=gnu-description
414 gen-ChangeLog:
415         if test -d .git; then                           \
416           $(top_srcdir)/build-aux/gitlog-to-changelog   \
417             > $(distdir)/cl-t;                          \
418           rm -f $(distdir)/ChangeLog;                   \
419           mv $(distdir)/cl-t $(distdir)/ChangeLog;      \
420         fi
422 gen-AUTHORS:
423         if test -d .git; then                                   \
424           rm -f "$(distdir)/AUTHORS";                           \
425           $(top_builddir)/pre-inst-env "$(GUILE)"               \
426             "$(top_srcdir)/build-aux/generate-authors.scm"      \
427             "$(top_srcdir)" "$(distdir)/AUTHORS";               \
428         fi
430 # Make sure we're not shipping a file that embeds a local /gnu/store file name.
431 assert-no-store-file-names:
432         if grep -r --exclude=*.texi --exclude=*.info                            \
433              "$(storedir)/[a-z0-9]{32}-" $(distdir) ;                           \
434         then                                                                    \
435           echo "error: store file names embedded in the distribution" >&2 ;     \
436           exit 1 ;                                                              \
437         fi
439 # Make sure hydra.gnu.org has the important binaries.
440 assert-binaries-available:
441         $(top_builddir)/pre-inst-env "$(GUILE)"                         \
442           "$(top_srcdir)/build-aux/check-available-binaries.scm"
444 # Make sure the final inputs don't refer to bootstrap tools.
445 assert-final-inputs-self-contained:
446         $(top_builddir)/pre-inst-env "$(GUILE)"                         \
447           "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
449 .PHONY: sync-descriptions gen-ChangeLog gen-AUTHORS clean-go
450 .PHONY: assert-no-store-file-names assert-binaries-available
451 .PHONY: assert-final-inputs-self-contained