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 | uninstall-local:
|
---|
53 | @(for doc in $(DOCS) ; \
|
---|
54 | do rm $(DESTDIR)$(DOCS_DIR)/`basename $$doc` ; done)
|
---|
55 | rm $(DESTDIR)$(pythondir)/drv_libxml2.py
|
---|
56 | rm $(DESTDIR)$(pythondir)/libxml2.py
|
---|
57 |
|
---|
58 | GENERATE = generator.py
|
---|
59 | API_DESC = $(top_srcdir)/doc/libxml2-api.xml $(srcdir)/libxml2-python-api.xml
|
---|
60 | GENERATED= libxml2class.py \
|
---|
61 | libxml2-export.c \
|
---|
62 | libxml2class.txt \
|
---|
63 | libxml2-py.c \
|
---|
64 | libxml2-py.h
|
---|
65 |
|
---|
66 | CLEANFILES= $(GENERATED) gen_prog libxml2.py
|
---|
67 |
|
---|
68 | $(GENERATED): gen_prog
|
---|
69 |
|
---|
70 | gen_prog: $(srcdir)/$(GENERATE) $(API_DESC)
|
---|
71 | $(PYTHON) $(srcdir)/$(GENERATE) $(srcdir)
|
---|
72 | touch gen_prog
|
---|
73 |
|
---|
74 | $(libxml2mod_la_OBJECTS): $(GENERATED)
|
---|
75 |
|
---|
76 | else
|
---|
77 | all:
|
---|
78 | endif
|
---|
79 | tests test: all
|
---|
80 | cd tests && $(MAKE) MAKEFLAGS+=--silent tests
|
---|
81 |
|
---|