3 ### Build script for `runlisp'
5 ### (c) 2020 Mark Wooding
8 ###----- Licensing notice ---------------------------------------------------
10 ### This file is part of Runlisp, a tool for invoking Common Lisp scripts.
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.
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
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/>.
25 include $(top_srcdir)/vars.am
34 ACLOCAL_AMFLAGS = -Im4
36 ###--------------------------------------------------------------------------
37 ### A library of common code.
39 noinst_LIBRARIES += librunlisp.a
40 librunlisp_a_SOURCES =
42 librunlisp_a_SOURCES += common.c common.h
43 librunlisp_a_SOURCES += lib.c lib.h
44 librunlisp_a_SOURCES += mdwopt.c mdwopt.h
45 librunlisp_a_SOURCES += sha256.c sha256.h
47 ###--------------------------------------------------------------------------
48 ### The main driver program.
50 bin_PROGRAMS += runlisp
51 runlisp_SOURCES = runlisp.c
52 runlisp_LDADD = librunlisp.a
54 doc_DATA += runlisp.pdf
55 EXTRA_DIST += runlisp.1.in
57 noinst_PROGRAMS += old-runlisp
58 old_runlisp_SOURCES = old-runlisp.c
59 old_runlisp_LDADD = librunlisp.a
61 noinst_PROGRAMS += toy
63 toy_LDADD = librunlisp.a
65 noinst_PROGRAMS += hash
67 hash_LDADD = librunlisp.a
69 ###--------------------------------------------------------------------------
70 ### Additional machinery.
72 pkgdata_DATA += eval.lisp
73 EXTRA_DIST += eval.lisp
75 pkgdata_SCRIPTS += dump-ecl
76 EXTRA_DIST += dump-ecl
78 bin_PROGRAMS += query-runlisp-config
79 query_runlisp_config_SOURCES = query-runlisp-config.c
80 query_runlisp_config_LDADD = librunlisp.a
81 man_MANS += query-runlisp-config.1
82 doc_DATA += query-runlisp-config.pdf
83 EXTRA_DIST += query-runlisp-config.1.in
85 man_MANS += runlisp.conf.5
86 doc_DATA += runlisp.conf.pdf
87 EXTRA_DIST += runlisp.conf.5.in
89 EXTRA_DIST += runlisp-base.conf
91 $(MKDIR_P) $(DESTDIR)$(pkgconfdir)/runlisp.d
92 cp $(srcdir)/runlisp-base.conf \
93 $(DESTDIR)$(pkgconfdir)/runlisp.d/0base.conf
95 rm -f $(DESTDIR)$(pkgconfdir)/runlisp.d/0base.conf
97 EXTRA_DIST += runlisp.conf
99 $(MKDIR_P) $(DESTDIR)$(pkgconfdir)
100 if ! [ -f $(DESTDIR)$(pkgconfdir)/runlisp.conf ]; then \
101 cp $(srcdir)/runlisp.conf $(DESTDIR)$(pkgconfdir)/; \
104 rm -f $(DESTDIR)$(pkgconfdir)/runlisp.conf
106 ###--------------------------------------------------------------------------
109 bin_PROGRAMS += dump-runlisp-image
110 dump_runlisp_image_SOURCES = dump-runlisp-image.c
111 dump_runlisp_image_LDADD = librunlisp.a
112 man_MANS += dump-runlisp-image.1
113 doc_DATA += dump-runlisp-image.pdf
114 EXTRA_DIST += dump-runlisp-image.1.in
116 DUMP_RUNLISP_IMAGE = $(v_dump)./dump-runlisp-image \
117 -f -c$(srcdir)/runlisp-base.conf -O$@
119 v_dump = $(v_dump_@AM_V@)
120 v_dump_ = $(v_dump_@AM_DEFAULT_V@)
121 v_dump_0 = @echo " DUMP $@";
124 noinst_DATA += $(IMAGES)
127 IMAGES += sbcl+asdf.core
128 CLEANFILES += sbcl+asdf.core
129 sbcl+asdf.core: dump-runlisp-image runlisp-base.conf
130 $(DUMP_RUNLISP_IMAGE) sbcl
134 IMAGES += ccl+asdf.image
135 CLEANFILES += ccl+asdf.image
136 ccl+asdf.image: dump-runlisp-image runlisp-base.conf
137 $(DUMP_RUNLISP_IMAGE) ccl
141 IMAGES += clisp+asdf.mem
142 CLEANFILES += clisp+asdf.mem
143 clisp+asdf.mem: dump-runlisp-image runlisp-base.conf
144 $(DUMP_RUNLISP_IMAGE) clisp
149 CLEANFILES += ecl+asdf
150 ecl+asdf: dump-runlisp-image runlisp-base.conf dump-ecl
151 $(DUMP_RUNLISP_IMAGE) -odata-dir=$(srcdir) ecl
155 IMAGES += cmucl+asdf.core
156 CLEANFILES += cmucl+asdf.core
157 cmucl+asdf.core: dump-runlisp-image runlisp-base.conf
158 $(DUMP_RUNLISP_IMAGE) cmucl
162 mkdir -p $(DESTDIR)$(imagedir)
163 set -e; for i in $(IMAGES); do \
164 j=$$(readlink $$i); \
165 cp $$j $(DESTDIR)$(imagedir)/$$j.new && \
166 mv $(DESTDIR)$(imagedir)/$$j.new \
167 $(DESTDIR)$(imagedir)/$$j; \
168 ln -sf $$j $(DESTDIR)$(imagedir)/$$i; \
172 set -e; for i in $(IMAGES); do \
173 if j=$$(readlink $(DESTDIR)$(imagedir)/$$i); then \
176 $$i-*) rm -f $(DESTDIR)$(imagedir)/$$j ;; \
179 rm -f $(DESTDIR)$(imagedir)/$$i; \
182 ###--------------------------------------------------------------------------
183 ### Other subdirectories.
196 ###--------------------------------------------------------------------------
201 echo $(VERSION) >$(distdir)/RELEASE
203 ## Additional build tools.
204 EXTRA_DIST += config/auto-version
206 ###----- That's all, folks --------------------------------------------------