1# Makefile for libxml2 python library
2AUTOMAKE_OPTIONS = 1.4 foreign
3
4SUBDIRS= . tests
5
6AM_CFLAGS = $(LIBXML_CFLAGS)
7
8DOCS_DIR = $(datadir)/doc/libxslt-python-$(LIBXSLT_VERSION)
9# libxsltclass.txt is generated
10DOCS = TODO
11
12EXTRA_DIST = 			\
13	libxslt.c		\
14	types.c			\
15	generator.py		\
16	libxml_wrap.h		\
17	libxslt_wrap.h		\
18	libxsl.py		\
19	libxslt-python-api.xml	\
20	$(DOCS)
21
22libxsltmod_la_LDFLAGS =  $(WIN32_EXTRA_LDFLAGS) -module -avoid-version
23
24if WITH_PYTHON
25mylibs = \
26	$(top_builddir)/libxslt/libxslt.la \
27	$(top_builddir)/libexslt/libexslt.la
28
29all-local: libxslt.py
30
31python_LTLIBRARIES = libxsltmod.la
32
33libxsltmod_la_CPPFLAGS = \
34	-I$(PYTHON_INCLUDES) \
35	-I$(top_srcdir)/libxslt \
36	-I$(top_srcdir) \
37	-I../libexslt
38libxsltmod_la_SOURCES = libxslt.c types.c
39nodist_libxsltmod_la_SOURCES = libxslt-py.c
40libxsltmod_la_LIBADD = $(mylibs) $(PYTHON_LIBS)
41
42libxslt.py: $(srcdir)/libxsl.py libxsltclass.py
43	cat $(srcdir)/libxsl.py libxsltclass.py > $@
44
45install-data-local:
46	$(MKDIR_P) $(DESTDIR)$(pythondir)
47	$(INSTALL) -m 0644 libxslt.py $(DESTDIR)$(pythondir)
48	$(MKDIR_P) $(DESTDIR)$(DOCS_DIR)
49	@(for doc in $(DOCS) ; \
50	   do $(INSTALL) -m 0644 $(srcdir)/$$doc $(DESTDIR)$(DOCS_DIR) ; done)
51
52uninstall-local:
53	rm -f $(DESTDIR)$(pythondir)/libxslt.py
54	rm -rf $(DESTDIR)$(DOCS_DIR)
55
56GENERATE = generator.py
57API_DESC = $(top_srcdir)/doc/libxslt-api.xml $(srcdir)/libxslt-python-api.xml
58GENERATED= libxsltclass.py \
59	   libxslt-export.c \
60	   libxslt-py.c \
61	   libxslt-py.h \
62	   libxsltclass.txt
63
64$(GENERATED): gen_prog
65
66gen_prog:  $(srcdir)/$(GENERATE) $(API_DESC)
67	SRCDIR=$(srcdir) $(PYTHON) $(srcdir)/$(GENERATE)
68	touch gen_prog
69
70$(libxsltmod_la_OBJECTS): $(GENERATED)
71
72endif
73
74tests test: all
75	cd tests && $(MAKE) tests
76
77CLEANFILES= $(GENERATED) *.o libxslt.so *.pyc libxslt.py gen_prog
78