chiark / gitweb /
@@@ more wip
[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
46 ###--------------------------------------------------------------------------
47 ### The main driver program.
48
49 bin_PROGRAMS            += runlisp
50 runlisp_SOURCES          = runlisp.c
51 runlisp_LDADD            = librunlisp.a
52 man_MANS                += runlisp.1
53 doc_DATA                += runlisp.pdf
54 EXTRA_DIST              += runlisp.1
55
56 noinst_PROGRAMS         += old-runlisp
57 old_runlisp_SOURCES      = old-runlisp.c
58 old_runlisp_LDADD        = librunlisp.a
59
60 noinst_PROGRAMS         += toy
61 toy_SOURCES              = toy.c
62 toy_SOURCES             += lib.c lib.h
63
64 ###--------------------------------------------------------------------------
65 ### Additional machinery.
66
67 pkgdata_DATA            += eval.lisp
68 EXTRA_DIST              += eval.lisp
69
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
99 ###--------------------------------------------------------------------------
100 ### Image dumping.
101
102 bin_PROGRAMS            += dump-runlisp-image
103 dump_runlisp_image_SOURCES  = dump-runlisp-image.c
104 dump_runlisp_image_LDADD = librunlisp.a
105 man_MANS                += dump-runlisp-image.1
106 doc_DATA                += dump-runlisp-image.pdf
107 EXTRA_DIST              += dump-runlisp-image.1
108
109 DUMP_RUNLISP_IMAGE       = $(v_dump)./dump-runlisp-image \
110                                 -f -c$(srcdir)/runlisp-base.conf -O$@
111
112 v_dump                   = $(v_dump_@AM_V@)
113 v_dump_                  = $(v_dump_@AM_DEFAULT_V@)
114 v_dump_0                 = @echo "  DUMP     $@";
115
116 if DUMP_SBCL
117 image_DATA              += sbcl+asdf.core
118 CLEANFILES              += sbcl+asdf.core
119 sbcl+asdf.core: dump-runlisp-image runlisp-base.conf
120         $(DUMP_RUNLISP_IMAGE) sbcl
121 endif
122
123 if DUMP_CCL
124 image_DATA              += ccl+asdf.image
125 CLEANFILES              += ccl+asdf.image
126 ccl+asdf.image: dump-runlisp-image runlisp-base.conf
127         $(DUMP_RUNLISP_IMAGE) ccl
128 endif
129
130 if DUMP_CLISP
131 image_DATA              += clisp+asdf.mem
132 CLEANFILES              += clisp+asdf.mem
133 clisp+asdf.mem: dump-runlisp-image runlisp-base.conf
134         $(DUMP_RUNLISP_IMAGE) clisp
135 endif
136
137 if DUMP_ECL
138 image_SCRIPTS           += ecl+asdf
139 CLEANFILES              += ecl+asdf
140 ecl+asdf: dump-runlisp-image runlisp-base.conf dump-ecl
141         $(DUMP_RUNLISP_IMAGE) -odata-dir=$(srcdir) ecl
142 endif
143
144 if DUMP_CMUCL
145 image_DATA              += cmucl+asdf.core
146 CLEANFILES              += cmucl+asdf.core
147 cmucl+asdf.core: dump-runlisp-image runlisp-base.conf
148         $(DUMP_RUNLISP_IMAGE) cmucl
149 endif
150
151 ###--------------------------------------------------------------------------
152 ### Other subdirectories.
153
154 ## Documentation.
155 SUBDIRS                 += doc
156
157 ## Testing.
158 SUBDIRS                 += t
159
160 ## Benchmarking.
161 if BENCHMARK
162 SUBDIRS                 += bench
163 endif
164
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 --------------------------------------------------