1# Makefile for libxml2 python library 2 3# We use a rule with multiple output files which creates problems with 4# parallel builds. 5.NOTPARALLEL: 6 7SUBDIRS = . tests 8 9EXTRA_DIST = \ 10 generator.py \ 11 libxml.py \ 12 libxml2-python-api.xml 13 14if WITH_PYTHON 15AM_CPPFLAGS = \ 16 -I$(top_builddir)/include \ 17 -I$(top_srcdir)/include \ 18 $(PYTHON_CFLAGS) 19 20pyexec_LTLIBRARIES = libxml2mod.la 21 22libxml2mod_la_SOURCES = libxml.c libxml_wrap.h types.c 23nodist_libxml2mod_la_SOURCES = libxml2-py.h libxml2-py.c 24libxml2mod_la_LDFLAGS = $(AM_LDFLAGS) $(PYTHON_LDFLAGS) -module -avoid-version 25libxml2mod_la_LIBADD = $(top_builddir)/libxml2.la $(PYTHON_LIBS) 26 27BUILT_SOURCES = libxml2-export.c libxml2-py.h libxml2-py.c 28 29python_PYTHON = drv_libxml2.py 30nodist_python_PYTHON = libxml2.py 31 32API_DESC = $(top_srcdir)/doc/libxml2-api.xml $(srcdir)/libxml2-python-api.xml 33GENERATED = libxml2class.py libxml2class.txt $(BUILT_SOURCES) 34CLEANFILES = libxml2.py $(GENERATED) 35 36all-local: libxml2.py 37 38$(GENERATED): $(srcdir)/generator.py $(API_DESC) 39 $(PYTHON) $(srcdir)/generator.py $(srcdir) 40 41# libxml.c #includes libxml2-export.c 42libxml.$(OBJEXT): libxml2-export.c 43 44libxml2.py: $(srcdir)/libxml.py libxml2class.py 45 cat $(srcdir)/libxml.py `test -f libxml2class.py || echo $(srcdir)/`libxml2class.py > $@ 46 47clean-local: 48 rm -rf __pycache__ *.pyc 49 50endif 51