build-system/gnu: Distinguish between imported modules and used modules.
[jackhill/guix/guix.git] / Makefile.am
CommitLineData
af51c820
LC
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
c52a5bf0
LC
19bin_SCRIPTS = \
20 guix-build \
21 guix-download
14a1c319 22
af51c820 23MODULES = \
73fbb904 24 guix/utils.scm \
af51c820 25 guix/derivations.scm \
208f7cd1
LC
26 guix/build-system.scm \
27 guix/build-system/gnu.scm \
be13fbfa 28 guix/build-system/trivial.scm \
457dd86d
LC
29 guix/ftp.scm \
30 guix/ftp-client.scm \
af51c820
LC
31 guix/http.scm \
32 guix/store.scm \
af51c820 33 guix/build/gnu-build-system.scm \
457dd86d 34 guix/build/ftp.scm \
af51c820 35 guix/build/http.scm \
1273d44a 36 guix/build/utils.scm \
c8c88afa 37 guix/build/union.scm \
e3ce5d70
LC
38 guix/packages.scm \
39 guix.scm \
6b1891b0 40 distro.scm \
1f455fdc 41 distro/packages/base.scm \
1722d680
LC
42 distro/packages/databases.scm \
43 distro/packages/guile.scm \
44 distro/packages/ld-wrapper.scm \
45 distro/packages/typesetting.scm
af51c820
LC
46
47GOBJECTS = $(MODULES:%.scm=%.go)
48
800cdeef
LC
49nobase_dist_guilemodule_DATA = $(MODULES)
50
51patchdir = $(pkgdatadir)/patches
bfb3c3d0
LC
52dist_patch_DATA = \
53 distro/packages/patches/binutils-ld-new-dtags.patch \
54 distro/packages/patches/diffutils-gets-undeclared.patch \
55 distro/packages/patches/guile-1.8-cpp-4.5.patch \
56 distro/packages/patches/guile-default-utf8.patch \
57 distro/packages/patches/guile-relocatable.patch \
58 distro/packages/patches/libtool-skip-tests.patch \
59 distro/packages/patches/m4-gets-undeclared.patch \
60 distro/packages/patches/m4-readlink-EINVAL.patch \
61 distro/packages/patches/m4-s_isdir.patch \
62 distro/packages/patches/make-impure-dirs.patch \
63 distro/packages/patches/findutils-absolute-paths.patch \
64 distro/packages/patches/perl-no-sys-dirs.patch \
65 distro/packages/patches/readline-link-ncurses.patch \
66 distro/packages/patches/tar-gets-undeclared.patch
d7672884 67
ac5aa288
LC
68bootstrapdir = $(pkgdatadir)/bootstrap
69bootstrap_x86_64_linuxdir = $(bootstrapdir)/x86_64-linux
d25468bc 70bootstrap_i686_linuxdir = $(bootstrapdir)/i686-linux
ac5aa288
LC
71
72dist_bootstrap_x86_64_linux_DATA = \
73 distro/packages/bootstrap/x86_64-linux/bash \
74 distro/packages/bootstrap/x86_64-linux/mkdir \
75 distro/packages/bootstrap/x86_64-linux/tar \
76 distro/packages/bootstrap/x86_64-linux/xz
77
d25468bc
LC
78dist_bootstrap_i686_linux_DATA = \
79 distro/packages/bootstrap/i686-linux/bash \
80 distro/packages/bootstrap/i686-linux/mkdir \
81 distro/packages/bootstrap/i686-linux/tar \
82 distro/packages/bootstrap/i686-linux/xz
83
ac5aa288
LC
84# Big bootstrap binaries are not included in the tarball. Instead, they
85# are downloaded.
86nodist_bootstrap_x86_64_linux_DATA = \
87 distro/packages/bootstrap/x86_64-linux/guile-bootstrap-2.0.6.tar.xz
d25468bc
LC
88nodist_bootstrap_i686_linux_DATA = \
89 distro/packages/bootstrap/i686-linux/guile-bootstrap-2.0.6.tar.xz
ac5aa288 90
5992f213
LC
91# Those files must remain executable, so they remain executable once
92# imported into the store.
93install-data-hook:
94 chmod +x $(DESTDIR)$(bootstrapdir)/*/{bash,mkdir,tar,xz}
95
d25468bc
LC
96DISTCLEANFILES = \
97 $(nodist_bootstrap_x86_64_linux_DATA) \
98 $(nodist_bootstrap_i686_linux_DATA)
ac5aa288
LC
99
100# Method to download a file from an external source.
101DOWNLOAD_FILE = \
102 GUILE_LOAD_COMPILED_PATH="$(top_builddir):$$GUILE_LOAD_COMPILED_PATH" \
103 $(GUILE) --no-auto-compile -L "$(top_srcdir)" \
104 "$(top_srcdir)/build-aux/download.scm"
105
106distro/packages/bootstrap/x86_64-linux/guile-bootstrap-2.0.6.tar.xz: guix/utils.go
735bb2af 107 $(MKDIR_P) `dirname "$@"`
ac5aa288 108 $(DOWNLOAD_FILE) "$@" "0467a82cbe4136f60a79eb4176011bf88cf28ea19c9ad9defa365811ff8e11cf"
d25468bc 109distro/packages/bootstrap/i686-linux/guile-bootstrap-2.0.6.tar.xz: guix/utils.go
735bb2af 110 $(MKDIR_P) `dirname "$@"`
d25468bc 111 $(DOWNLOAD_FILE) "$@" "93b537766dfab3ad287143523751e3ec02dd32d3ccaf88ad2d31c63158f342ee"
ac5aa288 112
af51c820
LC
113nobase_nodist_guilemodule_DATA = $(GOBJECTS)
114
115TESTS = \
116 tests/builders.scm \
117 tests/derivations.scm \
e3ce5d70 118 tests/utils.scm \
b0e0d0e9 119 tests/build-utils.scm \
c8c88afa
LC
120 tests/packages.scm \
121 tests/union.scm
af51c820 122
e1e7b29a 123LOG_COMPILER = \
9b9b6f3d 124 $(top_builddir)/pre-inst-env \
5f904ffb 125 $(GUILE) --no-auto-compile -L "$(top_srcdir)"
af51c820 126
ed795c06 127EXTRA_DIST = \
450ccdc3 128 HACKING \
1722d680 129 .dir-locals.el \
ac5aa288 130 build-aux/download.scm \
ed795c06
LC
131 srfi/srfi-64.scm \
132 srfi/srfi-64.upstream.scm \
d95c0113 133 tests/test.drv \
ed795c06
LC
134 build-aux/config.rpath \
135 release.nix \
136 $(TESTS)
d7672884 137
af51c820
LC
138CLEANFILES = $(GOBJECTS) *.log
139
140.scm.go:
141 $(MKDIR_P) `dirname "$@"`
fc2f3802
LC
142 DISTRO_INSTALLED_PATCH_DIRECTORY="$(patchdir)" \
143 DISTRO_INSTALLED_BOOTSTRAP_DIRECTORY="$(bootstrapdir)" \
144 $(top_builddir)/pre-inst-env \
145 $(GUILD) compile -L "$(top_srcdir)" \
146 -Wformat -Wunbound-variable -Warity-mismatch \
147 --target="$(host)" \
af51c820
LC
148 -o "$@" "$<"
149
150SUFFIXES = .go
151
152# Make sure source files are installed first, so that the mtime of
153# installed compiled files is greater than that of installed source
154# files. See
155# <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
156# for details.
157guix_install_go_files = install-nobase_nodist_guilemoduleDATA
158$(guix_install_go_files): install-nobase_dist_guilemoduleDATA
f68b0893
LC
159
160SUBDIRS = po
161
568717fd
LC
162info_TEXINFOS = doc/guix.texi
163EXTRA_DIST += doc/fdl-1.3.texi
164
f68b0893 165ACLOCAL_AMFLAGS = -I m4
437e0729
LC
166AM_DISTCHECK_CONFIGURE_FLAGS = \
167 --with-nixpkgs=$(NIXPKGS) --with-nix-prefix="$(NIX_PREFIX)"