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