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