Commit | Line | Data |
---|---|---|
e29834b8 MW |
1 | ### -*-makefile-*- |
2 | ### | |
3 | ### Build script for `runlisp' | |
4 | ### | |
5 | ### (c) 2020 Mark Wooding | |
6 | ### | |
7 | ||
8 | ###----- Licensing notice --------------------------------------------------- | |
9 | ### | |
10 | ### This file is part of Runlisp, a tool for invoking Common Lisp scripts. | |
11 | ### | |
12 | ### Runlisp is free software: you can redistribute it and/or modify it | |
13 | ### under the terms of the GNU General Public License as published by the | |
14 | ### Free Software Foundation; either version 3 of the License, or (at your | |
15 | ### option) any later version. | |
16 | ### | |
17 | ### Runlisp is distributed in the hope that it will be useful, but WITHOUT | |
18 | ### ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
19 | ### FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
20 | ### for more details. | |
21 | ### | |
22 | ### You should have received a copy of the GNU General Public License | |
23 | ### along with Runlisp. If not, see <https://www.gnu.org/licenses/>. | |
24 | ||
25 | include $(top_srcdir)/vars.am | |
26 | ||
27 | SUBDIRS = | |
28 | ||
e29834b8 MW |
29 | image_DATA = |
30 | image_SCRIPTS = | |
31 | ||
32 | SUBDIRS += . | |
33 | ||
34 | ACLOCAL_AMFLAGS = -Im4 | |
35 | ||
36 | ###-------------------------------------------------------------------------- | |
8996f767 MW |
37 | ### A library of common code. |
38 | ||
39 | noinst_LIBRARIES += librunlisp.a | |
40 | librunlisp_a_SOURCES = | |
41 | ||
42 | librunlisp_a_SOURCES += common.c common.h | |
43 | librunlisp_a_SOURCES += lib.c lib.h | |
44 | librunlisp_a_SOURCES += mdwopt.c mdwopt.h | |
10427eb2 | 45 | librunlisp_a_SOURCES += sha256.c sha256.h |
8996f767 MW |
46 | |
47 | ###-------------------------------------------------------------------------- | |
e29834b8 MW |
48 | ### The main driver program. |
49 | ||
50 | bin_PROGRAMS += runlisp | |
51 | runlisp_SOURCES = runlisp.c | |
8996f767 | 52 | runlisp_LDADD = librunlisp.a |
e29834b8 | 53 | man_MANS += runlisp.1 |
8996f767 | 54 | doc_DATA += runlisp.pdf |
10427eb2 | 55 | EXTRA_DIST += runlisp.1.in |
7b8ff279 | 56 | |
e29834b8 MW |
57 | ###-------------------------------------------------------------------------- |
58 | ### Additional machinery. | |
59 | ||
60 | pkgdata_DATA += eval.lisp | |
61 | EXTRA_DIST += eval.lisp | |
62 | ||
10427eb2 | 63 | pkgdata_SCRIPTS += dump-ecl |
8996f767 MW |
64 | EXTRA_DIST += dump-ecl |
65 | ||
66 | bin_PROGRAMS += query-runlisp-config | |
67 | query_runlisp_config_SOURCES = query-runlisp-config.c | |
68 | query_runlisp_config_LDADD = librunlisp.a | |
69 | man_MANS += query-runlisp-config.1 | |
70 | doc_DATA += query-runlisp-config.pdf | |
10427eb2 | 71 | EXTRA_DIST += query-runlisp-config.1.in |
8996f767 MW |
72 | |
73 | man_MANS += runlisp.conf.5 | |
74 | doc_DATA += runlisp.conf.pdf | |
10427eb2 | 75 | EXTRA_DIST += runlisp.conf.5.in |
8996f767 MW |
76 | |
77 | EXTRA_DIST += runlisp-base.conf | |
78 | install-data-hook:: | |
79 | $(MKDIR_P) $(DESTDIR)$(pkgconfdir)/runlisp.d | |
80 | cp $(srcdir)/runlisp-base.conf \ | |
81 | $(DESTDIR)$(pkgconfdir)/runlisp.d/0base.conf | |
82 | uninstall-hook:: | |
83 | rm -f $(DESTDIR)$(pkgconfdir)/runlisp.d/0base.conf | |
84 | ||
85 | EXTRA_DIST += runlisp.conf | |
86 | install-data-hook:: | |
87 | $(MKDIR_P) $(DESTDIR)$(pkgconfdir) | |
88 | if ! [ -f $(DESTDIR)$(pkgconfdir)/runlisp.conf ]; then \ | |
89 | cp $(srcdir)/runlisp.conf $(DESTDIR)$(pkgconfdir)/; \ | |
90 | fi | |
91 | uninstall-hook:: | |
92 | rm -f $(DESTDIR)$(pkgconfdir)/runlisp.conf | |
93 | ||
e29834b8 MW |
94 | ###-------------------------------------------------------------------------- |
95 | ### Image dumping. | |
96 | ||
7b8ff279 MW |
97 | bin_PROGRAMS += dump-runlisp-image |
98 | dump_runlisp_image_SOURCES = dump-runlisp-image.c | |
8996f767 | 99 | dump_runlisp_image_LDADD = librunlisp.a |
e29834b8 | 100 | man_MANS += dump-runlisp-image.1 |
8996f767 | 101 | doc_DATA += dump-runlisp-image.pdf |
10427eb2 | 102 | EXTRA_DIST += dump-runlisp-image.1.in |
e29834b8 | 103 | |
328a0d48 | 104 | DUMP_RUNLISP_IMAGE = $(v_dump)./dump-runlisp-image -f -O$@ \ |
7615305f MW |
105 | -c$(srcdir)/runlisp-base.conf \ |
106 | -odata-dir=$(srcdir) | |
7b8ff279 | 107 | |
e29834b8 MW |
108 | v_dump = $(v_dump_@AM_V@) |
109 | v_dump_ = $(v_dump_@AM_DEFAULT_V@) | |
110 | v_dump_0 = @echo " DUMP $@"; | |
111 | ||
6c39ec6d MW |
112 | IMAGES = |
113 | noinst_DATA += $(IMAGES) | |
114 | ||
e29834b8 | 115 | if DUMP_SBCL |
6c39ec6d | 116 | IMAGES += sbcl+asdf.core |
e29834b8 | 117 | CLEANFILES += sbcl+asdf.core |
8996f767 | 118 | sbcl+asdf.core: dump-runlisp-image runlisp-base.conf |
7b8ff279 | 119 | $(DUMP_RUNLISP_IMAGE) sbcl |
e29834b8 MW |
120 | endif |
121 | ||
122 | if DUMP_CCL | |
6c39ec6d | 123 | IMAGES += ccl+asdf.image |
e29834b8 | 124 | CLEANFILES += ccl+asdf.image |
8996f767 | 125 | ccl+asdf.image: dump-runlisp-image runlisp-base.conf |
7b8ff279 | 126 | $(DUMP_RUNLISP_IMAGE) ccl |
e29834b8 MW |
127 | endif |
128 | ||
129 | if DUMP_CLISP | |
6c39ec6d | 130 | IMAGES += clisp+asdf.mem |
e29834b8 | 131 | CLEANFILES += clisp+asdf.mem |
8996f767 | 132 | clisp+asdf.mem: dump-runlisp-image runlisp-base.conf |
7b8ff279 | 133 | $(DUMP_RUNLISP_IMAGE) clisp |
e29834b8 MW |
134 | endif |
135 | ||
136 | if DUMP_ECL | |
6c39ec6d | 137 | IMAGES += ecl+asdf |
e29834b8 | 138 | CLEANFILES += ecl+asdf |
8996f767 | 139 | ecl+asdf: dump-runlisp-image runlisp-base.conf dump-ecl |
7615305f | 140 | $(DUMP_RUNLISP_IMAGE) ecl |
e29834b8 MW |
141 | endif |
142 | ||
143 | if DUMP_CMUCL | |
6c39ec6d | 144 | IMAGES += cmucl+asdf.core |
e29834b8 | 145 | CLEANFILES += cmucl+asdf.core |
8996f767 | 146 | cmucl+asdf.core: dump-runlisp-image runlisp-base.conf |
7b8ff279 | 147 | $(DUMP_RUNLISP_IMAGE) cmucl |
e29834b8 MW |
148 | endif |
149 | ||
6c39ec6d MW |
150 | install-data-hook:: |
151 | mkdir -p $(DESTDIR)$(imagedir) | |
152 | set -e; for i in $(IMAGES); do \ | |
153 | j=$$(readlink $$i); \ | |
154 | cp $$j $(DESTDIR)$(imagedir)/$$j.new && \ | |
155 | mv $(DESTDIR)$(imagedir)/$$j.new \ | |
156 | $(DESTDIR)$(imagedir)/$$j; \ | |
157 | ln -sf $$j $(DESTDIR)$(imagedir)/$$i; \ | |
158 | done | |
159 | ||
160 | uninstall-hook:: | |
161 | set -e; for i in $(IMAGES); do \ | |
162 | if j=$$(readlink $(DESTDIR)$(imagedir)/$$i); then \ | |
163 | case $$j in \ | |
164 | $$i-*[!0-9a-f]) ;; \ | |
165 | $$i-*) rm -f $(DESTDIR)$(imagedir)/$$j ;; \ | |
166 | esac; \ | |
167 | fi; \ | |
168 | rm -f $(DESTDIR)$(imagedir)/$$i; \ | |
169 | done | |
170 | ||
e29834b8 | 171 | ###-------------------------------------------------------------------------- |
8996f767 | 172 | ### Other subdirectories. |
e29834b8 | 173 | |
8996f767 MW |
174 | ## Documentation. |
175 | SUBDIRS += doc | |
176 | ||
177 | ## Testing. | |
178 | SUBDIRS += t | |
179 | ||
180 | ## Benchmarking. | |
e29834b8 MW |
181 | if BENCHMARK |
182 | SUBDIRS += bench | |
183 | endif | |
184 | ||
e29834b8 MW |
185 | ###-------------------------------------------------------------------------- |
186 | ### Distribution. | |
187 | ||
188 | ## Release number. | |
189 | dist-hook:: | |
190 | echo $(VERSION) >$(distdir)/RELEASE | |
191 | ||
192 | ## Additional build tools. | |
193 | EXTRA_DIST += config/auto-version | |
194 | ||
195 | ###----- That's all, folks -------------------------------------------------- |