ui: Recognize the same size units as Coreutils.
[guix.git] / Makefile.am
blobeba34af4a94d84103323b6e841db26cf76c786a7
1 # GNU Guix --- Functional package management for GNU
2 # Copyright © 2012, 2013, 2014 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/hash.scm                                 \
34   guix/pk-crypto.scm                            \
35   guix/pki.scm                                  \
36   guix/utils.scm                                \
37   guix/download.scm                             \
38   guix/git-download.scm                         \
39   guix/monads.scm                               \
40   guix/monad-repl.scm                           \
41   guix/gexp.scm                                 \
42   guix/profiles.scm                             \
43   guix/serialization.scm                        \
44   guix/nar.scm                                  \
45   guix/derivations.scm                          \
46   guix/gnu-maintenance.scm                      \
47   guix/licenses.scm                             \
48   guix/build-system.scm                         \
49   guix/build-system/cmake.scm                   \
50   guix/build-system/gnu.scm                     \
51   guix/build-system/perl.scm                    \
52   guix/build-system/python.scm                  \
53   guix/build-system/ruby.scm                    \
54   guix/build-system/trivial.scm                 \
55   guix/ftp-client.scm                           \
56   guix/http-client.scm                          \
57   guix/gnupg.scm                                \
58   guix/store.scm                                \
59   guix/svn-download.scm                         \
60   guix/ui.scm                                   \
61   guix/build/download.scm                       \
62   guix/build/cmake-build-system.scm             \
63   guix/build/git.scm                            \
64   guix/build/gnu-build-system.scm               \
65   guix/build/gnu-dist.scm                       \
66   guix/build/perl-build-system.scm              \
67   guix/build/python-build-system.scm            \
68   guix/build/ruby-build-system.scm              \
69   guix/build/store-copy.scm                     \
70   guix/build/utils.scm                          \
71   guix/build/union.scm                          \
72   guix/build/pull.scm                           \
73   guix/build/rpath.scm                          \
74   guix/build/svn.scm                            \
75   guix/build/syscalls.scm                       \
76   guix/build/emacs-utils.scm                    \
77   guix/packages.scm                             \
78   guix/import/utils.scm                         \
79   guix/import/snix.scm                          \
80   guix/scripts/download.scm                     \
81   guix/scripts/build.scm                        \
82   guix/scripts/archive.scm                      \
83   guix/scripts/import.scm                       \
84   guix/scripts/package.scm                      \
85   guix/scripts/gc.scm                           \
86   guix/scripts/hash.scm                         \
87   guix/scripts/pull.scm                         \
88   guix/scripts/substitute-binary.scm            \
89   guix/scripts/authenticate.scm                 \
90   guix/scripts/refresh.scm                      \
91   guix/scripts/system.scm                       \
92   guix/scripts/lint.scm                         \
93   guix/scripts/import/nix.scm                   \
94   guix.scm                                      \
95   $(GNU_SYSTEM_MODULES)
97 if BUILD_DAEMON_OFFLOAD
99 MODULES +=                                      \
100   guix/scripts/offload.scm
102 endif BUILD_DAEMON_OFFLOAD
104 # Internal module with test suite support.
105 noinst_DATA = guix/tests.scm
107 # Because of the autoload hack in (guix build download), we must build it
108 # first to avoid errors on systems where (gnutls) is unavailable.
109 guix/scripts/download.go: guix/build/download.go
110 guix/download.go: guix/build/download.go
112 # Linux-Libre configurations.
113 KCONFIGS =                                      \
114   gnu/packages/linux-libre-i686.conf            \
115   gnu/packages/linux-libre-x86_64.conf
117 # Templates, examples.
118 EXAMPLES =                                      \
119   gnu/system/os-config.tmpl
121 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go guix/tests.go
123 nobase_dist_guilemodule_DATA = $(MODULES) $(KCONFIGS) $(EXAMPLES)
124 nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
126 # Do we need to provide our own non-broken (srfi srfi-37) module?
127 if INSTALL_SRFI_37
129 nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
130 GOBJECTS += srfi/srfi-37.go
132 srfi/srfi-37.scm: srfi/srfi-37.scm.in
133         $(MKDIR_P) srfi
134         cp "$<" "$@"
136 endif INSTALL_SRFI_37
138 # Handy way to remove the .go files without removing all the rest.
139 clean-go:
140         -$(RM) -f $(GOBJECTS)
143 SCM_TESTS =                                     \
144   tests/base32.scm                              \
145   tests/base64.scm                              \
146   tests/hash.scm                                \
147   tests/pk-crypto.scm                           \
148   tests/pki.scm                                 \
149   tests/substitute-binary.scm                   \
150   tests/builders.scm                            \
151   tests/derivations.scm                         \
152   tests/ui.scm                                  \
153   tests/records.scm                             \
154   tests/utils.scm                               \
155   tests/build-utils.scm                         \
156   tests/packages.scm                            \
157   tests/snix.scm                                \
158   tests/store.scm                               \
159   tests/monads.scm                              \
160   tests/gexp.scm                                \
161   tests/nar.scm                                 \
162   tests/union.scm                               \
163   tests/profiles.scm                            \
164   tests/syscalls.scm                            \
165   tests/lint.scm
167 if HAVE_GUILE_JSON
169 MODULES +=                                      \
170   guix/import/pypi.scm                          \
171   guix/scripts/import/pypi.scm
173 SCM_TESTS += tests/pypi.scm
175 endif
177 SH_TESTS =                                      \
178   tests/guix-build.sh                           \
179   tests/guix-download.sh                        \
180   tests/guix-gc.sh                              \
181   tests/guix-hash.sh                            \
182   tests/guix-package.sh                         \
183   tests/guix-system.sh                          \
184   tests/guix-archive.sh                         \
185   tests/guix-authenticate.sh
187 if BUILD_DAEMON
189 SH_TESTS += tests/guix-register.sh
191 endif BUILD_DAEMON
194 TESTS = $(SCM_TESTS) $(SH_TESTS)
196 TEST_EXTENSIONS = .scm .sh
198 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
200 SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE)
201 AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)"
203 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
204 AM_SH_LOG_FLAGS = -x -e
206 # Make sure `tests/guix-gc.sh' runs last, after all the others.  Otherwise it
207 # could end up removing files from the store while they are being used by
208 # other instances of the daemon.
209 tests/guix-gc.log:                                                      \
210   $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS)))     \
211   $(SCM_TESTS:%.scm=%.log)
213 # Public key used to sign substitutes from hydra.gnu.org.
214 dist_pkgdata_DATA = hydra.gnu.org.pub
216 EXTRA_DIST =                                            \
217   HACKING                                               \
218   ROADMAP                                               \
219   TODO                                                  \
220   .dir-locals.el                                        \
221   build-aux/hydra/gnu-system.scm                        \
222   build-aux/hydra/demo-os.scm                           \
223   build-aux/hydra/guix.scm                              \
224   build-aux/check-available-binaries.scm                \
225   build-aux/check-final-inputs-self-contained.scm       \
226   build-aux/download.scm                                \
227   build-aux/list-packages.scm                           \
228   build-aux/sync-descriptions.scm                       \
229   srfi/srfi-37.scm.in                                   \
230   srfi/srfi-64.scm                                      \
231   srfi/srfi-64.upstream.scm                             \
232   tests/test.drv                                        \
233   tests/signing-key.pub                                 \
234   tests/signing-key.sec                                 \
235   build-aux/config.rpath                                \
236   bootstrap                                             \
237   release.nix                                           \
238   $(TESTS)
240 if !BUILD_DAEMON_OFFLOAD
242 EXTRA_DIST +=                                   \
243   guix/scripts/offload.scm
245 endif !BUILD_DAEMON_OFFLOAD
248 CLEANFILES =                                    \
249   $(GOBJECTS)                                   \
250   $(SCM_TESTS:tests/%.scm=%.log)
252 AM_V_GUILEC = $(AM_V_GUILEC_$(V))
253 AM_V_GUILEC_ = $(AM_V_GUILEC_$(AM_DEFAULT_VERBOSITY))
254 AM_V_GUILEC_0 = @echo "  GUILEC" $@;
256 # XXX: Use the C locale for when Guile lacks
257 # <http://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f>.
258 .scm.go:
259         $(AM_V_GUILEC)$(MKDIR_P) `dirname "$@"` ;                       \
260         LC_ALL=C                                                        \
261         $(top_builddir)/pre-inst-env                                    \
262         $(GUILD) compile -L "$(top_builddir)" -L "$(top_srcdir)"        \
263           -Wformat -Wunbound-variable -Warity-mismatch                  \
264           --target="$(host)"                                            \
265           -o "$@" "$<"
267 SUFFIXES = .go
269 # Make sure source files are installed first, so that the mtime of
270 # installed compiled files is greater than that of installed source
271 # files.  See
272 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
273 # for details.
274 guix_install_go_files = install-nobase_nodist_guilemoduleDATA
275 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
277 SUBDIRS = po/guix po/packages
278 BUILT_SOURCES =
280 include doc.am
282 if BUILD_DAEMON
284 include daemon.am
286 endif BUILD_DAEMON
288 ACLOCAL_AMFLAGS = -I m4
289 AM_DISTCHECK_CONFIGURE_FLAGS =                  \
290   --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
291   --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
292   --with-nix-prefix="$(NIX_PREFIX)"             \
293   --enable-daemon
295 dist_emacsui_DATA = emacs/guix-main.scm
296 nodist_emacsui_DATA = emacs/guix-helper.scm
297 include emacs.am
299 dist-hook: sync-descriptions gen-ChangeLog assert-no-store-file-names
300 distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
302 sync-descriptions:
303         -$(top_builddir)/pre-inst-env $(GUILE)          \
304            $(top_srcdir)/build-aux/sync-descriptions.scm
306 gen-ChangeLog:
307         if test -d .git; then                           \
308           $(top_srcdir)/build-aux/gitlog-to-changelog   \
309             > $(distdir)/cl-t;                          \
310           rm -f $(distdir)/ChangeLog;                   \
311           mv $(distdir)/cl-t $(distdir)/ChangeLog;      \
312         fi
314 # Make sure we're not shipping a file that embeds a local /gnu/store file name.
315 assert-no-store-file-names:
316         if grep -r --exclude=*.texi --exclude=*.info                            \
317              "$(storedir)/[a-z0-9]{32}-" $(distdir) ;                           \
318         then                                                                    \
319           echo "error: store file names embedded in the distribution" >&2 ;     \
320           exit 1 ;                                                              \
321         fi
323 # Make sure hydra.gnu.org has the important binaries.
324 assert-binaries-available:
325         $(top_builddir)/pre-inst-env "$(GUILE)"                         \
326           "$(top_srcdir)/build-aux/check-available-binaries.scm"
328 # Make sure the final inputs don't refer to bootstrap tools.
329 assert-final-inputs-self-contained:
330         $(top_builddir)/pre-inst-env "$(GUILE)"                         \
331           "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
333 .PHONY: sync-descriptions gen-ChangeLog clean-go
334 .PHONY: assert-no-store-file-names assert-binaries-available
335 .PHONY: assert-final-inputs-self-contained