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