Move specification->package to gnu/packages.scm.
[jackhill/guix/guix.git] / Makefile.am
CommitLineData
233e7676 1# GNU Guix --- Functional package management for GNU
49e6291a 2# Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
f2499672 3# Copyright © 2013 Andreas Enge <andreas@enge.fr>
af51c820 4#
233e7676 5# This file is part of GNU Guix.
af51c820 6#
233e7676 7# GNU Guix is free software; you can redistribute it and/or modify it
af51c820
LC
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.
11#
233e7676 12# GNU Guix is distributed in the hope that it will be useful, but
af51c820
LC
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.
16#
17# You should have received a copy of the GNU General Public License
233e7676 18# along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
af51c820 19
c52a5bf0 20bin_SCRIPTS = \
e49951eb 21 scripts/guix
14a1c319 22
58867ae7
MW
23nodist_noinst_SCRIPTS = \
24 pre-inst-env \
25 test-env
26
d516736c
LC
27include gnu-system.am
28
af51c820 29MODULES = \
ddc29a78 30 guix/base32.scm \
e9c6c584 31 guix/base64.scm \
c0cd1b3e 32 guix/records.scm \
72626a71 33 guix/hash.scm \
3476ded9 34 guix/pk-crypto.scm \
8b420f74 35 guix/pki.scm \
73fbb904 36 guix/utils.scm \
de1355f1 37 guix/download.scm \
9b5b5c17 38 guix/git-download.scm \
b860f382 39 guix/monads.scm \
b9b86078 40 guix/monad-repl.scm \
21b679f6 41 guix/gexp.scm \
cc4ecc2d 42 guix/profiles.scm \
0f41c26f
LC
43 guix/serialization.scm \
44 guix/nar.scm \
af51c820 45 guix/derivations.scm \
22189ed1 46 guix/gnu-maintenance.scm \
838d78e3 47 guix/licenses.scm \
208f7cd1 48 guix/build-system.scm \
c6bded8a 49 guix/build-system/cmake.scm \
208f7cd1 50 guix/build-system/gnu.scm \
08fd1ebe 51 guix/build-system/perl.scm \
40506d5d 52 guix/build-system/python.scm \
be13fbfa 53 guix/build-system/trivial.scm \
457dd86d 54 guix/ftp-client.scm \
3b8258c5 55 guix/http-client.scm \
0fdd3bea 56 guix/gnupg.scm \
af51c820 57 guix/store.scm \
b3acf365 58 guix/svn-download.scm \
073c34d7 59 guix/ui.scm \
62cab99c 60 guix/build/download.scm \
c6bded8a 61 guix/build/cmake-build-system.scm \
9b5b5c17 62 guix/build/git.scm \
af51c820 63 guix/build/gnu-build-system.scm \
fe12c345 64 guix/build/gnu-dist.scm \
88840f02 65 guix/build/linux-initrd.scm \
08fd1ebe 66 guix/build/perl-build-system.scm \
40506d5d 67 guix/build/python-build-system.scm \
1273d44a 68 guix/build/utils.scm \
c8c88afa 69 guix/build/union.scm \
3dbeecd2 70 guix/build/pull.scm \
3309e3a1 71 guix/build/rpath.scm \
b3acf365 72 guix/build/svn.scm \
e1a87b90 73 guix/build/vm.scm \
5ce3defe 74 guix/build/install.scm \
4dfe6c58 75 guix/build/activation.scm \
29fa45f4 76 guix/build/syscalls.scm \
75f3b1a1 77 guix/build/emacs-utils.scm \
e3ce5d70 78 guix/packages.scm \
10226c05 79 guix/snix.scm \
de1355f1
LC
80 guix/scripts/download.scm \
81 guix/scripts/build.scm \
760c60d6 82 guix/scripts/archive.scm \
de1355f1
LC
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 \
526382ff 89 guix/scripts/authenticate.scm \
de1355f1 90 guix/scripts/refresh.scm \
523e4896 91 guix/scripts/system.scm \
e3ce5d70 92 guix.scm \
d516736c 93 $(GNU_SYSTEM_MODULES)
af51c820 94
49e6291a
LC
95if BUILD_DAEMON_OFFLOAD
96
97MODULES += \
98 guix/scripts/offload.scm
99
100endif BUILD_DAEMON_OFFLOAD
101
c1bc358f
LC
102# Internal module with test suite support.
103noinst_DATA = guix/tests.scm
104
855a8ad7
LC
105# Because of the autoload hack in (guix build download), we must build it
106# first to avoid errors on systems where (gnutls) is unavailable.
107guix/scripts/download.go: guix/build/download.go
de1355f1 108guix/download.go: guix/build/download.go
c44899a2 109
a94546ec
LC
110# Linux-Libre configurations.
111KCONFIGS = \
112 gnu/packages/linux-libre-i686.conf \
113 gnu/packages/linux-libre-x86_64.conf
1959fb04 114
ebc32b31
LC
115# Templates, examples.
116EXAMPLES = \
117 gnu/system/os-config.tmpl
118
c1bc358f 119GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go guix/tests.go
af51c820 120
ebc32b31 121nobase_dist_guilemodule_DATA = $(MODULES) $(KCONFIGS) $(EXAMPLES)
1959fb04 122nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
800cdeef 123
1959fb04
LC
124# Do we need to provide our own non-broken (srfi srfi-37) module?
125if INSTALL_SRFI_37
126
127nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
128GOBJECTS += srfi/srfi-37.go
129
130srfi/srfi-37.scm: srfi/srfi-37.scm.in
131 $(MKDIR_P) srfi
132 cp "$<" "$@"
133
134endif INSTALL_SRFI_37
ac5aa288 135
70a9c720
LC
136# Handy way to remove the .go files without removing all the rest.
137clean-go:
138 -$(RM) -f $(GOBJECTS)
139
af51c820 140
30dd8310 141SCM_TESTS = \
ddc29a78 142 tests/base32.scm \
e9c6c584 143 tests/base64.scm \
69927e78 144 tests/hash.scm \
3476ded9 145 tests/pk-crypto.scm \
8b420f74 146 tests/pki.scm \
e9c6c584 147 tests/substitute-binary.scm \
af51c820
LC
148 tests/builders.scm \
149 tests/derivations.scm \
299112d3 150 tests/ui.scm \
c0cd1b3e 151 tests/records.scm \
e3ce5d70 152 tests/utils.scm \
b0e0d0e9 153 tests/build-utils.scm \
c8c88afa 154 tests/packages.scm \
10226c05 155 tests/snix.scm \
3259877d 156 tests/store.scm \
b860f382 157 tests/monads.scm \
21b679f6 158 tests/gexp.scm \
53c63ee9 159 tests/nar.scm \
a2078770 160 tests/union.scm \
29fa45f4
LC
161 tests/profiles.scm \
162 tests/syscalls.scm
30dd8310
LC
163
164SH_TESTS = \
0afdc485 165 tests/guix-build.sh \
37d19403 166 tests/guix-download.sh \
fe8ff028 167 tests/guix-gc.sh \
ccbce848 168 tests/guix-hash.sh \
0820098d 169 tests/guix-package.sh \
c1202fb1 170 tests/guix-system.sh \
760c60d6 171 tests/guix-archive.sh \
0820098d 172 tests/guix-authenticate.sh
af51c820 173
a7a4e6a4
LC
174if BUILD_DAEMON
175
176SH_TESTS += tests/guix-register.sh
177
178endif BUILD_DAEMON
179
180
30dd8310
LC
181TESTS = $(SCM_TESTS) $(SH_TESTS)
182
97298ffa
LC
183TEST_EXTENSIONS = .scm .sh
184
352ec143
LC
185AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
186
69cfce50 187SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE)
97298ffa
LC
188AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)"
189
69cfce50 190SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
97298ffa 191AM_SH_LOG_FLAGS = -x -e
af51c820 192
3a33730a
LC
193# Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
194# could end up removing files from the store while they are being used by
195# other instances of the daemon.
196tests/guix-gc.log: \
197 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
198 $(SCM_TESTS:%.scm=%.log)
199
bf59c06d 200# Public key used to sign substitutes from hydra.gnu.org.
6c110833 201dist_pkgdata_DATA = hydra.gnu.org.pub
3a33730a 202
81f61c17
LC
203EXTRA_DIST = \
204 HACKING \
205 ROADMAP \
206 TODO \
207 .dir-locals.el \
208 build-aux/hydra/gnu-system.scm \
209 build-aux/hydra/demo-os.scm \
210 build-aux/hydra/guix.scm \
211 build-aux/check-available-binaries.scm \
212 build-aux/check-final-inputs-self-contained.scm \
213 build-aux/download.scm \
214 build-aux/list-packages.scm \
215 build-aux/sync-descriptions.scm \
216 srfi/srfi-37.scm.in \
217 srfi/srfi-64.scm \
218 srfi/srfi-64.upstream.scm \
219 tests/test.drv \
220 tests/signing-key.pub \
221 tests/signing-key.sec \
222 build-aux/config.rpath \
223 bootstrap \
224 release.nix \
ed795c06 225 $(TESTS)
d7672884 226
49e6291a
LC
227if !BUILD_DAEMON_OFFLOAD
228
229EXTRA_DIST += \
230 guix/scripts/offload.scm
231
232endif !BUILD_DAEMON_OFFLOAD
233
234
30dd8310
LC
235CLEANFILES = \
236 $(GOBJECTS) \
9bff16b3 237 $(SCM_TESTS:tests/%.scm=%.log)
af51c820 238
dab5d51b
LC
239AM_V_GUILEC = $(AM_V_GUILEC_$(V))
240AM_V_GUILEC_ = $(AM_V_GUILEC_$(AM_DEFAULT_VERBOSITY))
241AM_V_GUILEC_0 = @echo " GUILEC" $@;
242
a69b7ad2
LC
243# XXX: Use the C locale for when Guile lacks
244# <http://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f>.
af51c820 245.scm.go:
dab5d51b 246 $(AM_V_GUILEC)$(MKDIR_P) `dirname "$@"` ; \
a69b7ad2 247 LC_ALL=C \
671d8f5e
LC
248 $(top_builddir)/pre-inst-env \
249 $(GUILD) compile -L "$(top_builddir)" -L "$(top_srcdir)" \
250 -Wformat -Wunbound-variable -Warity-mismatch \
251 --target="$(host)" \
af51c820
LC
252 -o "$@" "$<"
253
254SUFFIXES = .go
255
256# Make sure source files are installed first, so that the mtime of
257# installed compiled files is greater than that of installed source
258# files. See
259# <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
260# for details.
261guix_install_go_files = install-nobase_nodist_guilemoduleDATA
262$(guix_install_go_files): install-nobase_dist_guilemoduleDATA
f68b0893 263
ee764179 264SUBDIRS = po/guix po/packages
931c132a 265BUILT_SOURCES =
a9424c08
LC
266
267include doc.am
568717fd 268
c2033df4
LC
269if BUILD_DAEMON
270
271include daemon.am
272
273endif BUILD_DAEMON
274
f68b0893 275ACLOCAL_AMFLAGS = -I m4
e76bdf8b 276AM_DISTCHECK_CONFIGURE_FLAGS = \
d388c2c4 277 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
14af289e 278 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
aca54b39
LC
279 --with-nix-prefix="$(NIX_PREFIX)" \
280 --enable-daemon
0e993428 281
668d48a6 282dist-hook: sync-descriptions gen-ChangeLog assert-no-store-file-names
81f61c17 283distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
e793178a 284
668d48a6 285sync-descriptions:
0e993428 286 -$(top_builddir)/pre-inst-env $(GUILE) \
668d48a6 287 $(top_srcdir)/build-aux/sync-descriptions.scm
e793178a
LC
288
289gen-ChangeLog:
290 if test -d .git; then \
291 $(top_srcdir)/build-aux/gitlog-to-changelog \
292 > $(distdir)/cl-t; \
293 rm -f $(distdir)/ChangeLog; \
294 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
295 fi
296
834129e0 297# Make sure we're not shipping a file that embeds a local /gnu/store file name.
a463ffd9
LC
298assert-no-store-file-names:
299 if grep -r --exclude=*.texi --exclude=*.info \
300 "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
301 then \
302 echo "error: store file names embedded in the distribution" >&2 ; \
303 exit 1 ; \
304 fi
305
56fbf262
LC
306# Make sure hydra.gnu.org has the important binaries.
307assert-binaries-available:
308 $(top_builddir)/pre-inst-env "$(GUILE)" \
309 "$(top_srcdir)/build-aux/check-available-binaries.scm"
310
81f61c17
LC
311# Make sure the final inputs don't refer to bootstrap tools.
312assert-final-inputs-self-contained:
313 $(top_builddir)/pre-inst-env "$(GUILE)" \
314 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
315
70a9c720 316.PHONY: sync-descriptions gen-ChangeLog clean-go
56fbf262 317.PHONY: assert-no-store-file-names assert-binaries-available
81f61c17 318.PHONY: assert-final-inputs-self-contained