@@@ more wip
[runlisp] / Makefile.am
CommitLineData
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
25include $(top_srcdir)/vars.am
26
27SUBDIRS =
28
e29834b8
MW
29image_DATA =
30image_SCRIPTS =
31
32SUBDIRS += .
33
34ACLOCAL_AMFLAGS = -Im4
35
36###--------------------------------------------------------------------------
8996f767
MW
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
45
46###--------------------------------------------------------------------------
e29834b8
MW
47### The main driver program.
48
49bin_PROGRAMS += runlisp
50runlisp_SOURCES = runlisp.c
8996f767 51runlisp_LDADD = librunlisp.a
e29834b8 52man_MANS += runlisp.1
8996f767
MW
53doc_DATA += runlisp.pdf
54EXTRA_DIST += runlisp.1
e29834b8 55
7b8ff279
MW
56noinst_PROGRAMS += old-runlisp
57old_runlisp_SOURCES = old-runlisp.c
8996f767 58old_runlisp_LDADD = librunlisp.a
7b8ff279
MW
59
60noinst_PROGRAMS += toy
61toy_SOURCES = toy.c
62toy_SOURCES += lib.c lib.h
63
e29834b8
MW
64###--------------------------------------------------------------------------
65### Additional machinery.
66
67pkgdata_DATA += eval.lisp
68EXTRA_DIST += eval.lisp
69
8996f767
MW
70pkgdata_DATA += dump-ecl
71EXTRA_DIST += dump-ecl
72
73bin_PROGRAMS += query-runlisp-config
74query_runlisp_config_SOURCES = query-runlisp-config.c
75query_runlisp_config_LDADD = librunlisp.a
76man_MANS += query-runlisp-config.1
77doc_DATA += query-runlisp-config.pdf
78
79man_MANS += runlisp.conf.5
80doc_DATA += runlisp.conf.pdf
81
82EXTRA_DIST += runlisp-base.conf
83install-data-hook::
84 $(MKDIR_P) $(DESTDIR)$(pkgconfdir)/runlisp.d
85 cp $(srcdir)/runlisp-base.conf \
86 $(DESTDIR)$(pkgconfdir)/runlisp.d/0base.conf
87uninstall-hook::
88 rm -f $(DESTDIR)$(pkgconfdir)/runlisp.d/0base.conf
89
90EXTRA_DIST += runlisp.conf
91install-data-hook::
92 $(MKDIR_P) $(DESTDIR)$(pkgconfdir)
93 if ! [ -f $(DESTDIR)$(pkgconfdir)/runlisp.conf ]; then \
94 cp $(srcdir)/runlisp.conf $(DESTDIR)$(pkgconfdir)/; \
95 fi
96uninstall-hook::
97 rm -f $(DESTDIR)$(pkgconfdir)/runlisp.conf
98
e29834b8
MW
99###--------------------------------------------------------------------------
100### Image dumping.
101
7b8ff279
MW
102bin_PROGRAMS += dump-runlisp-image
103dump_runlisp_image_SOURCES = dump-runlisp-image.c
8996f767 104dump_runlisp_image_LDADD = librunlisp.a
e29834b8 105man_MANS += dump-runlisp-image.1
8996f767
MW
106doc_DATA += dump-runlisp-image.pdf
107EXTRA_DIST += dump-runlisp-image.1
e29834b8 108
7b8ff279 109DUMP_RUNLISP_IMAGE = $(v_dump)./dump-runlisp-image \
8996f767 110 -f -c$(srcdir)/runlisp-base.conf -O$@
7b8ff279 111
e29834b8
MW
112v_dump = $(v_dump_@AM_V@)
113v_dump_ = $(v_dump_@AM_DEFAULT_V@)
114v_dump_0 = @echo " DUMP $@";
115
e29834b8
MW
116if DUMP_SBCL
117image_DATA += sbcl+asdf.core
118CLEANFILES += sbcl+asdf.core
8996f767 119sbcl+asdf.core: dump-runlisp-image runlisp-base.conf
7b8ff279 120 $(DUMP_RUNLISP_IMAGE) sbcl
e29834b8
MW
121endif
122
123if DUMP_CCL
124image_DATA += ccl+asdf.image
125CLEANFILES += ccl+asdf.image
8996f767 126ccl+asdf.image: dump-runlisp-image runlisp-base.conf
7b8ff279 127 $(DUMP_RUNLISP_IMAGE) ccl
e29834b8
MW
128endif
129
130if DUMP_CLISP
131image_DATA += clisp+asdf.mem
132CLEANFILES += clisp+asdf.mem
8996f767 133clisp+asdf.mem: dump-runlisp-image runlisp-base.conf
7b8ff279 134 $(DUMP_RUNLISP_IMAGE) clisp
e29834b8
MW
135endif
136
137if DUMP_ECL
138image_SCRIPTS += ecl+asdf
139CLEANFILES += ecl+asdf
8996f767 140ecl+asdf: dump-runlisp-image runlisp-base.conf dump-ecl
7b8ff279 141 $(DUMP_RUNLISP_IMAGE) -odata-dir=$(srcdir) ecl
e29834b8
MW
142endif
143
144if DUMP_CMUCL
145image_DATA += cmucl+asdf.core
146CLEANFILES += cmucl+asdf.core
8996f767 147cmucl+asdf.core: dump-runlisp-image runlisp-base.conf
7b8ff279 148 $(DUMP_RUNLISP_IMAGE) cmucl
e29834b8
MW
149endif
150
151###--------------------------------------------------------------------------
8996f767 152### Other subdirectories.
e29834b8 153
8996f767
MW
154## Documentation.
155SUBDIRS += doc
156
157## Testing.
158SUBDIRS += t
159
160## Benchmarking.
e29834b8
MW
161if BENCHMARK
162SUBDIRS += bench
163endif
164
e29834b8
MW
165###--------------------------------------------------------------------------
166### Distribution.
167
168## Release number.
169dist-hook::
170 echo $(VERSION) >$(distdir)/RELEASE
171
172## Additional build tools.
173EXTRA_DIST += config/auto-version
174
175###----- That's all, folks --------------------------------------------------