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