distro: Add Flex.
[jackhill/guix/guix.git] / Makefile.am
1 # Guix --- Nix package management from Guile. -*- coding: utf-8 -*-
2 # Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
3 #
4 # This file is part of Guix.
5 #
6 # Guix is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or (at
9 # your option) any later version.
10 #
11 # Guix is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with Guix. If not, see <http://www.gnu.org/licenses/>.
18
19 bin_SCRIPTS = \
20 guix-build \
21 guix-download \
22 guix-import \
23 guix-package
24
25 MODULES = \
26 guix/base32.scm \
27 guix/utils.scm \
28 guix/derivations.scm \
29 guix/download.scm \
30 guix/build-system.scm \
31 guix/build-system/gnu.scm \
32 guix/build-system/trivial.scm \
33 guix/ftp-client.scm \
34 guix/store.scm \
35 guix/ui.scm \
36 guix/build/download.scm \
37 guix/build/gnu-build-system.scm \
38 guix/build/utils.scm \
39 guix/build/union.scm \
40 guix/packages.scm \
41 guix/snix.scm \
42 guix.scm \
43 distro.scm \
44 distro/packages/base.scm \
45 distro/packages/bash.scm \
46 distro/packages/bdw-gc.scm \
47 distro/packages/bison.scm \
48 distro/packages/bootstrap.scm \
49 distro/packages/compression.scm \
50 distro/packages/ed.scm \
51 distro/packages/flex.scm \
52 distro/packages/gawk.scm \
53 distro/packages/gdbm.scm \
54 distro/packages/gnupg.scm \
55 distro/packages/gnutls.scm \
56 distro/packages/gperf.scm \
57 distro/packages/guile.scm \
58 distro/packages/help2man.scm \
59 distro/packages/ld-wrapper.scm \
60 distro/packages/libffi.scm \
61 distro/packages/libsigsegv.scm \
62 distro/packages/libtool.scm \
63 distro/packages/libunistring.scm \
64 distro/packages/lout.scm \
65 distro/packages/m4.scm \
66 distro/packages/make-bootstrap.scm \
67 distro/packages/multiprecision.scm \
68 distro/packages/ncurses.scm \
69 distro/packages/nettle.scm \
70 distro/packages/perl.scm \
71 distro/packages/pkg-config.scm \
72 distro/packages/pth.scm \
73 distro/packages/readline.scm \
74 distro/packages/recutils.scm \
75 distro/packages/system.scm \
76 distro/packages/texinfo.scm \
77 distro/packages/zile.scm
78
79
80 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go
81
82 nobase_dist_guilemodule_DATA = $(MODULES)
83
84 patchdir = $(pkgdatadir)/patches
85 dist_patch_DATA = \
86 distro/packages/patches/binutils-ld-new-dtags.patch \
87 distro/packages/patches/diffutils-gets-undeclared.patch \
88 distro/packages/patches/flex-bison-tests.patch \
89 distro/packages/patches/glibc-no-ld-so-cache.patch \
90 distro/packages/patches/guile-1.8-cpp-4.5.patch \
91 distro/packages/patches/guile-default-utf8.patch \
92 distro/packages/patches/guile-relocatable.patch \
93 distro/packages/patches/libtool-skip-tests.patch \
94 distro/packages/patches/m4-gets-undeclared.patch \
95 distro/packages/patches/m4-readlink-EINVAL.patch \
96 distro/packages/patches/m4-s_isdir.patch \
97 distro/packages/patches/make-impure-dirs.patch \
98 distro/packages/patches/findutils-absolute-paths.patch \
99 distro/packages/patches/perl-no-sys-dirs.patch \
100 distro/packages/patches/readline-link-ncurses.patch \
101 distro/packages/patches/tar-gets-undeclared.patch
102
103 bootstrapdir = $(pkgdatadir)/bootstrap
104 bootstrap_x86_64_linuxdir = $(bootstrapdir)/x86_64-linux
105 bootstrap_i686_linuxdir = $(bootstrapdir)/i686-linux
106
107 dist_bootstrap_x86_64_linux_DATA = \
108 distro/packages/bootstrap/x86_64-linux/bash \
109 distro/packages/bootstrap/x86_64-linux/mkdir \
110 distro/packages/bootstrap/x86_64-linux/tar \
111 distro/packages/bootstrap/x86_64-linux/xz
112
113 dist_bootstrap_i686_linux_DATA = \
114 distro/packages/bootstrap/i686-linux/bash \
115 distro/packages/bootstrap/i686-linux/mkdir \
116 distro/packages/bootstrap/i686-linux/tar \
117 distro/packages/bootstrap/i686-linux/xz
118
119 # Big bootstrap binaries are not included in the tarball. Instead, they
120 # are downloaded.
121 nodist_bootstrap_x86_64_linux_DATA = \
122 distro/packages/bootstrap/x86_64-linux/guile-bootstrap-2.0.6.tar.xz
123 nodist_bootstrap_i686_linux_DATA = \
124 distro/packages/bootstrap/i686-linux/guile-bootstrap-2.0.6.tar.xz
125
126 # Those files must remain executable, so they remain executable once
127 # imported into the store.
128 install-data-hook:
129 chmod +x $(DESTDIR)$(bootstrapdir)/*/{bash,mkdir,tar,xz}
130
131 DISTCLEANFILES = \
132 $(nodist_bootstrap_x86_64_linux_DATA) \
133 $(nodist_bootstrap_i686_linux_DATA)
134
135 # Method to download a file from an external source.
136 DOWNLOAD_FILE = \
137 GUILE_LOAD_COMPILED_PATH="$(top_builddir):$$GUILE_LOAD_COMPILED_PATH" \
138 $(GUILE) --no-auto-compile -L "$(top_builddir)" -L "$(top_srcdir)" \
139 "$(top_srcdir)/build-aux/download.scm"
140
141 distro/packages/bootstrap/x86_64-linux/guile-bootstrap-2.0.6.tar.xz:
142 $(MKDIR_P) `dirname "$@"`
143 $(DOWNLOAD_FILE) "$@" "0467a82cbe4136f60a79eb4176011bf88cf28ea19c9ad9defa365811ff8e11cf"
144 distro/packages/bootstrap/i686-linux/guile-bootstrap-2.0.6.tar.xz:
145 $(MKDIR_P) `dirname "$@"`
146 $(DOWNLOAD_FILE) "$@" "93b537766dfab3ad287143523751e3ec02dd32d3ccaf88ad2d31c63158f342ee"
147
148 nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
149
150 TESTS = \
151 tests/base32.scm \
152 tests/builders.scm \
153 tests/derivations.scm \
154 tests/utils.scm \
155 tests/build-utils.scm \
156 tests/packages.scm \
157 tests/snix.scm \
158 tests/union.scm \
159 tests/guix-build.sh \
160 tests/guix-download.sh \
161 tests/guix-package.sh
162
163 TEST_EXTENSIONS = .scm .sh
164
165 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
166
167 SCM_LOG_COMPILER = $(top_builddir)/pre-inst-env $(GUILE)
168 AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)"
169
170 SH_LOG_COMPILER = $(top_builddir)/pre-inst-env $(SHELL)
171 AM_SH_LOG_FLAGS = -x -e
172
173 EXTRA_DIST = \
174 HACKING \
175 ROADMAP \
176 TODO \
177 .dir-locals.el \
178 hydra.scm \
179 build-aux/download.scm \
180 srfi/srfi-64.scm \
181 srfi/srfi-64.upstream.scm \
182 tests/test.drv \
183 build-aux/config.rpath \
184 release.nix \
185 $(TESTS)
186
187 CLEANFILES = $(GOBJECTS) *.log
188
189 .scm.go:
190 $(MKDIR_P) `dirname "$@"`
191 DISTRO_INSTALLED_PATCH_DIRECTORY="$(patchdir)" \
192 DISTRO_INSTALLED_BOOTSTRAP_DIRECTORY="$(bootstrapdir)" \
193 $(top_builddir)/pre-inst-env \
194 $(GUILD) compile -L "$(top_builddir)" -L "$(top_srcdir)" \
195 -Wformat -Wunbound-variable -Warity-mismatch \
196 --target="$(host)" \
197 -o "$@" "$<"
198
199 SUFFIXES = .go
200
201 # Make sure source files are installed first, so that the mtime of
202 # installed compiled files is greater than that of installed source
203 # files. See
204 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
205 # for details.
206 guix_install_go_files = install-nobase_nodist_guilemoduleDATA
207 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
208
209 SUBDIRS = po
210
211 info_TEXINFOS = doc/guix.texi
212 EXTRA_DIST += doc/fdl-1.3.texi
213
214 ACLOCAL_AMFLAGS = -I m4
215 AM_DISTCHECK_CONFIGURE_FLAGS = \
216 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
217 --with-nix-prefix="$(NIX_PREFIX)"