1# -*- Mode: Makefile -*-
2#
3# Makefile.am - automake file for LUA interface to Redland
4#
5# Copyright (C) 2010 David Beckett - http://www.dajobe.org/
6#
7# This package is Free Software and part of Redland http://librdf.org/
8#
9# It is licensed under the following three licenses as alternatives:
10#   1. GNU Lesser General Public License (LGPL) V2.1 or any newer version
11#   2. GNU General Public License (GPL) V2 or any newer version
12#   3. Apache License, V2.0 or any newer version
13#
14# You may not use this file except in compliance with at least one of
15# the above three licenses.
16#
17# See LICENSE.html or LICENSE.txt at the top of this package for the
18# full license terms.
19#
20
21AM_CPPFLAGS=@CPPFLAGS@ @LIBRDF_CPPFLAGS@ -DREDLAND_BINDINGS_VERSION=\"@VERSION@\"
22AM_CFLAGS=@STANDARD_CFLAGS@ @LIBRDF_CPPFLAGS@
23
24AM_LDFLAGS=@LIBRDF_LDFLAGS@
25
26LUA=lua
27
28LUA_PACKAGE=redland
29
30LUA_CFLAGS=@LUA_CFLAGS@
31LUA_LDFLAGS=@LUA_LDFLAGS@
32LUA_SO_SUFFIX=so
33
34SWIG_OUTPUTS=$(LUA_PACKAGE)_wrap.c
35SWIG_CRUFT=
36
37luadir=@LUA_EXTENSION_DIR@
38lua_DATA=$(LUA_PACKAGE).$(LUA_SO_SUFFIX)
39
40EXTRA_DIST= test.lua \
41$(SWIG_OUTPUTS)
42
43CLEANFILES=*.db test-out.rdf \
44$(LUA_PACKAGE)_wrap.o $(LUA_PACKAGE)-stamp \
45$(LUA_PACKAGE).$(LUA_SO_SUFFIX) $(LUA_PACKAGE).bundle
46MAINTAINERCLEANFILES=$(SWIG_OUTPUTS) $(SWIG_CRUFT) $(LUA_PACKAGE)_wrap.c.orig
47
48RUN=@REDLAND_RUN@
49
50SWIG_OPTS=-I$(srcdir)
51
52$(LUA_PACKAGE)_wrap.c: @REDLAND_SWIG@
53	swig -lua -v $(SWIG_OPTS) -module $(LUA_PACKAGE) -o $@ @REDLAND_SWIG@
54
55$(LUA_PACKAGE)_wrap.o: $(LUA_PACKAGE)_wrap.c
56	$(CC) $(DEFS) $(LUA_CFLAGS) $(SWIG_OPTS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(STANDARD_CFLAGS) -fPIC -DPIC $(LUA_PACKAGE)_wrap.c -c -o $@
57
58$(LUA_PACKAGE).$(LUA_SO_SUFFIX): $(LUA_PACKAGE)-stamp
59$(LUA_PACKAGE)-stamp: $(LUA_PACKAGE)_wrap.o
60	$(CC) $(STANDARD_CFLAGS) $(LUA_PACKAGE)_wrap.o $(AM_LDFLAGS) -fPIC -shared $(LDFLAGS) $(LUA_LDFLAGS) -o $(LUA_PACKAGE).$(LUA_SO_SUFFIX)
61	touch $(LUA_PACKAGE)-stamp
62
63test-lua:
64	$(LUA) test.lua
65
66check-local: test-lua
67