1# Makefile for libxml2 python library
2AUTOMAKE_OPTIONS = 1.4 foreign
3
4SUBDIRS= . tests
5
6INCLUDES = \
7	-I$(PYTHON_INCLUDES) \
8	-I$(top_srcdir)/include	\
9	-I$(top_builddir)/include \
10	-I$(top_builddir)/$(subdir)
11
12docsdir = $(datadir)/doc/libxml2-python-$(LIBXML_VERSION)
13# libxml2class.txt is generated
14dist_docs_DATA = TODO
15
16EXTRA_DIST = 			\
17	setup.py		\
18	setup.py.in		\
19	generator.py		\
20	libxml_wrap.h		\
21	libxml.py		\
22	libxml2-python-api.xml
23
24libxml2mod_la_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@ @WIN32_EXTRA_LDFLAGS@ -module -avoid-version 
25
26if WITH_PYTHON
27mylibs = \
28	$(top_builddir)/libxml2.la
29
30python_LTLIBRARIES = libxml2mod.la
31
32libxml2mod_la_SOURCES = $(srcdir)/libxml.c $(srcdir)/types.c
33nodist_libxml2mod_la_SOURCES = libxml2-py.c
34libxml2mod_la_LIBADD = $(mylibs) @CYGWIN_EXTRA_PYTHON_LIBADD@ @PYTHON_LIBS@
35
36$(srcdir)/libxml.c: libxml2-py.h # to generate before to compile
37
38
39libxml2.py: $(srcdir)/libxml.py libxml2class.py
40	cat $(srcdir)/libxml.py libxml2class.py > $@
41
42python_DATA = \
43	libxml2.py
44
45dist_python_DATA = \
46	drv_libxml2.py
47	
48GENERATE = generator.py
49API_DESC = $(top_srcdir)/doc/libxml2-api.xml $(srcdir)/libxml2-python-api.xml
50GENERATED= libxml2class.py \
51           libxml2-export.c \
52           libxml2class.txt \
53	   libxml2-py.c \
54	   libxml2-py.h
55
56CLEANFILES= $(GENERATED) gen_prog libxml2.py
57
58$(GENERATED): gen_prog
59
60gen_prog: $(srcdir)/$(GENERATE) $(API_DESC)
61	$(PYTHON) $(srcdir)/$(GENERATE) $(srcdir)
62	touch gen_prog
63endif
64
65tests test: all
66	cd tests && $(MAKE) MAKEFLAGS+=--silent tests
67
68