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 pyproject.toml \ 14 meson.build 15 16if WITH_PYTHON 17AM_CPPFLAGS = \ 18 -I$(top_builddir)/include \ 19 -I$(top_srcdir)/include \ 20 $(PYTHON_CFLAGS) 21 22pyexec_LTLIBRARIES = libxml2mod.la 23 24libxml2mod_la_SOURCES = libxml.c libxml_wrap.h types.c 25nodist_libxml2mod_la_SOURCES = libxml2-py.h libxml2-py.c 26libxml2mod_la_LDFLAGS = $(AM_LDFLAGS) $(PYTHON_LDFLAGS) -module -avoid-version 27libxml2mod_la_LIBADD = $(top_builddir)/libxml2.la $(PYTHON_LIBS) 28 29BUILT_SOURCES = libxml2-export.c libxml2-py.h libxml2-py.c 30 31python_PYTHON = drv_libxml2.py 32nodist_python_PYTHON = libxml2.py 33 34API_DESC = $(top_srcdir)/doc/libxml2-api.xml $(srcdir)/libxml2-python-api.xml 35GENERATED = libxml2class.py libxml2class.txt $(BUILT_SOURCES) 36CLEANFILES = libxml2.py $(GENERATED) 37 38all-local: libxml2.py 39 40$(GENERATED): $(srcdir)/generator.py $(API_DESC) 41 $(PYTHON) $(srcdir)/generator.py $(srcdir) 42 43# libxml.c #includes libxml2-export.c 44libxml.$(OBJEXT): libxml2-export.c 45 46libxml2.py: $(srcdir)/libxml.py libxml2class.py 47 cat $(srcdir)/libxml.py `test -f libxml2class.py || echo $(srcdir)/`libxml2class.py > $@ 48 49clean-local: 50 rm -rf __pycache__ *.pyc 51 52endif 53