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