gnu: Add linux-libre-4.1.
[jackhill/guix/guix.git] / Makefile.am
1 # GNU Guix --- Functional package management for GNU
2 # Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
3 # Copyright © 2013 Andreas Enge <andreas@enge.fr>
4 # Copyright © 2015 Alex Kost <alezost@gmail.com>
5 # Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
6 # Copyright © 2016 Mark H Weaver <mhw@netris.org>
7 #
8 # This file is part of GNU Guix.
9 #
10 # GNU Guix is free software; you can redistribute it and/or modify it
11 # under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 3 of the License, or (at
13 # your option) any later version.
14 #
15 # GNU Guix is distributed in the hope that it will be useful, but
16 # WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
19 #
20 # You should have received a copy of the GNU General Public License
21 # along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23 bin_SCRIPTS = \
24 scripts/guix
25
26 nodist_noinst_SCRIPTS = \
27 pre-inst-env \
28 test-env
29
30 include gnu-system.am
31
32 MODULES = \
33 guix/base32.scm \
34 guix/base64.scm \
35 guix/cpio.scm \
36 guix/records.scm \
37 guix/gcrypt.scm \
38 guix/hash.scm \
39 guix/pk-crypto.scm \
40 guix/pki.scm \
41 guix/utils.scm \
42 guix/sets.scm \
43 guix/download.scm \
44 guix/git-download.scm \
45 guix/monads.scm \
46 guix/monad-repl.scm \
47 guix/gexp.scm \
48 guix/profiles.scm \
49 guix/serialization.scm \
50 guix/nar.scm \
51 guix/derivations.scm \
52 guix/gnu-maintenance.scm \
53 guix/upstream.scm \
54 guix/licenses.scm \
55 guix/graph.scm \
56 guix/cve.scm \
57 guix/build-system.scm \
58 guix/build-system/cmake.scm \
59 guix/build-system/emacs.scm \
60 guix/build-system/glib-or-gtk.scm \
61 guix/build-system/gnu.scm \
62 guix/build-system/haskell.scm \
63 guix/build-system/perl.scm \
64 guix/build-system/python.scm \
65 guix/build-system/waf.scm \
66 guix/build-system/r.scm \
67 guix/build-system/ruby.scm \
68 guix/build-system/trivial.scm \
69 guix/ftp-client.scm \
70 guix/http-client.scm \
71 guix/gnupg.scm \
72 guix/elf.scm \
73 guix/store.scm \
74 guix/cvs-download.scm \
75 guix/svn-download.scm \
76 guix/ui.scm \
77 guix/build/download.scm \
78 guix/build/cmake-build-system.scm \
79 guix/build/emacs-build-system.scm \
80 guix/build/git.scm \
81 guix/build/glib-or-gtk-build-system.scm \
82 guix/build/gnu-build-system.scm \
83 guix/build/gnu-dist.scm \
84 guix/build/perl-build-system.scm \
85 guix/build/python-build-system.scm \
86 guix/build/r-build-system.scm \
87 guix/build/ruby-build-system.scm \
88 guix/build/waf-build-system.scm \
89 guix/build/haskell-build-system.scm \
90 guix/build/store-copy.scm \
91 guix/build/utils.scm \
92 guix/build/union.scm \
93 guix/build/profiles.scm \
94 guix/build/pull.scm \
95 guix/build/rpath.scm \
96 guix/build/cvs.scm \
97 guix/build/svn.scm \
98 guix/build/gremlin.scm \
99 guix/build/emacs-utils.scm \
100 guix/build/graft.scm \
101 guix/search-paths.scm \
102 guix/packages.scm \
103 guix/import/utils.scm \
104 guix/import/gnu.scm \
105 guix/import/snix.scm \
106 guix/import/cabal.scm \
107 guix/import/cran.scm \
108 guix/import/hackage.scm \
109 guix/import/elpa.scm \
110 guix/scripts.scm \
111 guix/scripts/download.scm \
112 guix/scripts/build.scm \
113 guix/scripts/archive.scm \
114 guix/scripts/import.scm \
115 guix/scripts/package.scm \
116 guix/scripts/gc.scm \
117 guix/scripts/hash.scm \
118 guix/scripts/pull.scm \
119 guix/scripts/substitute.scm \
120 guix/scripts/authenticate.scm \
121 guix/scripts/refresh.scm \
122 guix/scripts/system.scm \
123 guix/scripts/lint.scm \
124 guix/scripts/challenge.scm \
125 guix/scripts/import/cran.scm \
126 guix/scripts/import/gnu.scm \
127 guix/scripts/import/nix.scm \
128 guix/scripts/import/hackage.scm \
129 guix/scripts/import/elpa.scm \
130 guix/scripts/environment.scm \
131 guix/scripts/publish.scm \
132 guix/scripts/edit.scm \
133 guix/scripts/size.scm \
134 guix/scripts/graph.scm \
135 guix/scripts/container.scm \
136 guix/scripts/container/exec.scm \
137 guix.scm \
138 $(GNU_SYSTEM_MODULES)
139
140 if HAVE_GUILE_JSON
141
142 MODULES += \
143 guix/import/json.scm \
144 guix/import/pypi.scm \
145 guix/scripts/import/pypi.scm \
146 guix/import/cpan.scm \
147 guix/scripts/import/gem.scm \
148 guix/import/gem.scm
149
150 endif
151
152 if BUILD_SYSCALLS_MODULE
153
154 MODULES += \
155 guix/build/syscalls.scm
156
157 endif
158
159 if BUILD_DAEMON_OFFLOAD
160
161 MODULES += \
162 guix/scripts/offload.scm
163
164 endif BUILD_DAEMON_OFFLOAD
165
166 # Internal module with test suite support.
167 dist_noinst_DATA = guix/tests.scm
168
169 # Linux-Libre configurations.
170 KCONFIGS = \
171 gnu/packages/linux-libre-i686.conf \
172 gnu/packages/linux-libre-x86_64.conf \
173 gnu/packages/linux-libre-4.1-i686.conf \
174 gnu/packages/linux-libre-4.1-x86_64.conf
175
176 # Templates, examples.
177 EXAMPLES = \
178 gnu/system/examples/bare-bones.tmpl \
179 gnu/system/examples/desktop.tmpl
180
181 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go guix/tests.go
182
183 nobase_dist_guilemodule_DATA = \
184 $(MODULES) $(KCONFIGS) $(EXAMPLES) \
185 $(MISC_DISTRO_FILES)
186 nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
187
188 # Do we need to provide our own non-broken (srfi srfi-37) module?
189 if INSTALL_SRFI_37
190
191 nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
192 GOBJECTS += srfi/srfi-37.go
193
194 srfi/srfi-37.scm: srfi/srfi-37.scm.in
195 $(MKDIR_P) srfi
196 cp "$<" "$@"
197
198 endif INSTALL_SRFI_37
199
200 # Handy way to remove the .go files without removing all the rest.
201 clean-go:
202 -$(RM) -f $(GOBJECTS)
203
204
205 # Test extensions; has to be unconditional.
206 TEST_EXTENSIONS = .scm .sh
207
208 if CAN_RUN_TESTS
209
210 SCM_TESTS = \
211 tests/base32.scm \
212 tests/base64.scm \
213 tests/cpio.scm \
214 tests/hash.scm \
215 tests/pk-crypto.scm \
216 tests/pki.scm \
217 tests/sets.scm \
218 tests/gnu-maintenance.scm \
219 tests/substitute.scm \
220 tests/builders.scm \
221 tests/derivations.scm \
222 tests/ui.scm \
223 tests/records.scm \
224 tests/utils.scm \
225 tests/build-utils.scm \
226 tests/packages.scm \
227 tests/snix.scm \
228 tests/hackage.scm \
229 tests/cran.scm \
230 tests/elpa.scm \
231 tests/store.scm \
232 tests/monads.scm \
233 tests/gexp.scm \
234 tests/nar.scm \
235 tests/union.scm \
236 tests/profiles.scm \
237 tests/syscalls.scm \
238 tests/gremlin.scm \
239 tests/lint.scm \
240 tests/publish.scm \
241 tests/scripts.scm \
242 tests/size.scm \
243 tests/graph.scm \
244 tests/challenge.scm \
245 tests/cve.scm \
246 tests/file-systems.scm \
247 tests/system.scm \
248 tests/services.scm \
249 tests/scripts-build.scm \
250 tests/containers.scm \
251 tests/import-utils.scm
252
253 if HAVE_GUILE_JSON
254
255 SCM_TESTS += \
256 tests/pypi.scm \
257 tests/cpan.scm \
258 tests/gem.scm
259
260 endif
261
262 SH_TESTS = \
263 tests/guix-build.sh \
264 tests/guix-download.sh \
265 tests/guix-gc.sh \
266 tests/guix-hash.sh \
267 tests/guix-package.sh \
268 tests/guix-package-net.sh \
269 tests/guix-system.sh \
270 tests/guix-archive.sh \
271 tests/guix-authenticate.sh \
272 tests/guix-environment.sh \
273 tests/guix-environment-container.sh \
274 tests/guix-graph.sh \
275 tests/guix-lint.sh
276
277 if BUILD_DAEMON
278
279 SH_TESTS += tests/guix-register.sh
280
281 endif BUILD_DAEMON
282
283
284 TESTS = $(SCM_TESTS) $(SH_TESTS)
285
286 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
287
288 SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE)
289 AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)"
290
291 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
292 AM_SH_LOG_FLAGS = -x -e
293
294 # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
295 # could end up removing files from the store while they are being used by
296 # other instances of the daemon.
297 tests/guix-gc.log: \
298 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
299 $(SCM_TESTS:%.scm=%.log)
300
301 else !CAN_RUN_TESTS
302
303 TESTS =
304 SH_TESTS =
305 SCM_TESTS =
306
307 # Automake always generates a 'check' target, so better not override it.
308 check-local:
309 @echo
310 @echo "Cannot run tests because file name limits would be exceeded." >&2
311 @echo "Look for 'length' in the 'config.log' file for details." >&2
312 @echo
313 @exit 1
314
315 endif !CAN_RUN_TESTS
316
317 # Public key used to sign substitutes from hydra.gnu.org.
318 dist_pkgdata_DATA = hydra.gnu.org.pub
319
320 # Bash completion file.
321 dist_bashcompletion_DATA = etc/completion/bash/guix
322
323 EXTRA_DIST = \
324 HACKING \
325 ROADMAP \
326 TODO \
327 CODE-OF-CONDUCT \
328 .dir-locals.el \
329 build-aux/build-self.scm \
330 build-aux/compile-all.scm \
331 build-aux/hydra/gnu-system.scm \
332 build-aux/hydra/demo-os.scm \
333 build-aux/hydra/guix.scm \
334 build-aux/check-available-binaries.scm \
335 build-aux/check-final-inputs-self-contained.scm \
336 build-aux/download.scm \
337 build-aux/make-binary-tarball.scm \
338 build-aux/generate-authors.scm \
339 srfi/srfi-37.scm.in \
340 srfi/srfi-64.scm \
341 srfi/srfi-64.upstream.scm \
342 tests/test.drv \
343 tests/signing-key.pub \
344 tests/signing-key.sec \
345 tests/cve-sample.xml \
346 build-aux/config.rpath \
347 bootstrap \
348 release.nix \
349 $(TESTS)
350
351 if !BUILD_DAEMON_OFFLOAD
352
353 EXTRA_DIST += \
354 guix/scripts/offload.scm
355
356 endif !BUILD_DAEMON_OFFLOAD
357
358 if !BUILD_SYSCALLS_MODULE
359
360 EXTRA_DIST += \
361 guix/build/syscalls.scm
362
363 endif !BUILD_SYSCALLS_MODULE
364
365
366 CLEANFILES = \
367 $(GOBJECTS) \
368 $(SCM_TESTS:tests/%.scm=%.log)
369
370 # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
371 # $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
372 # there that are newer than the local .scm files (for instance because the
373 # user ran 'make install' recently). When that happens, we end up loading
374 # those previously-installed .go files, which may be stale, thereby breaking
375 # the whole thing.
376 %.go: make-go ; @:
377 make-go: $(MODULES) guix/config.scm guix/tests.scm
378 $(AM_V_at)echo "Compiling Scheme modules..." ; \
379 unset GUILE_LOAD_COMPILED_PATH ; \
380 host=$(host) srcdir="$(top_srcdir)" \
381 $(top_builddir)/pre-inst-env \
382 $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)" \
383 --no-auto-compile \
384 -s "$(top_srcdir)"/build-aux/compile-all.scm $^
385
386 SUFFIXES = .go
387
388 # Make sure source files are installed first, so that the mtime of
389 # installed compiled files is greater than that of installed source
390 # files. See
391 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
392 # for details.
393 guix_install_go_files = install-nobase_nodist_guilemoduleDATA
394 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
395
396 # The above trick doesn't work for 'config.go' because both 'config.scm' and
397 # 'config.go' are listed in $(nobase_nodist_guilemodule_DATA). Thus, give it
398 # special treatment.
399 install-data-hook: set-bootstrap-executable-permissions
400 touch "$(DESTDIR)$(guilemoduledir)/guix/config.go"
401
402
403 SUBDIRS = po/guix po/packages
404 BUILT_SOURCES =
405
406 include doc.am
407
408 if BUILD_DAEMON
409
410 include daemon.am
411
412 endif BUILD_DAEMON
413
414 ACLOCAL_AMFLAGS = -I m4
415 AM_DISTCHECK_CONFIGURE_FLAGS = \
416 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
417 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
418 --with-nix-prefix="$(NIX_PREFIX)" \
419 --enable-daemon
420
421 dist_emacsui_DATA = emacs/guix-main.scm
422 nodist_emacsui_DATA = emacs/guix-helper.scm
423 include emacs.am
424
425 # The self-contained tarball.
426 guix-binary.%.tar.xz:
427 $(AM_V_GEN)GUIX_PACKAGE_PATH= \
428 $(top_builddir)/pre-inst-env "$(GUILE)" \
429 "$(top_srcdir)/build-aux/make-binary-tarball.scm" "$*" "$@"
430
431
432 dist-hook: sync-descriptions gen-ChangeLog gen-AUTHORS
433 dist-hook: assert-no-store-file-names
434
435 distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
436
437 sync-descriptions:
438 $(AM_V_at)GUIX_PACKAGE_PATH= \
439 $(top_builddir)/pre-inst-env guix lint --checkers=gnu-description
440
441 gen-ChangeLog:
442 $(AM_V_GEN)if test -d .git; then \
443 $(top_srcdir)/build-aux/gitlog-to-changelog \
444 > $(distdir)/cl-t; \
445 rm -f $(distdir)/ChangeLog; \
446 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
447 fi
448
449 gen-AUTHORS:
450 $(AM_V_GEN)if test -d .git; then \
451 rm -f "$(distdir)/AUTHORS"; \
452 $(top_builddir)/pre-inst-env "$(GUILE)" \
453 "$(top_srcdir)/build-aux/generate-authors.scm" \
454 "$(top_srcdir)" "$(distdir)/AUTHORS"; \
455 fi
456
457 # Make sure we're not shipping a file that embeds a local /gnu/store file name.
458 assert-no-store-file-names:
459 $(AM_V_at)if grep -r --exclude=*.texi --exclude=*.info \
460 "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
461 then \
462 echo "error: store file names embedded in the distribution" >&2 ; \
463 exit 1 ; \
464 fi
465
466 # Make sure hydra.gnu.org has the important binaries.
467 assert-binaries-available:
468 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
469 "$(top_srcdir)/build-aux/check-available-binaries.scm"
470
471 # Make sure the final inputs don't refer to bootstrap tools.
472 assert-final-inputs-self-contained:
473 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
474 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
475
476 .PHONY: sync-descriptions gen-ChangeLog gen-AUTHORS clean-go make-go
477 .PHONY: assert-no-store-file-names assert-binaries-available
478 .PHONY: assert-final-inputs-self-contained
479
480 ## -------------- ##
481 ## Silent rules. ##
482 ## -------------- ##
483
484 AM_V_DL = $(AM_V_DL_$(V))
485 AM_V_DL_ = $(AM_V_DL_$(AM_DEFAULT_VERBOSITY))
486 AM_V_DL_0 = @echo " DL " $@;
487
488 AM_V_DOT = $(AM_V_DOT_$(V))
489 AM_V_DOT_ = $(AM_V_DOT_$(AM_DEFAULT_VERBOSITY))
490 AM_V_DOT_0 = @echo " DOT " $@;
491
492 AM_V_EMACS = $(AM_V_EMACS_$(V))
493 AM_V_EMACS_ = $(AM_V_EMACS_$(AM_DEFAULT_VERBOSITY))
494 AM_V_EMACS_0 = @echo " EMACS " $@;
495
496 AM_V_HELP2MAN = $(AM_V_HELP2MAN_$(V))
497 AM_V_HELP2MAN_ = $(AM_V_HELP2MAN_$(AM_DEFAULT_VERBOSITY))
498 AM_V_HELP2MAN_0 = @echo " HELP2MAN" $@;