-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile.in
369 lines (334 loc) · 11.8 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
#
# Copyright (c) 2000-2018, Toshimi Sawada. All rights reserved.
# Copyright (c) 2014-2018, Norbert Preining. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# stuff that is determined by configure:
# automatically
srcdir = @srcdir@
# --prefix
prefix = @prefix@
exec_prefix = @exec_prefix@
# needed for automake compatibility
datarootdir = @datarootdir@
datadir = @datadir@
mandir = @mandir@
docdir = @docdir@
libdir = @libdir@
bindir = @bindir@
# --with-lisp
lisp = @lisp@
# determined first choice
firstchoice = @firstchoice@
# --enable-rebuild-doc
enable_rebuild_doc = @enable_rebuild_doc@
# --enable-traditional-layout
enable_traditional_layout = @enable_traditional_layout@
# --enable-windows
enable_windows = @enable_windows@
# --enable-wine
enable_wine = @enable_wine@
# --enable-distribution
enable_distribution = @enable_distribution@
# lispdir of emacs
lispdir = @lispdir@
OSBIT = @OSBIT@
# general stuff
PACKAGE = @PACKAGE_TARNAME@
VERSION = @PACKAGE_VERSION@
VMINOR = @VMINOR@
PATCHLEVEL = @PATCHLEVEL@
INSTALL = @INSTALL@
# Engine definitions
# interpreter cmd names can be configured, so are coming from
# configure(.ac)
ACL_DUMP = dumps/acl/@acl_dump@
ACL_INTERPRETER = @acl_interp@
ACL_BUILDOPTS =
ACL_DUMPFILE = make-cafeobj.lisp
ACL_STANDALONE_DUMP = dumps/acl-standalone/@acl_standalone_dump@
ACL_STANDALONE_INTERPRETER = @acl_interp@
ACL_STANDALONE_BUILDOPTS =
ACL_STANDALONE_DUMPFILE = build-acl-dist.cl
SBCL_DUMP = dumps/sbcl/@sbcl_dump@
SBCL_INTERPRETER = @sbcl_interp@
ifeq ($(OSBIT),64)
SBCL_BUILDOPTS = --dynamic-space-size 4096
else
SBCL_BUILDOPTS = --dynamic-space-size 2048
endif
SBCL_DUMPFILE = make-cafeobj.lisp
CMU_DUMP = dumps/cmu/@cmu_dump@
CMU_INTERPRETER = @cmu_interp@
CMU_BUILDOPTION =
CMU_DUMPFILE = make-cafeobj.lisp
CCL32_DUMP = dumps/ccl/@ccl32_dump@
CCL32_INTERPRETER = @ccl32_interp@
CCL32_BUILDOPTS =
CCL32_DUMPFILE = make-cafeobj.lisp
CCL64_DUMP = dumps/ccl64/@ccl64_dump@
CCL64_INTERPRETER = @ccl64_interp@
CCL64_BUILDOPTS =
CCL64_DUMPFILE = make-cafeobj.lisp
CLISP_DUMP = dumps/clisp/@clisp_dump@
CLISP_INTERPRETER = @clisp_interp@
CLISP_BUILDOPTS =
CLISP_DUMPFILE = make-cafeobj.lisp
GCL_DUMP = dumps/gcl/@gcl_dump@
GCL_INTERPRETER = @gcl_interp@
GCL_BUILDOPTS =
GCL_DUMPFILE = make-cafeobj.lisp
# End of engine definitions
#
# specifying the files that go into the distribution is a pain,
# because we cannot simply include * as this would include the
# to be build dist dir, too.
# for now, let us simply not suport make dist ;-)
# EXTRA_DIST = *
#
# traditional layout means
# /usr/local/bin/cafeobj
# /usr/local/cafeobj-N.M/bin/DUMP
# /usr/local/cafeobj-N.M/{lib,prelude}
ifeq ($(enable_traditional_layout),yes)
cafeobj_share = $(prefix)/$(PACKAGE)-$(VERSION)
cafeobj_lib = $(prefix)/$(PACKAGE)-$(VERSION)
cafeobj_bin = $(prefix)/bin
lib_relative = .
share_relative = .
cafeobjdumpdir = $(cafeobj_lib)/bin
cafeobjlibdir = $(cafeobj_share)/lib
cafeobjpreludedir = $(cafeobj_share)/prelude
cafeobjdocdir = $(cafeobj_share)/doc
cafeobjmandir = $(cafeobj_share)/man
cafeobjelisp = $(cafeobj_share)/elisp
else
cafeobj_share = $(datarootdir)/$(PACKAGE)-$(VERSION)
cafeobj_lib = $(libdir)/$(PACKAGE)-$(VERSION)
cafeobj_bin = $(bindir)
lib_relative = lib/$(PACKAGE)-$(VERSION)
share_relative = share/$(PACKAGE)-$(VERSION)
cafeobjdumpdir = $(cafeobj_lib)
cafeobjlibdir = $(cafeobj_share)/lib
cafeobjpreludedir = $(cafeobj_share)/prelude
cafeobjdocdir = $(docdir)/cafeobj
cafeobjmandir = $(mandir)/man1
cafeobjelisp = $(lispdir)
endif
ifeq ($(enable_windows),yes)
prefix = $(srcdir)
# we only support building
lisp = sbcl
ifeq ($(enable_wine),yes)
SBCL_INTERPRETER = wine sbcl
endif
# it seems that windows sbcl does not like this cmd line args
SBCL_BUILDOPTS =
cafeobj_share = $(prefix)/$(PACKAGE)-$(VERSION)-sbcl
cafeobj_lib = $(prefix)/$(PACKAGE)-$(VERSION)-sbcl
cafeobj_bin = $(prefix)/$(PACKAGE)-$(VERSION)-sbcl
# irrelevant, since we do not install the shell script
lib_relative = .
share_relative = .
cafeobjdumpdir = $(cafeobj_lib)
cafeobjlibdir = $(cafeobj_share)/lib
cafeobjpreludedir = $(cafeobj_share)/prelude
cafeobjdocdir = $(cafeobj_share)/doc
cafeobjmandir = $(cafeobj_share)/doc
cafeobjelisp = $(cafeobj_share)/elisp
endif
ifeq ($(enable_distribution),yes)
prefix = $(srcdir)/dist
endif
engine_dumps = $(patsubst acl,$(ACL_DUMP),\
$(patsubst acl-standalone,$(ACL_STANDALONE_DUMP),\
$(patsubst sbcl,$(SBCL_DUMP),\
$(patsubst cmu,$(CMU_DUMP),\
$(patsubst ccl,$(CCL32_DUMP),\
$(patsubst ccl64,$(CCL64_DUMP),\
$(patsubst clisp,$(CLISP_DUMP),\
$(patsubst gcl,$(GCL_DUMP),$(lisp)))))))))
doc_files = \
doc/binspect/binspect.pdf \
doc/citp-manual/citp.pdf \
doc/manual/manual.pdf \
doc/namespace/namespace.pdf \
doc/PigNose/pnguide.pdf \
doc/RefCard/interp.pdf \
doc/RefCard/syntax.pdf \
doc/refman/reference-manual.pdf \
doc/search/search-predicate.pdf
# documentation rebuilding
doc_targets =
ifeq ($(enable_rebuild_doc),yes)
doc_targets += $(doc_files)
endif
#
# for dumping the image the lisp interpreter needs to know
# where the input files are during building
# used only in creating make-cafeobj.lisp script
chaos_root = $(srcdir)
# first target when building windows/binary distribution
make-dist: install-stamp
ifeq ($(enable_windows),yes)
ifeq ($(enable_wine),yes)
# we run under wine, so linux environment has zip
zip -r cafeobj-$(VERSION)$(VMINOR)-sbcl-win64.zip $(cafeobj_bin)
else
# We run under windows, the tar there can produce ZIP files with
# tar -a ....
tar -a -c -f cafeobj-$(VERSION)$(VMINOR)-sbcl-win64.zip $(cafeobj_bin)
endif
else ifeq ($(enable_distribution),yes)
bash make-release-tarballs $(VERSION) $(VMINOR) $(lisp)
endif
# first target on Unix!
build: build-stamp
build-stamp: version.lisp make-cafeobj.lisp $(engine_dumps) xbin/cafeobj $(doc_targets)
touch build-stamp
#
# cafeobj <- here - cafeobj.in <- cafeobj.in.in via configure
xbin/cafeobj: xbin/cafeobj.in
cat $(srcdir)/xbin/cafeobj.in | \
sed -e 's:@FIRSTCHOICE@:$(firstchoice):g' \
-e 's:@LIBPATH@:$(lib_relative):g' \
-e 's:@SHAREPATH@:$(share_relative):g' >$(srcdir)/xbin/cafeobj
$(ACL_DUMP) : interp = $(ACL_INTERPRETER)
$(ACL_DUMP) : buildopts = $(ACL_BUILDOPTS)
$(ACL_DUMP) : dumpfile = $(ACL_DUMPFILE)
$(ACL_STANDALONE_DUMP) : interp = $(ACL_STANDALONE_INTERPRETER)
$(ACL_STANDALONE_DUMP) : buildopts = $(ACL_STANDALONE_BUILDOPTS)
$(ACL_STANDALONE_DUMP) : dumpfile = $(ACL_STANDALONE_DUMPFILE)
$(SBCL_DUMP) : interp = $(SBCL_INTERPRETER)
$(SBCL_DUMP) : buildopts = $(SBCL_BUILDOPTS)
$(SBCL_DUMP) : dumpfile = $(SBCL_DUMPFILE)
$(CMU_DUMP) : interp = $(CMU_INTERPRETER)
$(CMU_DUMP) : buildopts = $(CMU_BUILDOPTS)
$(CMU_DUMP) : dumpfile = $(CMU_DUMPFILE)
$(CLISP_DUMP) : interp = $(CLISP_INTERPRETER)
$(CLISP_DUMP) : buildopts = $(CLISP_BUILDOPTS)
$(CLISP_DUMP) : dumpfile = $(CLISP_DUMPFILE)
$(CCL32_DUMP) : interp = $(CCL32_INTERPRETER)
$(CCL32_DUMP) : buildopts = $(CCL32_BUILDOPTS)
$(CCL32_DUMP) : dumpfile = $(CCL32_DUMPFILE)
$(CCL64_DUMP) : interp = $(CCL64_INTERPRETER)
$(CCL64_DUMP) : buildopts = $(CCL64_BUILDOPTS)
$(CCL64_DUMP) : dumpfile = $(CCL64_DUMPFILE)
$(GCL_DUMP) : interp = $(GCL_INTERPRETER)
$(GCL_DUMP) : buildopts = $(GCL_BUILDOPTS)
$(GCL_DUMP) : dumpfile = $(GCL_DUMPFILE)
$(engine_dumps): %: make-cafeobj.lisp version.lisp
mkdir -p $(dir $@)
$(interp) $(buildopts) < $(dumpfile)
chmod +x $@
install: install-stamp
install-stamp: build-stamp
$(INSTALL) -d $(DESTDIR)$(cafeobjlibdir)
$(INSTALL) -m 0644 \
$(srcdir)/lib/lib/*.cafe \
$(DESTDIR)$(cafeobjlibdir)
$(INSTALL) -d $(DESTDIR)$(cafeobjpreludedir)
$(INSTALL) -m 0644 $(srcdir)/lib/prelude/*.bin \
$(DESTDIR)$(cafeobjpreludedir)
$(INSTALL) -d $(DESTDIR)$(cafeobjdumpdir)
ifeq ($(enable_windows),yes)
cp -a $(SBCL_DUMP) $(DESTDIR)$(cafeobjdumpdir)/CafeOBJ.exe
else
cp -a dumps/* $(DESTDIR)$(cafeobjdumpdir)
chmod 0755 $(DESTDIR)$(cafeobjdumpdir)/*/*
$(INSTALL) -d $(DESTDIR)$(cafeobj_bin)
$(INSTALL) -m 0755 xbin/cafeobj $(DESTDIR)$(cafeobj_bin)
endif
# man page
$(INSTALL) -d $(DESTDIR)$(cafeobjmandir)
$(INSTALL) -m 0644 doc/etc/cafeobj.1 $(DESTDIR)$(cafeobjmandir)
# doc files
$(INSTALL) -d $(DESTDIR)$(cafeobjdocdir)
$(INSTALL) -m 0644 \
$(doc_files) \
doc/etc/cafe-citp.txt \
elisp/cafeobj-mode.el \
lib/icons/cafeobj-logo.png \
lib/icons/cafeobj-logo-small.png \
$(DESTDIR)$(cafeobjdocdir)
$(INSTALL) -d $(DESTDIR)$(cafeobjdocdir)/examples
$(INSTALL) -m 0644 doc/examples/*.mod \
$(DESTDIR)$(cafeobjdocdir)/examples
# emacs lisp file installation
$(INSTALL) -d $(DESTDIR)$(cafeobjelisp)
$(INSTALL) -m 0644 elisp/cafeobj-mode.el $(DESTDIR)$(cafeobjelisp)
# end of installation routines
touch install-stamp
doc/refman/reference-manual.pdf:
$(MAKE) -C doc/refman reference-manual.pdf
doc/manual/manual.pdf:
$(MAKE) -C doc/manual manual.pdf
doc/PigNose/pnguide.pdf:
$(MAKE) -C doc/PigNose pnguide.pdf
doc/RefCard/interp.pdf:
$(MAKE) -C doc/RefCard interp.pdf
doc/RefCard/syntax.pdf:
$(MAKE) -C doc/RefCard syntax.pdf
doc/namespace/namespace.pdf:
$(MAKE) -C doc/namespace namespace.pdf
doc/citp-manual/citp.pdf: doc/etc/kosakusha-logo-gray.png
$(MAKE) -C doc/citp-manual citp.pdf
doc/binspect/binspect.pdf: doc/etc/kosakusha-logo-gray.png
$(MAKE) -C doc/binspect binspect.pdf
doc/etc/kosakusha-logo-gray.png:
$(MAKE) -C doc/etc kosakusha-logo-gray.png
clean:
-test -r doc/refman/Makefile && $(MAKE) -C doc/refman clean
-test -f doc/manual/Makefile && $(MAKE) -C doc/manual clean
-test -f doc/PigNose/Makefile && $(MAKE) -C doc/PigNose clean
-test -f doc/RefCard/Makefile && $(MAKE) -C doc/RefCard clean
-test -f doc/namespace/Makefile && $(MAKE) -C doc/namespace clean
-test -f doc/binspect/Makefile && $(MAKE) -C doc/binspect clean
-test -f doc/citp-manual/Makefile && $(MAKE) -C doc/citp-manual clean
-test -f doc/etc/Makefile && $(MAKE) -C doc/etc clean
rm -rf dumps
rm -f stamp-windows-prepare stamp-windows-build
rm -f build-stamp
rm -f install-stamp
rm -f xbin/cafeobj
distclean: clean
rm -f Makefile config.log config.status
rm -f xbin/cafeobj.in
rm -f make-cafeobj.lisp
rm -f version.lisp
rm -rf autom4te.cache
rm -f doc/Makefile doc/refman/Makefile doc/manual/Makefile
rm -f doc/etc/Makefile doc/namespace/Makefile doc/search/Makefile
rm -f doc/PigNose/Makefile doc/RefCard/Makefile
rm -f doc/citp-manual/Makefile
rm -rf WindowsDist
rm -rf dist
rm -f autoloads.out
find . -name \*.fasl -exec rm '{}' \;
#
# declare the clean targets as well as the scripts that are
# generated as phony to make sure they are rebuilt at any time.
.PHONY: clean distclean $(doc_targets)