Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / Makefile.am
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>
4 #
5 # This file is part of GNU Guix.
6 #
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.
11 #
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.
16 #
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/>.
19
20 bin_SCRIPTS = \
21 scripts/guix
22
23 nodist_noinst_SCRIPTS = \
24 pre-inst-env \
25 test-env
26
27 include gnu-system.am
28
29 MODULES = \
30 guix/base32.scm \
31 guix/records.scm \
32 guix/hash.scm \
33 guix/pk-crypto.scm \
34 guix/pki.scm \
35 guix/utils.scm \
36 guix/download.scm \
37 guix/git-download.scm \
38 guix/monads.scm \
39 guix/profiles.scm \
40 guix/serialization.scm \
41 guix/nar.scm \
42 guix/derivations.scm \
43 guix/gnu-maintenance.scm \
44 guix/licenses.scm \
45 guix/build-system.scm \
46 guix/build-system/cmake.scm \
47 guix/build-system/gnu.scm \
48 guix/build-system/perl.scm \
49 guix/build-system/python.scm \
50 guix/build-system/trivial.scm \
51 guix/ftp-client.scm \
52 guix/http-client.scm \
53 guix/gnupg.scm \
54 guix/store.scm \
55 guix/ui.scm \
56 guix/build/download.scm \
57 guix/build/cmake-build-system.scm \
58 guix/build/git.scm \
59 guix/build/gnome.scm \
60 guix/build/gnu-build-system.scm \
61 guix/build/gnu-dist.scm \
62 guix/build/linux-initrd.scm \
63 guix/build/perl-build-system.scm \
64 guix/build/python-build-system.scm \
65 guix/build/utils.scm \
66 guix/build/union.scm \
67 guix/build/pull.scm \
68 guix/build/rpath.scm \
69 guix/packages.scm \
70 guix/snix.scm \
71 guix/scripts/download.scm \
72 guix/scripts/build.scm \
73 guix/scripts/archive.scm \
74 guix/scripts/import.scm \
75 guix/scripts/package.scm \
76 guix/scripts/gc.scm \
77 guix/scripts/hash.scm \
78 guix/scripts/pull.scm \
79 guix/scripts/substitute-binary.scm \
80 guix/scripts/authenticate.scm \
81 guix/scripts/refresh.scm \
82 guix/scripts/system.scm \
83 guix.scm \
84 $(GNU_SYSTEM_MODULES)
85
86 if BUILD_DAEMON_OFFLOAD
87
88 MODULES += \
89 guix/scripts/offload.scm
90
91 endif BUILD_DAEMON_OFFLOAD
92
93 # Because of the autoload hack in (guix build download), we must build it
94 # first to avoid errors on systems where (gnutls) is unavailable.
95 guix/scripts/download.go: guix/build/download.go
96 guix/download.go: guix/build/download.go
97
98
99 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go
100
101 nobase_dist_guilemodule_DATA = $(MODULES)
102 nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
103
104 # Do we need to provide our own non-broken (srfi srfi-37) module?
105 if INSTALL_SRFI_37
106
107 nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
108 GOBJECTS += srfi/srfi-37.go
109
110 srfi/srfi-37.scm: srfi/srfi-37.scm.in
111 $(MKDIR_P) srfi
112 cp "$<" "$@"
113
114 endif INSTALL_SRFI_37
115
116 # Handy way to remove the .go files without removing all the rest.
117 clean-go:
118 -$(RM) -f $(GOBJECTS)
119
120
121 SCM_TESTS = \
122 tests/base32.scm \
123 tests/hash.scm \
124 tests/pk-crypto.scm \
125 tests/pki.scm \
126 tests/builders.scm \
127 tests/derivations.scm \
128 tests/ui.scm \
129 tests/records.scm \
130 tests/utils.scm \
131 tests/build-utils.scm \
132 tests/packages.scm \
133 tests/snix.scm \
134 tests/store.scm \
135 tests/monads.scm \
136 tests/nar.scm \
137 tests/union.scm \
138 tests/profiles.scm
139
140 SH_TESTS = \
141 tests/guix-build.sh \
142 tests/guix-download.sh \
143 tests/guix-gc.sh \
144 tests/guix-hash.sh \
145 tests/guix-package.sh \
146 tests/guix-archive.sh \
147 tests/guix-authenticate.sh
148
149 if BUILD_DAEMON
150
151 SH_TESTS += tests/guix-register.sh
152
153 endif BUILD_DAEMON
154
155
156 TESTS = $(SCM_TESTS) $(SH_TESTS)
157
158 TEST_EXTENSIONS = .scm .sh
159
160 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
161
162 SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE)
163 AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)"
164
165 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
166 AM_SH_LOG_FLAGS = -x -e
167
168 # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
169 # could end up removing files from the store while they are being used by
170 # other instances of the daemon.
171 tests/guix-gc.log: \
172 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
173 $(SCM_TESTS:%.scm=%.log)
174
175
176 EXTRA_DIST = \
177 HACKING \
178 ROADMAP \
179 TODO \
180 .dir-locals.el \
181 build-aux/hydra/gnu-system.scm \
182 build-aux/hydra/guix.scm \
183 build-aux/check-available-binaries.scm \
184 build-aux/download.scm \
185 build-aux/list-packages.scm \
186 build-aux/sync-descriptions.scm \
187 srfi/srfi-37.scm.in \
188 srfi/srfi-64.scm \
189 srfi/srfi-64.upstream.scm \
190 tests/test.drv \
191 tests/signing-key.pub \
192 tests/signing-key.sec \
193 build-aux/config.rpath \
194 bootstrap \
195 release.nix \
196 $(TESTS)
197
198 if !BUILD_DAEMON_OFFLOAD
199
200 EXTRA_DIST += \
201 guix/scripts/offload.scm
202
203 endif !BUILD_DAEMON_OFFLOAD
204
205
206 CLEANFILES = \
207 $(GOBJECTS) \
208 $(SCM_TESTS:tests/%.scm=%.log)
209
210 AM_V_GUILEC = $(AM_V_GUILEC_$(V))
211 AM_V_GUILEC_ = $(AM_V_GUILEC_$(AM_DEFAULT_VERBOSITY))
212 AM_V_GUILEC_0 = @echo " GUILEC" $@;
213
214 # XXX: Use the C locale for when Guile lacks
215 # <http://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f>.
216 .scm.go:
217 $(AM_V_GUILEC)$(MKDIR_P) `dirname "$@"` ; \
218 LC_ALL=C \
219 $(top_builddir)/pre-inst-env \
220 $(GUILD) compile -L "$(top_builddir)" -L "$(top_srcdir)" \
221 -Wformat -Wunbound-variable -Warity-mismatch \
222 --target="$(host)" \
223 -o "$@" "$<"
224
225 SUFFIXES = .go
226
227 # Make sure source files are installed first, so that the mtime of
228 # installed compiled files is greater than that of installed source
229 # files. See
230 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
231 # for details.
232 guix_install_go_files = install-nobase_nodist_guilemoduleDATA
233 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
234
235 SUBDIRS = po
236
237 include doc.am
238
239 if BUILD_DAEMON
240
241 include daemon.am
242
243 endif BUILD_DAEMON
244
245 ACLOCAL_AMFLAGS = -I m4
246 AM_DISTCHECK_CONFIGURE_FLAGS = \
247 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
248 --with-nix-prefix="$(NIX_PREFIX)" \
249 --enable-daemon
250
251 dist-hook: sync-descriptions gen-ChangeLog assert-no-store-file-names
252 distcheck-hook: assert-binaries-available
253
254 sync-descriptions:
255 -$(top_builddir)/pre-inst-env $(GUILE) \
256 $(top_srcdir)/build-aux/sync-descriptions.scm
257
258 gen-ChangeLog:
259 if test -d .git; then \
260 $(top_srcdir)/build-aux/gitlog-to-changelog \
261 > $(distdir)/cl-t; \
262 rm -f $(distdir)/ChangeLog; \
263 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
264 fi
265
266 # Make sure we're not shipping a file that embeds a local /nix/store file name.
267 assert-no-store-file-names:
268 if grep -r --exclude=*.texi --exclude=*.info \
269 "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
270 then \
271 echo "error: store file names embedded in the distribution" >&2 ; \
272 exit 1 ; \
273 fi
274
275 # Make sure hydra.gnu.org has the important binaries.
276 assert-binaries-available:
277 $(top_builddir)/pre-inst-env "$(GUILE)" \
278 "$(top_srcdir)/build-aux/check-available-binaries.scm"
279
280 .PHONY: sync-descriptions gen-ChangeLog clean-go
281 .PHONY: assert-no-store-file-names assert-binaries-available