summaryrefslogtreecommitdiff
path: root/Build/source/utils/xindy/rte/Makefile.am
blob: f1c852e57cc4e6273d521d18a95c1488ff9eaa88 (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
99
100
101
102
## 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
    export CLISP_DIR = @CLISP_DIR@
    export CLISP_PATH = @CLISP_PATH@
    CLISP_PREREQ =
else
    export CLISP_DIR = $(clisp_builddir)
    export CLISP_PATH = $(CLISP_DIR)/clisp
    CLISP_PREREQ = $(clisp_link) $(fulldir)
endif

export CLISP_LINKKIT = $(CLISP_DIR)/linkkit
fulldir = $(CLISP_DIR)/full
clisp_link = $(CLISP_DIR)/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: xindy-build-dir

RM_R = rm -rf

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_R) xindy-build-dir
	$(MAKE) -C ordrules ordrulei.c
	test -f ordrules/link.sh || for i in $(ORDRULES_FILES); do cp $(top_srcdir)/rte/ordrules/$$i ordrules/; done
	$(clisp_link) add-module-set ordrules $(fulldir) $@
	cp $@/lisp.run $(binariesdir)/xindy.run
	cp $@/lispinit.mem $(binariesdir)/base.mem

clean-local:
	$(RM_R) xindy-build-dir
	$(MAKE) -C ordrules clean
if !EXT_CLISP
	if [ -e $(clisp_builddir) ]; then $(MAKE) -C $(clisp_builddir) clean; fi
endif

# remove some extra files to match pristine clisp source
distclean-local: clean
	$(MAKE) -C ordrules distclean
if !EXT_CLISP
	$(RM_R) $(clisp_builddir)
endif

# dist rules for clisp are handled via 'darcs dist', so here we include
# only the rest of the 'rte' package + modified clisp's configure script!!

EXTRA_DIST = NEWS README configure ordrules $(clisp_src)/configure