summaryrefslogtreecommitdiff
path: root/Build/source/utils/xindy/rte/Makefile.am
blob: 68d540cfa25b9d022ac05c98eb7011cb69f7efbf (plain)
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
## Use `autoreconf' in top-level directory to recreate all
## autoconf/automake files.
## Or, call `automake Makefile' to create only Makefile.in.

## Copyright (C) 2004-2005 by Gour.
## Copyright (C) 2006-2007 by Jörg Sommer.
## Copyright (C) 2008 by Joachim Schrod.
##
## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
## This program is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program in the file COPYING; if not, write to the
## Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
## Boston, MA 02110-1301 USA.

clisp_src = clisp-2.43

clisp_builddir = $(shell pwd)/clisp-build-dir

if EXT_CLISP
    CLISP_LIB = $(shell $(CLISP) -q -norc -x '(progn (princ *lib-directory*) (values))')
    export CLISP = @CLISP@
    CLISP_PREREQ =
else
    CLISP_LIB = $(clisp_builddir)
    export CLISP = $(clisp_builddir)/clisp
    CLISP_PREREQ = $(clisp_link) $(fulldir)
endif

export CLISP_LINKKIT = $(CLISP_LIB)/linkkit
fulldir = $(CLISP_LIB)/full
clisp_link = $(CLISP_LIB)/clisp-link

binariesdir = ../binaries

#clisp_modules=--with-export-syscalls --with-dynamic-ffi --ignore-absence-of-libsigsegv
clisp_modules := --with-dynamic-ffi --ignore-absence-of-libsigsegv

# testing for MacOS X platform to circumvent faulty 'readline'
# provided by Maarten Sneep <maarten.sneep@xs4all.nl>
# FIXME: GNU make ifeq/endif clauses do not work in Automake files.
# Either determine that case during configure or make them work.
#ifeq ($(shell uname -s), Darwin)
#	clisp_modules += --without-readline
#endif

all-local: xindy-build-dir

if !EXT_CLISP
$(clisp_builddir): $(clisp_src)
	cd $(clisp_src) && ./configure $(clisp_builddir) $(clisp_modules)
	cd $(clisp_builddir) && ./makemake $(clisp_modules) > Makefile

$(CLISP_PREREQ): $(clisp_builddir)
	$(MAKE) -C $(clisp_builddir)

# Target names that are easy to type, to build CLISP alone during development.
clisp-configure: $(clisp_builddir)
clisp: $(CLISP_PREREQ)

check:
	$(MAKE) -C $(clisp_builddir) check || $(MAKE) -C $(clisp_builddir) check
endif

ORDRULES_FILES = ordrules.c ordrules.h rxsub.c rxsub.h mkind.h debug.h link.sh

xindy-build-dir: $(CLISP_PREREQ)
	rm -rf xindy-build-dir
	test -f ordrules/link.sh || for i in $(ORDRULES_FILES); do cp -p $(top_srcdir)/rte/ordrules/$$i ordrules/$$i; done
	$(MAKE) -C ordrules ordrulei.c
	sh $(clisp_link) add-module-set ordrules $(fulldir) $@
	cp $@/lisp.run $(binariesdir)/xindy.run
	cp $@/lispinit.mem $(binariesdir)/base.mem

clean-local:
	rm -rf xindy-build-dir
	test "$(builddir)" = "$(srcdir)" || for i in $(ORDRULES_FILES); do rm -f ordrules/$$i; done
if !EXT_CLISP
	if [ -e $(clisp_builddir) ]; then $(MAKE) -C $(clisp_builddir) clean; fi
endif

if !EXT_CLISP
# remove some extra files to match pristine clisp source
distclean-local: clean
	rm -rf $(clisp_builddir)
endif

SUBDIRS = ordrules

EXTRA_DIST = NEWS README