search-paths: Export 'string-tokenize*'.
[guix.git] / Makefile.am
blobae694eb0e70f48a18eb08b6b70d5dade09d8a641
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>
5 # This file is part of GNU Guix.
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.
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.
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/>.
20 bin_SCRIPTS =                                   \
21   scripts/guix
23 nodist_noinst_SCRIPTS =                         \
24   pre-inst-env                                  \
25   test-env
27 include gnu-system.am
29 MODULES =                                       \
30   guix/base32.scm                               \
31   guix/base64.scm                               \
32   guix/records.scm                              \
33   guix/gcrypt.scm                               \
34   guix/hash.scm                                 \
35   guix/pk-crypto.scm                            \
36   guix/pki.scm                                  \
37   guix/utils.scm                                \
38   guix/sets.scm                                 \
39   guix/download.scm                             \
40   guix/git-download.scm                         \
41   guix/monads.scm                               \
42   guix/monad-repl.scm                           \
43   guix/gexp.scm                                 \
44   guix/profiles.scm                             \
45   guix/serialization.scm                        \
46   guix/nar.scm                                  \
47   guix/derivations.scm                          \
48   guix/gnu-maintenance.scm                      \
49   guix/licenses.scm                             \
50   guix/build-system.scm                         \
51   guix/build-system/cmake.scm                   \
52   guix/build-system/glib-or-gtk.scm             \
53   guix/build-system/gnu.scm                     \
54   guix/build-system/haskell.scm                 \
55   guix/build-system/perl.scm                    \
56   guix/build-system/python.scm                  \
57   guix/build-system/waf.scm                     \
58   guix/build-system/ruby.scm                    \
59   guix/build-system/trivial.scm                 \
60   guix/ftp-client.scm                           \
61   guix/http-client.scm                          \
62   guix/gnupg.scm                                \
63   guix/elf.scm                                  \
64   guix/store.scm                                \
65   guix/cvs-download.scm                         \
66   guix/svn-download.scm                         \
67   guix/ui.scm                                   \
68   guix/build/download.scm                       \
69   guix/build/cmake-build-system.scm             \
70   guix/build/git.scm                            \
71   guix/build/glib-or-gtk-build-system.scm       \
72   guix/build/gnu-build-system.scm               \
73   guix/build/gnu-dist.scm                       \
74   guix/build/perl-build-system.scm              \
75   guix/build/python-build-system.scm            \
76   guix/build/ruby-build-system.scm              \
77   guix/build/waf-build-system.scm               \
78   guix/build/haskell-build-system.scm           \
79   guix/build/store-copy.scm                     \
80   guix/build/utils.scm                          \
81   guix/build/union.scm                          \
82   guix/build/pull.scm                           \
83   guix/build/rpath.scm                          \
84   guix/build/cvs.scm                            \
85   guix/build/svn.scm                            \
86   guix/build/syscalls.scm                       \
87   guix/build/gremlin.scm                        \
88   guix/build/emacs-utils.scm                    \
89   guix/build/graft.scm                          \
90   guix/search-paths.scm                         \
91   guix/packages.scm                             \
92   guix/import/utils.scm                         \
93   guix/import/gnu.scm                           \
94   guix/import/snix.scm                          \
95   guix/scripts/download.scm                     \
96   guix/scripts/build.scm                        \
97   guix/scripts/archive.scm                      \
98   guix/scripts/import.scm                       \
99   guix/scripts/package.scm                      \
100   guix/scripts/gc.scm                           \
101   guix/scripts/hash.scm                         \
102   guix/scripts/pull.scm                         \
103   guix/scripts/substitute.scm                   \
104   guix/scripts/authenticate.scm                 \
105   guix/scripts/refresh.scm                      \
106   guix/scripts/system.scm                       \
107   guix/scripts/lint.scm                         \
108   guix/scripts/import/gnu.scm                   \
109   guix/scripts/import/nix.scm                   \
110   guix/scripts/environment.scm                  \
111   guix/scripts/publish.scm                      \
112   guix.scm                                      \
113   $(GNU_SYSTEM_MODULES)
115 if BUILD_DAEMON_OFFLOAD
117 MODULES +=                                      \
118   guix/scripts/offload.scm
120 endif BUILD_DAEMON_OFFLOAD
122 # Internal module with test suite support.
123 dist_noinst_DATA = guix/tests.scm
125 # Because of the autoload hack in (guix build download), we must build it
126 # first to avoid errors on systems where (gnutls) is unavailable.
127 guix/scripts/download.go: guix/build/download.go
128 guix/download.go: guix/build/download.go
130 # Linux-Libre configurations.
131 KCONFIGS =                                      \
132   gnu/packages/linux-libre-i686.conf            \
133   gnu/packages/linux-libre-x86_64.conf
135 # Templates, examples.
136 EXAMPLES =                                      \
137   gnu/system/os-config.tmpl
139 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go guix/tests.go
141 nobase_dist_guilemodule_DATA =                  \
142   $(MODULES) $(KCONFIGS) $(EXAMPLES)            \
143   $(MISC_DISTRO_FILES)
144 nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
146 # Do we need to provide our own non-broken (srfi srfi-37) module?
147 if INSTALL_SRFI_37
149 nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
150 GOBJECTS += srfi/srfi-37.go
152 srfi/srfi-37.scm: srfi/srfi-37.scm.in
153         $(MKDIR_P) srfi
154         cp "$<" "$@"
156 endif INSTALL_SRFI_37
158 # Handy way to remove the .go files without removing all the rest.
159 clean-go:
160         -$(RM) -f $(GOBJECTS)
163 SCM_TESTS =                                     \
164   tests/base32.scm                              \
165   tests/base64.scm                              \
166   tests/hash.scm                                \
167   tests/pk-crypto.scm                           \
168   tests/pki.scm                                 \
169   tests/sets.scm                                \
170   tests/substitute.scm                          \
171   tests/builders.scm                            \
172   tests/derivations.scm                         \
173   tests/ui.scm                                  \
174   tests/records.scm                             \
175   tests/utils.scm                               \
176   tests/build-utils.scm                         \
177   tests/packages.scm                            \
178   tests/snix.scm                                \
179   tests/store.scm                               \
180   tests/monads.scm                              \
181   tests/gexp.scm                                \
182   tests/nar.scm                                 \
183   tests/union.scm                               \
184   tests/profiles.scm                            \
185   tests/syscalls.scm                            \
186   tests/gremlin.scm                             \
187   tests/lint.scm                                \
188   tests/publish.scm
190 if HAVE_GUILE_JSON
192 MODULES +=                                      \
193   guix/import/json.scm                          \
194   guix/import/pypi.scm                          \
195   guix/scripts/import/pypi.scm                  \
196   guix/import/cpan.scm                          \
197   guix/scripts/import/cpan.scm
199 SCM_TESTS +=                                    \
200   tests/pypi.scm                                \
201   tests/cpan.scm
203 endif
205 SH_TESTS =                                      \
206   tests/guix-build.sh                           \
207   tests/guix-download.sh                        \
208   tests/guix-gc.sh                              \
209   tests/guix-hash.sh                            \
210   tests/guix-package.sh                         \
211   tests/guix-package-net.sh                     \
212   tests/guix-system.sh                          \
213   tests/guix-archive.sh                         \
214   tests/guix-authenticate.sh                    \
215   tests/guix-lint.sh
217 if BUILD_DAEMON
219 SH_TESTS += tests/guix-register.sh
221 endif BUILD_DAEMON
224 TESTS = $(SCM_TESTS) $(SH_TESTS)
226 TEST_EXTENSIONS = .scm .sh
228 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
230 SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE)
231 AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)"
233 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
234 AM_SH_LOG_FLAGS = -x -e
236 # Make sure `tests/guix-gc.sh' runs last, after all the others.  Otherwise it
237 # could end up removing files from the store while they are being used by
238 # other instances of the daemon.
239 tests/guix-gc.log:                                                      \
240   $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS)))     \
241   $(SCM_TESTS:%.scm=%.log)
243 # Public key used to sign substitutes from hydra.gnu.org.
244 dist_pkgdata_DATA = hydra.gnu.org.pub
246 # Bash completion file.
247 dist_bashcompletion_DATA = etc/completion/bash/guix
249 EXTRA_DIST =                                            \
250   HACKING                                               \
251   ROADMAP                                               \
252   TODO                                                  \
253   .dir-locals.el                                        \
254   build-aux/build-self.scm                              \
255   build-aux/hydra/gnu-system.scm                        \
256   build-aux/hydra/demo-os.scm                           \
257   build-aux/hydra/guix.scm                              \
258   build-aux/check-available-binaries.scm                \
259   build-aux/check-final-inputs-self-contained.scm       \
260   build-aux/download.scm                                \
261   build-aux/list-packages.scm                           \
262   build-aux/make-binary-tarball.scm                     \
263   srfi/srfi-37.scm.in                                   \
264   srfi/srfi-64.scm                                      \
265   srfi/srfi-64.upstream.scm                             \
266   tests/test.drv                                        \
267   tests/signing-key.pub                                 \
268   tests/signing-key.sec                                 \
269   build-aux/config.rpath                                \
270   bootstrap                                             \
271   release.nix                                           \
272   $(TESTS)
274 if !BUILD_DAEMON_OFFLOAD
276 EXTRA_DIST +=                                   \
277   guix/scripts/offload.scm
279 endif !BUILD_DAEMON_OFFLOAD
282 CLEANFILES =                                    \
283   $(GOBJECTS)                                   \
284   $(SCM_TESTS:tests/%.scm=%.log)
286 AM_V_GUILEC = $(AM_V_GUILEC_$(V))
287 AM_V_GUILEC_ = $(AM_V_GUILEC_$(AM_DEFAULT_VERBOSITY))
288 AM_V_GUILEC_0 = @echo "  GUILEC" $@;
290 # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling.  Otherwise, if
291 # $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
292 # there that are newer than the local .scm files (for instance because the
293 # user ran 'make install' recently).  When that happens, we end up loading
294 # those previously-installed .go files, which may be stale, thereby breaking
295 # the whole thing.
297 # XXX: Use the C locale for when Guile lacks
298 # <http://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f>.
299 .scm.go:
300         $(AM_V_GUILEC)$(MKDIR_P) `dirname "$@"` ;                       \
301         unset GUILE_LOAD_COMPILED_PATH ;                                \
302         LC_ALL=C                                                        \
303         $(top_builddir)/pre-inst-env                                    \
304         $(GUILD) compile -L "$(top_builddir)" -L "$(top_srcdir)"        \
305           -Wformat -Wunbound-variable -Warity-mismatch                  \
306           --target="$(host)"                                            \
307           -o "$@" "$<"
309 SUFFIXES = .go
311 # Make sure source files are installed first, so that the mtime of
312 # installed compiled files is greater than that of installed source
313 # files.  See
314 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
315 # for details.
316 guix_install_go_files = install-nobase_nodist_guilemoduleDATA
317 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
319 # The above trick doesn't work for 'config.go' because both 'config.scm' and
320 # 'config.go' are listed in $(nobase_nodist_guilemodule_DATA).  Thus, give it
321 # special treatment.
322 install-data-hook: set-bootstrap-executable-permissions
323         touch "$(DESTDIR)$(guilemoduledir)/guix/config.go"
326 SUBDIRS = po/guix po/packages
327 BUILT_SOURCES =
329 include doc.am
331 if BUILD_DAEMON
333 include daemon.am
335 endif BUILD_DAEMON
337 ACLOCAL_AMFLAGS = -I m4
338 AM_DISTCHECK_CONFIGURE_FLAGS =                  \
339   --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
340   --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
341   --with-nix-prefix="$(NIX_PREFIX)"             \
342   --enable-daemon
344 dist_emacsui_DATA = emacs/guix-main.scm
345 nodist_emacsui_DATA = emacs/guix-helper.scm
346 include emacs.am
348 # The self-contained tarball.
349 guix-binary.%.tar.xz:
350         -GUIX_PACKAGE_PATH= \
351         $(top_builddir)/pre-inst-env "$(GUILE)"                 \
352           "$(top_srcdir)/build-aux/make-binary-tarball.scm" "$*" "$@"
355 dist-hook: sync-descriptions gen-ChangeLog assert-no-store-file-names
356 distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
358 sync-descriptions:
359         -GUIX_PACKAGE_PATH= \
360          $(top_builddir)/pre-inst-env guix lint --checkers=gnu-description
362 gen-ChangeLog:
363         if test -d .git; then                           \
364           $(top_srcdir)/build-aux/gitlog-to-changelog   \
365             > $(distdir)/cl-t;                          \
366           rm -f $(distdir)/ChangeLog;                   \
367           mv $(distdir)/cl-t $(distdir)/ChangeLog;      \
368         fi
370 # Make sure we're not shipping a file that embeds a local /gnu/store file name.
371 assert-no-store-file-names:
372         if grep -r --exclude=*.texi --exclude=*.info                            \
373              "$(storedir)/[a-z0-9]{32}-" $(distdir) ;                           \
374         then                                                                    \
375           echo "error: store file names embedded in the distribution" >&2 ;     \
376           exit 1 ;                                                              \
377         fi
379 # Make sure hydra.gnu.org has the important binaries.
380 assert-binaries-available:
381         $(top_builddir)/pre-inst-env "$(GUILE)"                         \
382           "$(top_srcdir)/build-aux/check-available-binaries.scm"
384 # Make sure the final inputs don't refer to bootstrap tools.
385 assert-final-inputs-self-contained:
386         $(top_builddir)/pre-inst-env "$(GUILE)"                         \
387           "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
389 .PHONY: sync-descriptions gen-ChangeLog clean-go
390 .PHONY: assert-no-store-file-names assert-binaries-available
391 .PHONY: assert-final-inputs-self-contained