2002-02-09 21:03:01 +03:00
# Makefile for libxml2 python library
AUTOMAKE_OPTIONS = 1.4 foreign
2002-02-02 12:17:16 +03:00
SUBDIRS = . tests
2002-02-09 21:03:01 +03:00
INCLUDES = \
-I/usr/include/python$( PYTHON_VERSION) \
-I$( PYTHON_INCLUDES) \
-I$( top_srcdir) /include
2002-02-02 12:17:16 +03:00
2002-02-09 21:03:01 +03:00
DOCS_DIR = $( prefix) /share/doc/libxml2-python-$( LIBXML_VERSION)
2002-02-02 12:17:16 +03:00
DOCS = TODO libxml2class.txt
2002-02-01 12:29:41 +03:00
2002-02-02 13:42:43 +03:00
EXTRA_DIST = \
libxml.c \
2002-02-03 18:08:05 +03:00
types.c \
2002-02-02 13:42:43 +03:00
generator.py \
libxml_wrap.h \
libxml.py \
libxml2-python-api.xml \
2002-02-02 12:17:16 +03:00
$( DOCS)
2002-02-01 12:29:41 +03:00
2002-02-01 02:42:44 +03:00
i f W I T H _ P Y T H O N
2002-02-09 21:03:01 +03:00
mylibs = \
$( top_builddir) /libxml2.la
all : libxml 2mod .so libxml 2.py
LDADD = -lxml2
CFLAGS = -Wall -g
pythondir = $( prefix) /lib/python${ PYTHON_VERSION } /site-packages
python_PROGRAMS = libxml2mod.so
libxml2mod_so_SOURCES =
libxml2mod_so_LDFLAGS = $( mylibs) $( LIBS) -shared -Wl,-soname,libxml2mod.so
noinst_LTLIBRARIES = libxmlmodule.la
libxmlmodule_la_SOURCES = libxml.c types.c libxml2-py.c
2002-02-18 00:26:33 +03:00
libxml2mod.so : $( libxmlmodule_la_OBJECTS ) $( mylibs )
2002-02-09 21:03:01 +03:00
$( LINK) -o $@ $( libxmlmodule_la_OBJECTS) $( libxml2mod_so_LDFLAGS)
2002-02-01 03:06:44 +03:00
2002-02-02 12:17:16 +03:00
libxml2.py : $( srcdir ) /libxml .py libxml 2class .py
cat $( srcdir) /libxml.py libxml2class.py > libxml2.py
2002-02-01 02:42:44 +03:00
2002-02-05 19:34:33 +03:00
install-data-local :
$( mkinstalldirs) $( DESTDIR) $( PYTHON_SITE_PACKAGES)
-@INSTALL@ -m 0644 libxml2.py $( DESTDIR) $( PYTHON_SITE_PACKAGES)
$( mkinstalldirs) $( DESTDIR) $( DOCS_DIR)
-@( for doc in $( DOCS) ; \
do @INSTALL@ -m 0644 $$ doc $( DESTDIR) $( DOCS_DIR) ; done )
2002-02-01 02:42:44 +03:00
GENERATE = generator.py
2002-02-02 13:28:17 +03:00
API_DESC = $( top_srcdir) /doc/libxml2-api.xml $( srcdir) /libxml2-python-api.xml
2002-02-01 02:42:44 +03:00
GENERATED = $( srcdir) /libxml2class.py \
$( srcdir) /libxml2-export.c \
$( srcdir) /libxml2-py.c \
$( srcdir) /libxml2-py.h
$(GENERATED) : $( srcdir ) /$( GENERATE ) $( API_DESC )
cd $( srcdir) && $( PYTHON) $( GENERATE)
2002-02-10 01:16:40 +03:00
$(libxmlmodule_la_OBJECTS) : $( GENERATED )
2002-02-07 19:39:11 +03:00
e l s e
all :
e n d i f
2002-02-01 02:42:44 +03:00
2002-02-03 18:08:05 +03:00
tests : all
2002-02-03 02:18:22 +03:00
cd tests && $( MAKE) tests
2002-02-01 02:42:44 +03:00
clean :
2002-02-01 20:56:45 +03:00
rm -f $( GENERATED) *.o _libxml.so *.pyc libxml2.py
2002-02-02 12:17:16 +03:00