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
|
#
# Copyright (c) 2000-2014, Toshimi Sawada. All rights reserved.
# Copyright (c) 2014, 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@
# --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-distribution
enable_distribution = @enable_distribution@
# 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@
ifdef NO_SBCL_BUILDOPTS
SBCL_BUILDOPTS =
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)
# the first three variable will be prefixed with $DESTDIR/$prefix
cafeobj_share = $(PACKAGE)-$(VERSION)
cafeobj_lib = $(PACKAGE)-$(VERSION)
cafeobj_bin = bin
cafeobjdumpdir = $(cafeobj_lib)/bin
cafeobjlibdir = $(cafeobj_share)/lib
cafeobjpreludedir = $(cafeobj_share)/prelude
cafeobjdocdir = $(cafeobj_share)/doc
cafeobjmandir = $(cafeobj_share)/man
else
# the first three variable will be prefixed with $DESTDIR/$prefix
cafeobj_share = share/$(PACKAGE)-$(VERSION)
cafeobj_lib = lib/$(PACKAGE)-$(VERSION)
cafeobj_bin = bin
cafeobjdumpdir = $(cafeobj_lib)/
cafeobjlibdir = $(cafeobj_share)/lib
cafeobjpreludedir = $(cafeobj_share)/prelude
cafeobjdocdir = share/doc/$(PACKAGE)
cafeobjmandir = share/man/man1
endif
ifeq ($(enable_windows),yes)
prefix = $(srcdir)
# we only support building
lisp = sbcl
SBCL_INTERPRETER = wine sbcl
# it seems that windows sbcl does not like this cmd line args
SBCL_BUILDOPTS =
# the first three variable will be prefixed with $DESTDIR/$prefix
cafeobj_share = $(PACKAGE)-$(VERSION)-sbcl
cafeobj_lib = $(PACKAGE)-$(VERSION)-sbcl
cafeobj_bin = $(PACKAGE)-$(VERSION)-sbcl
cafeobjdumpdir = $(cafeobj_lib)/
cafeobjlibdir = $(cafeobj_share)/lib
cafeobjpreludedir = $(cafeobj_share)/prelude
cafeobjdocdir = $(cafeobj_share)/doc
cafeobjmandir = $(cafeobj_share)/doc
endif
ifeq ($(enable_distribution),yes)
prefix = $(srcdir)/dist
# the first three variable will be prefixed with $DESTDIR/$prefix
cafeobj_share = share/$(PACKAGE)-$(VERSION)
cafeobj_lib = lib/$(PACKAGE)-$(VERSION)
cafeobj_bin = bin
cafeobjdumpdir = $(cafeobj_lib)/
cafeobjlibdir = $(cafeobj_share)/lib
cafeobjpreludedir = $(cafeobj_share)/prelude
cafeobjdocdir = share/doc/$(PACKAGE)
cafeobjmandir = share/man/man1
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)))))))))
# documentation rebuilding
doc_targets =
ifeq ($(enable_rebuild_doc),yes)
doc_targets += \
doc/refman/reference-manual.pdf \
doc/manual/manual.pdf \
doc/RefCard/interp.pdf \
doc/RefCard/syntax.pdf \
doc/PigNose/pnguide.pdf
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 distribution
ifeq ($(enable_windows),yes)
make-dist: install-stamp
zip -r cafeobj-$(VERSION)$(VMINOR)-sbcl-win32.zip $(cafeobj_bin)
endif
# first target when building binary distributions
ifeq ($(enable_distribution),yes)
make-dist: install-stamp
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@:$(cafeobj_lib):g' \
-e 's:@SHAREPATH@:$(cafeobj_share):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)$(prefix)/$(cafeobjlibdir)
$(INSTALL) -m 0644 \
$(srcdir)/lib/lib/*.cafe \
$(srcdir)/lib/lib/*.bin \
$(srcdir)/lib/lib/*.desc \
$(DESTDIR)$(prefix)/$(cafeobjlibdir)
$(INSTALL) -d $(DESTDIR)$(prefix)/$(cafeobjpreludedir)
$(INSTALL) -m 0644 $(srcdir)/lib/prelude/*.bin \
$(DESTDIR)$(prefix)/$(cafeobjpreludedir)
$(INSTALL) -d $(DESTDIR)$(prefix)/$(cafeobjdumpdir)
ifeq ($(enable_windows),yes)
cp -a $(SBCL_DUMP) $(DESTDIR)$(prefix)/$(cafeobjdumpdir)/CafeOBJ.exe
else
cp -a dumps/* $(DESTDIR)$(prefix)/$(cafeobjdumpdir)
chmod 0755 $(DESTDIR)$(prefix)/$(cafeobjdumpdir)/*/*
$(INSTALL) -d $(DESTDIR)$(prefix)/$(cafeobj_bin)
$(INSTALL) -m 0755 xbin/cafeobj $(DESTDIR)$(prefix)/$(cafeobj_bin)
endif
# man page
$(INSTALL) -d $(DESTDIR)$(prefix)/$(cafeobjmandir)
$(INSTALL) -m 0644 doc/etc/cafeobj.1 $(DESTDIR)$(prefix)/$(cafeobjmandir)
# doc files
$(INSTALL) -d $(DESTDIR)$(prefix)/$(cafeobjdocdir)
$(INSTALL) -m 0644 \
doc/manual/manual.pdf \
doc/PigNose/pnguide.pdf \
doc/RefCard/interp.pdf \
doc/RefCard/syntax.pdf \
doc/refman/reference-manual.pdf \
doc/etc/cafe-citp.txt \
elisp/cafeobj-mode.el \
lib/icons/cafeobj-logo.png \
lib/icons/cafeobj-logo-small.png \
$(DESTDIR)$(prefix)/$(cafeobjdocdir)
$(INSTALL) -d $(DESTDIR)$(prefix)/$(cafeobjdocdir)/examples
$(INSTALL) -m 0644 doc/examples/*.mod \
$(DESTDIR)$(prefix)/$(cafeobjdocdir)/examples
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
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
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/PigNose/Makefile doc/RefCard/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)
|