packages: Allow file names as package sources.
[jackhill/guix/guix.git] / Makefile.am
CommitLineData
233e7676
LC
1# GNU Guix --- Functional package management for GNU
2# Copyright © 2012, 2013 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 = \
e49951eb
MW
30 guix/scripts/build.scm \
31 guix/scripts/download.scm \
32 guix/scripts/import.scm \
33 guix/scripts/package.scm \
34 guix/scripts/gc.scm \
6c365eca 35 guix/scripts/hash.scm \
f651b477 36 guix/scripts/pull.scm \
f65cf81a 37 guix/scripts/substitute-binary.scm \
0fdd3bea 38 guix/scripts/refresh.scm \
ddc29a78 39 guix/base32.scm \
c0cd1b3e 40 guix/records.scm \
72626a71 41 guix/hash.scm \
73fbb904 42 guix/utils.scm \
0f41c26f
LC
43 guix/serialization.scm \
44 guix/nar.scm \
af51c820 45 guix/derivations.scm \
62cab99c 46 guix/download.scm \
22189ed1 47 guix/gnu-maintenance.scm \
838d78e3 48 guix/licenses.scm \
208f7cd1 49 guix/build-system.scm \
c6bded8a 50 guix/build-system/cmake.scm \
208f7cd1 51 guix/build-system/gnu.scm \
08fd1ebe 52 guix/build-system/perl.scm \
40506d5d 53 guix/build-system/python.scm \
be13fbfa 54 guix/build-system/trivial.scm \
457dd86d 55 guix/ftp-client.scm \
3b8258c5 56 guix/http-client.scm \
0fdd3bea 57 guix/gnupg.scm \
af51c820 58 guix/store.scm \
073c34d7 59 guix/ui.scm \
62cab99c 60 guix/build/download.scm \
c6bded8a 61 guix/build/cmake-build-system.scm \
af51c820 62 guix/build/gnu-build-system.scm \
08fd1ebe 63 guix/build/perl-build-system.scm \
40506d5d 64 guix/build/python-build-system.scm \
1273d44a 65 guix/build/utils.scm \
c8c88afa 66 guix/build/union.scm \
3309e3a1 67 guix/build/rpath.scm \
e3ce5d70 68 guix/packages.scm \
10226c05 69 guix/snix.scm \
e3ce5d70 70 guix.scm \
d516736c 71 $(GNU_SYSTEM_MODULES)
af51c820 72
855a8ad7
LC
73# Because of the autoload hack in (guix build download), we must build it
74# first to avoid errors on systems where (gnutls) is unavailable.
75guix/scripts/download.go: guix/build/download.go
c44899a2 76
1959fb04 77
00e219d1 78GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go
af51c820 79
800cdeef 80nobase_dist_guilemodule_DATA = $(MODULES)
1959fb04 81nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
800cdeef 82
1959fb04
LC
83# Do we need to provide our own non-broken (srfi srfi-37) module?
84if INSTALL_SRFI_37
85
86nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
87GOBJECTS += srfi/srfi-37.go
88
89srfi/srfi-37.scm: srfi/srfi-37.scm.in
90 $(MKDIR_P) srfi
91 cp "$<" "$@"
92
93endif INSTALL_SRFI_37
ac5aa288 94
af51c820 95
30dd8310 96SCM_TESTS = \
ddc29a78 97 tests/base32.scm \
69927e78 98 tests/hash.scm \
af51c820
LC
99 tests/builders.scm \
100 tests/derivations.scm \
299112d3 101 tests/ui.scm \
c0cd1b3e 102 tests/records.scm \
e3ce5d70 103 tests/utils.scm \
b0e0d0e9 104 tests/build-utils.scm \
c8c88afa 105 tests/packages.scm \
10226c05 106 tests/snix.scm \
3259877d 107 tests/store.scm \
53c63ee9 108 tests/nar.scm \
30dd8310
LC
109 tests/union.scm
110
111SH_TESTS = \
0afdc485 112 tests/guix-build.sh \
37d19403 113 tests/guix-download.sh \
fe8ff028 114 tests/guix-gc.sh \
ccbce848 115 tests/guix-hash.sh \
0afdc485 116 tests/guix-package.sh
af51c820 117
30dd8310
LC
118TESTS = $(SCM_TESTS) $(SH_TESTS)
119
97298ffa
LC
120TEST_EXTENSIONS = .scm .sh
121
352ec143
LC
122AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
123
69cfce50 124SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE)
97298ffa
LC
125AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)"
126
69cfce50 127SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
97298ffa 128AM_SH_LOG_FLAGS = -x -e
af51c820 129
3a33730a
LC
130# Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
131# could end up removing files from the store while they are being used by
132# other instances of the daemon.
133tests/guix-gc.log: \
134 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
135 $(SCM_TESTS:%.scm=%.log)
136
137
ed795c06 138EXTRA_DIST = \
450ccdc3 139 HACKING \
b6dd891c 140 ROADMAP \
6b8875c8 141 TODO \
1722d680 142 .dir-locals.el \
f3211ef3 143 build-aux/hydra/gnu-system.scm \
56fbf262 144 build-aux/check-available-binaries.scm \
ac5aa288 145 build-aux/download.scm \
b592f711 146 build-aux/list-packages.scm \
0e993428 147 build-aux/sync-synopses.scm \
1959fb04 148 srfi/srfi-37.scm.in \
ed795c06
LC
149 srfi/srfi-64.scm \
150 srfi/srfi-64.upstream.scm \
d95c0113 151 tests/test.drv \
ed795c06 152 build-aux/config.rpath \
b49ffe2d 153 bootstrap \
ed795c06
LC
154 release.nix \
155 $(TESTS)
d7672884 156
30dd8310
LC
157CLEANFILES = \
158 $(GOBJECTS) \
9bff16b3 159 $(SCM_TESTS:tests/%.scm=%.log)
af51c820 160
dab5d51b
LC
161AM_V_GUILEC = $(AM_V_GUILEC_$(V))
162AM_V_GUILEC_ = $(AM_V_GUILEC_$(AM_DEFAULT_VERBOSITY))
163AM_V_GUILEC_0 = @echo " GUILEC" $@;
164
a69b7ad2
LC
165# XXX: Use the C locale for when Guile lacks
166# <http://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f>.
af51c820 167.scm.go:
dab5d51b 168 $(AM_V_GUILEC)$(MKDIR_P) `dirname "$@"` ; \
a69b7ad2 169 LC_ALL=C \
671d8f5e
LC
170 $(top_builddir)/pre-inst-env \
171 $(GUILD) compile -L "$(top_builddir)" -L "$(top_srcdir)" \
172 -Wformat -Wunbound-variable -Warity-mismatch \
173 --target="$(host)" \
af51c820
LC
174 -o "$@" "$<"
175
176SUFFIXES = .go
177
178# Make sure source files are installed first, so that the mtime of
179# installed compiled files is greater than that of installed source
180# files. See
181# <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
182# for details.
183guix_install_go_files = install-nobase_nodist_guilemoduleDATA
184$(guix_install_go_files): install-nobase_dist_guilemoduleDATA
f68b0893
LC
185
186SUBDIRS = po
187
568717fd 188info_TEXINFOS = doc/guix.texi
401c53c4
LC
189EXTRA_DIST += \
190 doc/fdl-1.3.texi \
191 doc/images/bootstrap-graph.dot \
192 doc/images/bootstrap-graph.eps
193
194infoimagedir = $(infodir)/images
195dist_infoimage_DATA = doc/images/bootstrap-graph.png
196
197# Try hard to obtain an image size and aspect that's reasonable for inclusion
198# in an Info or PDF document.
199DOT_OPTIONS = \
200 -Tpng -Gratio=.9 -Gnodesep=.005 -Granksep=.00005 \
201 -Nfontsize=9 -Nheight=.1 -Nwidth=.1
202
203.dot.png:
204 dot -Tpng $(DOT_OPTIONS) < "$<" > "$@.tmp"
205 mv "$@.tmp" "$@"
206
207.dot.eps:
208 dot -Teps $(DOT_OPTIONS) < "$<" > "$@.tmp"
209 mv "$@.tmp" "$@"
210
211doc/guix.pdf: doc/images/bootstrap-graph.png
212doc/guix.info: doc/images/bootstrap-graph.png
213doc/guix.ps: doc/images/bootstrap-graph.eps
568717fd 214
c2033df4
LC
215if BUILD_DAEMON
216
217include daemon.am
218
219endif BUILD_DAEMON
220
f68b0893 221ACLOCAL_AMFLAGS = -I m4
e76bdf8b 222AM_DISTCHECK_CONFIGURE_FLAGS = \
d388c2c4 223 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
aca54b39
LC
224 --with-nix-prefix="$(NIX_PREFIX)" \
225 --enable-daemon
0e993428 226
a463ffd9 227dist-hook: sync-synopses gen-ChangeLog assert-no-store-file-names
56fbf262 228distcheck-hook: assert-binaries-available
e793178a
LC
229
230sync-synopses:
0e993428
LC
231 -$(top_builddir)/pre-inst-env $(GUILE) \
232 $(top_srcdir)/build-aux/sync-synopses.scm
e793178a
LC
233
234gen-ChangeLog:
235 if test -d .git; then \
236 $(top_srcdir)/build-aux/gitlog-to-changelog \
237 > $(distdir)/cl-t; \
238 rm -f $(distdir)/ChangeLog; \
239 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
240 fi
241
a463ffd9
LC
242# Make sure we're not shipping a file that embeds a local /nix/store file name.
243assert-no-store-file-names:
244 if grep -r --exclude=*.texi --exclude=*.info \
245 "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
246 then \
247 echo "error: store file names embedded in the distribution" >&2 ; \
248 exit 1 ; \
249 fi
250
56fbf262
LC
251# Make sure hydra.gnu.org has the important binaries.
252assert-binaries-available:
253 $(top_builddir)/pre-inst-env "$(GUILE)" \
254 "$(top_srcdir)/build-aux/check-available-binaries.scm"
255
256.PHONY: sync-synopses gen-ChangeLog
257.PHONY: assert-no-store-file-names assert-binaries-available