chiark / gitweb /
Makefile.am: Rearrange the `dump-runlisp-image' options.
[runlisp] / Makefile.am
... / ...
CommitLineData
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
25include $(top_srcdir)/vars.am
26
27SUBDIRS =
28
29image_DATA =
30image_SCRIPTS =
31
32SUBDIRS += .
33
34ACLOCAL_AMFLAGS = -Im4
35
36###--------------------------------------------------------------------------
37### A library of common code.
38
39noinst_LIBRARIES += librunlisp.a
40librunlisp_a_SOURCES =
41
42librunlisp_a_SOURCES += common.c common.h
43librunlisp_a_SOURCES += lib.c lib.h
44librunlisp_a_SOURCES += mdwopt.c mdwopt.h
45librunlisp_a_SOURCES += sha256.c sha256.h
46
47###--------------------------------------------------------------------------
48### The main driver program.
49
50bin_PROGRAMS += runlisp
51runlisp_SOURCES = runlisp.c
52runlisp_LDADD = librunlisp.a
53man_MANS += runlisp.1
54doc_DATA += runlisp.pdf
55EXTRA_DIST += runlisp.1.in
56
57###--------------------------------------------------------------------------
58### Additional machinery.
59
60pkgdata_DATA += eval.lisp
61EXTRA_DIST += eval.lisp
62
63pkgdata_SCRIPTS += dump-ecl
64EXTRA_DIST += dump-ecl
65
66bin_PROGRAMS += query-runlisp-config
67query_runlisp_config_SOURCES = query-runlisp-config.c
68query_runlisp_config_LDADD = librunlisp.a
69man_MANS += query-runlisp-config.1
70doc_DATA += query-runlisp-config.pdf
71EXTRA_DIST += query-runlisp-config.1.in
72
73man_MANS += runlisp.conf.5
74doc_DATA += runlisp.conf.pdf
75EXTRA_DIST += runlisp.conf.5.in
76
77EXTRA_DIST += runlisp-base.conf
78install-data-hook::
79 $(MKDIR_P) $(DESTDIR)$(pkgconfdir)/runlisp.d
80 cp $(srcdir)/runlisp-base.conf \
81 $(DESTDIR)$(pkgconfdir)/runlisp.d/0base.conf
82uninstall-hook::
83 rm -f $(DESTDIR)$(pkgconfdir)/runlisp.d/0base.conf
84
85EXTRA_DIST += runlisp.conf
86install-data-hook::
87 $(MKDIR_P) $(DESTDIR)$(pkgconfdir)
88 if ! [ -f $(DESTDIR)$(pkgconfdir)/runlisp.conf ]; then \
89 cp $(srcdir)/runlisp.conf $(DESTDIR)$(pkgconfdir)/; \
90 fi
91uninstall-hook::
92 rm -f $(DESTDIR)$(pkgconfdir)/runlisp.conf
93
94###--------------------------------------------------------------------------
95### Image dumping.
96
97bin_PROGRAMS += dump-runlisp-image
98dump_runlisp_image_SOURCES = dump-runlisp-image.c
99dump_runlisp_image_LDADD = librunlisp.a
100man_MANS += dump-runlisp-image.1
101doc_DATA += dump-runlisp-image.pdf
102EXTRA_DIST += dump-runlisp-image.1.in
103
104DUMP_RUNLISP_IMAGE = $(v_dump)./dump-runlisp-image -f -O$@ \
105 -c$(srcdir)/runlisp-base.conf
106
107v_dump = $(v_dump_@AM_V@)
108v_dump_ = $(v_dump_@AM_DEFAULT_V@)
109v_dump_0 = @echo " DUMP $@";
110
111IMAGES =
112noinst_DATA += $(IMAGES)
113
114if DUMP_SBCL
115IMAGES += sbcl+asdf.core
116CLEANFILES += sbcl+asdf.core
117sbcl+asdf.core: dump-runlisp-image runlisp-base.conf
118 $(DUMP_RUNLISP_IMAGE) sbcl
119endif
120
121if DUMP_CCL
122IMAGES += ccl+asdf.image
123CLEANFILES += ccl+asdf.image
124ccl+asdf.image: dump-runlisp-image runlisp-base.conf
125 $(DUMP_RUNLISP_IMAGE) ccl
126endif
127
128if DUMP_CLISP
129IMAGES += clisp+asdf.mem
130CLEANFILES += clisp+asdf.mem
131clisp+asdf.mem: dump-runlisp-image runlisp-base.conf
132 $(DUMP_RUNLISP_IMAGE) clisp
133endif
134
135if DUMP_ECL
136IMAGES += ecl+asdf
137CLEANFILES += ecl+asdf
138ecl+asdf: dump-runlisp-image runlisp-base.conf dump-ecl
139 $(DUMP_RUNLISP_IMAGE) -odata-dir=$(srcdir) ecl
140endif
141
142if DUMP_CMUCL
143IMAGES += cmucl+asdf.core
144CLEANFILES += cmucl+asdf.core
145cmucl+asdf.core: dump-runlisp-image runlisp-base.conf
146 $(DUMP_RUNLISP_IMAGE) cmucl
147endif
148
149install-data-hook::
150 mkdir -p $(DESTDIR)$(imagedir)
151 set -e; for i in $(IMAGES); do \
152 j=$$(readlink $$i); \
153 cp $$j $(DESTDIR)$(imagedir)/$$j.new && \
154 mv $(DESTDIR)$(imagedir)/$$j.new \
155 $(DESTDIR)$(imagedir)/$$j; \
156 ln -sf $$j $(DESTDIR)$(imagedir)/$$i; \
157 done
158
159uninstall-hook::
160 set -e; for i in $(IMAGES); do \
161 if j=$$(readlink $(DESTDIR)$(imagedir)/$$i); then \
162 case $$j in \
163 $$i-*[!0-9a-f]) ;; \
164 $$i-*) rm -f $(DESTDIR)$(imagedir)/$$j ;; \
165 esac; \
166 fi; \
167 rm -f $(DESTDIR)$(imagedir)/$$i; \
168 done
169
170###--------------------------------------------------------------------------
171### Other subdirectories.
172
173## Documentation.
174SUBDIRS += doc
175
176## Testing.
177SUBDIRS += t
178
179## Benchmarking.
180if BENCHMARK
181SUBDIRS += bench
182endif
183
184###--------------------------------------------------------------------------
185### Distribution.
186
187## Release number.
188dist-hook::
189 echo $(VERSION) >$(distdir)/RELEASE
190
191## Additional build tools.
192EXTRA_DIST += config/auto-version
193
194###----- That's all, folks --------------------------------------------------