blob: c37c0c299366624690f28cfbb167219758ed1027 [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 Veillard5fc1f082002-03-27 09:05:40 +000012DOCS_DIR = $(datadir)/doc/libxml2-python-$(LIBXML_VERSION)
Daniel Veillardd2379012002-03-15 22:24:56 +000013# libxml2class.txt is generated
William M. Brackcafe8852003-12-21 10:14:35 +000014DOCS = ${srcdir}/TODO
Daniel Veillardc3e39442002-02-01 09:29:41 +000015
Daniel Veillard4cf998a2002-02-02 10:42:43 +000016EXTRA_DIST = \
17 libxml.c \
Daniel Veillard3ce52572002-02-03 15:08:05 +000018 types.c \
Daniel Veillarda6d2e9e2002-03-09 10:22:50 +000019 setup.py \
20 setup.py.in \
Daniel Veillard4cf998a2002-02-02 10:42:43 +000021 generator.py \
22 libxml_wrap.h \
23 libxml.py \
Daniel Veillard7b4b2f92003-01-06 13:11:20 +000024 drv_libxml2.py \
Daniel Veillard4cf998a2002-02-02 10:42:43 +000025 libxml2-python-api.xml \
Daniel Veillard253aa2c2002-02-02 09:17:16 +000026 $(DOCS)
Daniel Veillardc3e39442002-02-01 09:29:41 +000027
Daniel Veillardd392ba72004-08-04 14:56:45 +000028libxml2mod_la_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@ @WIN32_EXTRA_LDFLAGS@ -module -avoid-version -L$(top_builddir)/.libs
Daniel Veillardd2379012002-03-15 22:24:56 +000029
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +000030if WITH_PYTHON
Daniel Veillard5e5c2d02002-02-09 18:03:01 +000031mylibs = \
32 $(top_builddir)/libxml2.la
33
Daniel Veillard08cccaa2002-08-22 09:47:29 +000034all-local: libxml2.py
Daniel Veillard5e5c2d02002-02-09 18:03:01 +000035
Daniel Veillardd2379012002-03-15 22:24:56 +000036python_LTLIBRARIES = libxml2mod.la
Daniel Veillard5e5c2d02002-02-09 18:03:01 +000037
Daniel Veillardd2379012002-03-15 22:24:56 +000038libxml2mod_la_SOURCES = libxml.c types.c libxml2-py.c
Daniel Veillardd392ba72004-08-04 14:56:45 +000039libxml2mod_la_LIBADD = $(mylibs) @CYGWIN_EXTRA_PYTHON_LIBADD@
Daniel Veillard96c9af72002-02-01 00:06:44 +000040
William M. Brack106cad62004-12-23 15:56:12 +000041libxml2.py: $(srcdir)/libxml.py libxml2class.py
42 cat $(srcdir)/libxml.py libxml2class.py > libxml2.py
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +000043
Daniel Veillard7a96efc2002-02-05 16:34:33 +000044install-data-local:
Daniel Veillard38b80a82003-05-14 18:59:00 +000045 $(mkinstalldirs) $(DESTDIR)$(pythondir)
46 @INSTALL@ -m 0644 libxml2.py $(DESTDIR)$(pythondir)
William M. Brackcafe8852003-12-21 10:14:35 +000047 @INSTALL@ -m 0644 $(srcdir)/drv_libxml2.py $(DESTDIR)$(pythondir)
Daniel Veillard2206dbf2002-09-05 08:09:37 +000048 $(mkinstalldirs) $(DESTDIR)$(DOCS_DIR)
Daniel Veillard08cccaa2002-08-22 09:47:29 +000049 @(for doc in $(DOCS) ; \
Daniel Veillard2206dbf2002-09-05 08:09:37 +000050 do @INSTALL@ -m 0644 $$doc $(DESTDIR)$(DOCS_DIR) ; done)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +000051
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +000052GENERATE = generator.py
Daniel Veillard9589d452002-02-02 10:28:17 +000053API_DESC = $(top_srcdir)/doc/libxml2-api.xml $(srcdir)/libxml2-python-api.xml
William M. Brack106cad62004-12-23 15:56:12 +000054GENERATED= libxml2class.py \
55 libxml2-export.c \
56 libxml2class.txt \
57 libxml2-py.c \
58 libxml2-py.h
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +000059
Daniel Veillard377e1a92004-04-16 16:30:05 +000060CLEANFILES= $(GENERATED) gen_prog libxml2.py
61
William M. Brack61eaba52002-07-21 11:14:18 +000062$(GENERATED): gen_prog
63
64gen_prog: $(srcdir)/$(GENERATE) $(API_DESC)
William M. Brack106cad62004-12-23 15:56:12 +000065 $(PYTHON) $(srcdir)/$(GENERATE) $(srcdir)
William M. Brack61eaba52002-07-21 11:14:18 +000066 touch gen_prog
Daniel Veillard1c18e302002-02-09 22:16:40 +000067
Daniel Veillard38bf6f02002-03-16 22:03:31 +000068$(libxml2mod_la_OBJECTS): $(GENERATED)
Daniel Veillard5997aca2002-03-18 18:36:20 +000069
Daniel Veillard7db38712002-02-07 16:39:11 +000070else
71all:
72endif
Daniel Veillard5997aca2002-03-18 18:36:20 +000073tests test: all
William M. Bracke9449c52004-07-11 14:41:20 +000074 cd tests && $(MAKE) MAKEFLAGS+=--silent tests
Daniel Veillardcfb05462002-02-02 23:18:22 +000075