blob: e6a762fc1b4dbaf48696997ebb849576458032e0 [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) \
8 -I$(top_srcdir)/include
Daniel Veillard253aa2c2002-02-02 09:17:16 +00009
Daniel Veillard5fc1f082002-03-27 09:05:40 +000010DOCS_DIR = $(datadir)/doc/libxml2-python-$(LIBXML_VERSION)
Daniel Veillardd2379012002-03-15 22:24:56 +000011# libxml2class.txt is generated
12DOCS = TODO
Daniel Veillardc3e39442002-02-01 09:29:41 +000013
Daniel Veillard4cf998a2002-02-02 10:42:43 +000014EXTRA_DIST = \
15 libxml.c \
Daniel Veillard3ce52572002-02-03 15:08:05 +000016 types.c \
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 \
22 libxml2-python-api.xml \
Daniel Veillard253aa2c2002-02-02 09:17:16 +000023 $(DOCS)
Daniel Veillardc3e39442002-02-01 09:29:41 +000024
Daniel Veillardf544f192002-04-15 12:56:56 +000025libxml2mod_la_LDFLAGS = -module -avoid-version -L$(top_builddir)/.libs
Daniel Veillardd2379012002-03-15 22:24:56 +000026
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +000027if WITH_PYTHON
Daniel Veillard5e5c2d02002-02-09 18:03:01 +000028mylibs = \
29 $(top_builddir)/libxml2.la
30
Daniel Veillard08cccaa2002-08-22 09:47:29 +000031all-local: libxml2.py
Daniel Veillard5e5c2d02002-02-09 18:03:01 +000032
Daniel Veillardb6984ef2002-08-14 16:55:31 +000033pythondir = $(libdir)/python${PYTHON_VERSION}/site-packages
Daniel Veillardd2379012002-03-15 22:24:56 +000034python_LTLIBRARIES = libxml2mod.la
Daniel Veillard5e5c2d02002-02-09 18:03:01 +000035
Daniel Veillardd2379012002-03-15 22:24:56 +000036libxml2mod_la_SOURCES = libxml.c types.c libxml2-py.c
37libxml2mod_la_LIBADD = $(mylibs)
Daniel Veillard96c9af72002-02-01 00:06:44 +000038
Daniel Veillard253aa2c2002-02-02 09:17:16 +000039libxml2.py: $(srcdir)/libxml.py libxml2class.py
40 cat $(srcdir)/libxml.py libxml2class.py > libxml2.py
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +000041
Daniel Veillard7a96efc2002-02-05 16:34:33 +000042install-data-local:
Daniel Veillard2206dbf2002-09-05 08:09:37 +000043 $(mkinstalldirs) $(DESTDIR)$(libdir)/python${PYTHON_VERSION}/site-packages
44 @INSTALL@ -m 0644 libxml2.py $(DESTDIR)$(libdir)/python${PYTHON_VERSION}/site-packages
45 $(mkinstalldirs) $(DESTDIR)$(DOCS_DIR)
Daniel Veillard08cccaa2002-08-22 09:47:29 +000046 @(for doc in $(DOCS) ; \
Daniel Veillard2206dbf2002-09-05 08:09:37 +000047 do @INSTALL@ -m 0644 $$doc $(DESTDIR)$(DOCS_DIR) ; done)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +000048
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +000049GENERATE = generator.py
Daniel Veillard9589d452002-02-02 10:28:17 +000050API_DESC = $(top_srcdir)/doc/libxml2-api.xml $(srcdir)/libxml2-python-api.xml
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +000051GENERATED= $(srcdir)/libxml2class.py \
52 $(srcdir)/libxml2-export.c \
53 $(srcdir)/libxml2-py.c \
54 $(srcdir)/libxml2-py.h
55
William M. Brack61eaba52002-07-21 11:14:18 +000056$(GENERATED): gen_prog
57
58gen_prog: $(srcdir)/$(GENERATE) $(API_DESC)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +000059 cd $(srcdir) && $(PYTHON) $(GENERATE)
William M. Brack61eaba52002-07-21 11:14:18 +000060 touch gen_prog
Daniel Veillard1c18e302002-02-09 22:16:40 +000061
Daniel Veillard38bf6f02002-03-16 22:03:31 +000062$(libxml2mod_la_OBJECTS): $(GENERATED)
Daniel Veillard5997aca2002-03-18 18:36:20 +000063
Daniel Veillard7db38712002-02-07 16:39:11 +000064else
65all:
66endif
Daniel Veillard5997aca2002-03-18 18:36:20 +000067tests test: all
Daniel Veillardcfb05462002-02-02 23:18:22 +000068 cd tests && $(MAKE) tests
69
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +000070clean:
William M. Brack61eaba52002-07-21 11:14:18 +000071 rm -f $(GENERATED) *.o _libxml.so *.pyc libxml2.py gen_prog
Daniel Veillard253aa2c2002-02-02 09:17:16 +000072