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