blob: 68d2236d345b679276e830d43b7a3bb0e456b33b [file] [log] [blame]
Daniel Veillard5e5c2d02002-02-09 18:03:01 +00001# Makefile for libxml2 python library
2AUTOMAKE_OPTIONS = 1.4 foreign
3
Daniel Veillard253aa2c2002-02-02 09:17:16 +00004SUBDIRS= . tests
5
Daniel Veillard5e5c2d02002-02-09 18:03:01 +00006INCLUDES = \
Daniel Veillard5e5c2d02002-02-09 18:03:01 +00007 -I$(PYTHON_INCLUDES) \
Daniel Veillard43b8e572004-10-12 22:20:10 +00008 -I$(top_srcdir)/include \
William M. Brack106cad62004-12-23 15:56:12 +00009 -I$(top_builddir)/include \
10 -I$(top_builddir)/$(subdir)
Daniel Veillard253aa2c2002-02-02 09:17:16 +000011
Daniel Veillard5ac88232008-02-19 07:54:52 +000012docsdir = $(datadir)/doc/libxml2-python-$(LIBXML_VERSION)
Daniel Veillardd2379012002-03-15 22:24:56 +000013# libxml2class.txt is generated
Daniel Veillard5ac88232008-02-19 07:54:52 +000014dist_docs_DATA = TODO
Daniel Veillardc3e39442002-02-01 09:29:41 +000015
Daniel Veillard4cf998a2002-02-02 10:42:43 +000016EXTRA_DIST = \
Daniel Veillarda6d2e9e2002-03-09 10:22:50 +000017 setup.py \
18 setup.py.in \
Daniel Veillard4cf998a2002-02-02 10:42:43 +000019 generator.py \
20 libxml_wrap.h \
21 libxml.py \
Daniel Veillard5ac88232008-02-19 07:54:52 +000022 libxml2-python-api.xml
Daniel Veillardc3e39442002-02-01 09:29:41 +000023
Daniel Veillard04db6842006-10-11 09:27:56 +000024libxml2mod_la_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@ @WIN32_EXTRA_LDFLAGS@ -module -avoid-version
Daniel Veillardd2379012002-03-15 22:24:56 +000025
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +000026if WITH_PYTHON
Daniel Veillard5e5c2d02002-02-09 18:03:01 +000027mylibs = \
28 $(top_builddir)/libxml2.la
29
Daniel Veillardd2379012002-03-15 22:24:56 +000030python_LTLIBRARIES = libxml2mod.la
Daniel Veillard5e5c2d02002-02-09 18:03:01 +000031
Paul Smith38af74f2010-03-15 10:22:25 +010032libxml2mod_la_SOURCES = $(srcdir)/libxml.c $(srcdir)/types.c
Daniel Veillard5ac88232008-02-19 07:54:52 +000033nodist_libxml2mod_la_SOURCES = libxml2-py.c
Pacho Ramos1ea6b142012-05-15 19:36:02 +080034libxml2mod_la_LIBADD = $(mylibs) @CYGWIN_EXTRA_PYTHON_LIBADD@ @WIN32_EXTRA_PYTHON_LIBADD@ @PYTHON_LIBS@ -lpython$(PYTHON_VERSION)
Daniel Veillard96c9af72002-02-01 00:06:44 +000035
Paul Smith38af74f2010-03-15 10:22:25 +010036$(srcdir)/libxml.c: libxml2-py.h # to generate before to compile
Daniel Veillard5ac88232008-02-19 07:54:52 +000037
38
William M. Brack106cad62004-12-23 15:56:12 +000039libxml2.py: $(srcdir)/libxml.py libxml2class.py
Daniel Veillard5ac88232008-02-19 07:54:52 +000040 cat $(srcdir)/libxml.py libxml2class.py > $@
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +000041
Daniel Veillard5ac88232008-02-19 07:54:52 +000042python_DATA = \
43 libxml2.py
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +000044
Daniel Veillard5ac88232008-02-19 07:54:52 +000045dist_python_DATA = \
46 drv_libxml2.py
Daniel Veillard9ebb6322008-01-11 07:19:24 +000047
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +000048GENERATE = generator.py
Daniel Veillard9589d452002-02-02 10:28:17 +000049API_DESC = $(top_srcdir)/doc/libxml2-api.xml $(srcdir)/libxml2-python-api.xml
William M. Brack106cad62004-12-23 15:56:12 +000050GENERATED= libxml2class.py \
51 libxml2-export.c \
52 libxml2class.txt \
53 libxml2-py.c \
54 libxml2-py.h
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +000055
Daniel Veillard377e1a92004-04-16 16:30:05 +000056CLEANFILES= $(GENERATED) gen_prog libxml2.py
57
William M. Brack61eaba52002-07-21 11:14:18 +000058$(GENERATED): gen_prog
59
60gen_prog: $(srcdir)/$(GENERATE) $(API_DESC)
William M. Brack106cad62004-12-23 15:56:12 +000061 $(PYTHON) $(srcdir)/$(GENERATE) $(srcdir)
William M. Brack61eaba52002-07-21 11:14:18 +000062 touch gen_prog
Daniel Veillard7db38712002-02-07 16:39:11 +000063endif
Daniel Veillard5ac88232008-02-19 07:54:52 +000064
Daniel Veillard5997aca2002-03-18 18:36:20 +000065tests test: all
William M. Bracke9449c52004-07-11 14:41:20 +000066 cd tests && $(MAKE) MAKEFLAGS+=--silent tests
Daniel Veillardcfb05462002-02-02 23:18:22 +000067