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