Hash :
ea8f7c92
Author :
Date :
2022-09-06T00:47:00
autotools: Disable parallel Python build Makefile rules with multiple output files don't work reliably with parallel builds. There are several ways to fix this issue with GNU Make, but they aren't portable. I'd be really interested in a totally reliable, cross-platform solution to this problem. .NOTPARALLEL is also understood by BSD make, at least.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
# Makefile for libxml2 python library
# We use a rule with multiple output files which creates problems with
# parallel builds.
.NOTPARALLEL:
SUBDIRS = . tests
docsdir = $(docdir)/python
dist_docs_DATA = TODO
EXTRA_DIST = \
generator.py \
libxml.py \
libxml2-python-api.xml
if WITH_PYTHON
AM_CPPFLAGS = \
-I$(top_builddir)/include \
-I$(top_srcdir)/include \
$(PYTHON_CFLAGS)
pyexec_LTLIBRARIES = libxml2mod.la
libxml2mod_la_SOURCES = libxml.c libxml_wrap.h types.c
nodist_libxml2mod_la_SOURCES = libxml2-py.h libxml2-py.c
libxml2mod_la_LDFLAGS = $(AM_LDFLAGS) $(PYTHON_LDFLAGS) -module -avoid-version
libxml2mod_la_LIBADD = $(top_builddir)/libxml2.la $(PYTHON_LIBS)
BUILT_SOURCES = libxml2-export.c libxml2-py.h libxml2-py.c
python_PYTHON = drv_libxml2.py
nodist_python_PYTHON = libxml2.py
API_DESC = $(top_srcdir)/doc/libxml2-api.xml $(srcdir)/libxml2-python-api.xml
GENERATED = libxml2class.py libxml2class.txt $(BUILT_SOURCES)
CLEANFILES = libxml2.py $(GENERATED)
all-local: libxml2.py
$(GENERATED): $(srcdir)/generator.py $(API_DESC)
$(PYTHON) $(srcdir)/generator.py $(srcdir)
# libxml.c #includes libxml2-export.c
libxml.$(OBJEXT): libxml2-export.c
libxml2.py: $(srcdir)/libxml.py libxml2class.py
cat $(srcdir)/libxml.py `test -f libxml2class.py || echo $(srcdir)/`libxml2class.py > $@
clean-local:
rm -rf __pycache__ *.pyc
endif