@@@ 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
10427eb2 45librunlisp_a_SOURCES += sha256.c sha256.h
8996f767
MW
46
47###--------------------------------------------------------------------------
e29834b8
MW
48### The main driver program.
49
50bin_PROGRAMS += runlisp
51runlisp_SOURCES = runlisp.c
8996f767 52runlisp_LDADD = librunlisp.a
e29834b8 53man_MANS += runlisp.1
8996f767 54doc_DATA += runlisp.pdf
10427eb2 55EXTRA_DIST += runlisp.1.in
7b8ff279 56
e29834b8
MW
57###--------------------------------------------------------------------------
58### Additional machinery.
59
60pkgdata_DATA += eval.lisp
61EXTRA_DIST += eval.lisp
62
10427eb2 63pkgdata_SCRIPTS += dump-ecl
8996f767
MW
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
10427eb2 71EXTRA_DIST += query-runlisp-config.1.in
8996f767
MW
72
73man_MANS += runlisp.conf.5
74doc_DATA += runlisp.conf.pdf
10427eb2 75EXTRA_DIST += runlisp.conf.5.in
8996f767
MW
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
e29834b8
MW
94###--------------------------------------------------------------------------
95### Image dumping.
96
7b8ff279
MW
97bin_PROGRAMS += dump-runlisp-image
98dump_runlisp_image_SOURCES = dump-runlisp-image.c
8996f767 99dump_runlisp_image_LDADD = librunlisp.a
e29834b8 100man_MANS += dump-runlisp-image.1
8996f767 101doc_DATA += dump-runlisp-image.pdf
10427eb2 102EXTRA_DIST += dump-runlisp-image.1.in
e29834b8 103
7b8ff279 104DUMP_RUNLISP_IMAGE = $(v_dump)./dump-runlisp-image \
8996f767 105 -f -c$(srcdir)/runlisp-base.conf -O$@
7b8ff279 106
e29834b8
MW
107v_dump = $(v_dump_@AM_V@)
108v_dump_ = $(v_dump_@AM_DEFAULT_V@)
109v_dump_0 = @echo " DUMP $@";
110
e29834b8
MW
111if DUMP_SBCL
112image_DATA += sbcl+asdf.core
113CLEANFILES += sbcl+asdf.core
8996f767 114sbcl+asdf.core: dump-runlisp-image runlisp-base.conf
7b8ff279 115 $(DUMP_RUNLISP_IMAGE) sbcl
e29834b8
MW
116endif
117
118if DUMP_CCL
119image_DATA += ccl+asdf.image
120CLEANFILES += ccl+asdf.image
8996f767 121ccl+asdf.image: dump-runlisp-image runlisp-base.conf
7b8ff279 122 $(DUMP_RUNLISP_IMAGE) ccl
e29834b8
MW
123endif
124
125if DUMP_CLISP
126image_DATA += clisp+asdf.mem
127CLEANFILES += clisp+asdf.mem
8996f767 128clisp+asdf.mem: dump-runlisp-image runlisp-base.conf
7b8ff279 129 $(DUMP_RUNLISP_IMAGE) clisp
e29834b8
MW
130endif
131
132if DUMP_ECL
133image_SCRIPTS += ecl+asdf
134CLEANFILES += ecl+asdf
8996f767 135ecl+asdf: dump-runlisp-image runlisp-base.conf dump-ecl
7b8ff279 136 $(DUMP_RUNLISP_IMAGE) -odata-dir=$(srcdir) ecl
e29834b8
MW
137endif
138
139if DUMP_CMUCL
140image_DATA += cmucl+asdf.core
141CLEANFILES += cmucl+asdf.core
8996f767 142cmucl+asdf.core: dump-runlisp-image runlisp-base.conf
7b8ff279 143 $(DUMP_RUNLISP_IMAGE) cmucl
e29834b8
MW
144endif
145
146###--------------------------------------------------------------------------
8996f767 147### Other subdirectories.
e29834b8 148
8996f767
MW
149## Documentation.
150SUBDIRS += doc
151
152## Testing.
153SUBDIRS += t
154
155## Benchmarking.
e29834b8
MW
156if BENCHMARK
157SUBDIRS += bench
158endif
159
e29834b8
MW
160###--------------------------------------------------------------------------
161### Distribution.
162
163## Release number.
164dist-hook::
165 echo $(VERSION) >$(distdir)/RELEASE
166
167## Additional build tools.
168EXTRA_DIST += config/auto-version
169
170###----- That's all, folks --------------------------------------------------