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