Most targets delegated to `setup.py' are now run, in parallel, on
multiple Python versions listed in the new Makefile variable `PYTHONS'.
The exceptions are `gen' and `dist', which only make sense with a single
Python.
Targets which can run multiple Python versions now support per-version
options for targets: set the variable OPTS-TARGET/PYTHON (e.g.,
`OPTS-install/python3.5').
default: all
PYTHON ?= python
default: all
PYTHON ?= python
prefix ?= /usr/local
###--------------------------------------------------------------------------
prefix ?= /usr/local
###--------------------------------------------------------------------------
###--------------------------------------------------------------------------
### Useful targets implemented by the `setup.py' program.
###--------------------------------------------------------------------------
### Useful targets implemented by the `setup.py' program.
CMD-gen ?= build_gen
PYTARGETS += all
CMD-all ?= build
CMD-gen ?= build_gen
PYTARGETS += all
CMD-all ?= build
+$(foreach p,$(PYTHONS),all/$p):: all/%: gen
PYTARGETS += clean
OPTS-clean ?= --all
clean-hook::; rm -f MANIFEST RELEASE
PYTARGETS += clean
OPTS-clean ?= --all
clean-hook::; rm -f MANIFEST RELEASE
+SINGLE_PYTARGETS += dist
CMD-dist ?= sdist
OPTS-dist += --dist-dir .
CMD-dist ?= sdist
OPTS-dist += --dist-dir .
###--------------------------------------------------------------------------
### Interfacing `setup.py' to make.
###--------------------------------------------------------------------------
### Interfacing `setup.py' to make.
-pysetup = $(PYTHON) setup.py \
+pysetup = $(or $2,$(PYTHON)) setup.py \
$(if $(filter-out undefined,$(origin CMD-$1)),$(CMD-$1),$1) \
$(if $(filter-out undefined,$(origin CMD-$1)),$(CMD-$1),$1) \
+ $(OPTS-$1) $(OPTS-$1/$(or $2,$(PYTHON)))
-$(foreach t, $(PYTARGETS), $t-hook):: %:
-$(PYTARGETS):: %: %-hook setup.py
+PYTHON_PYTARGETS = $(foreach t, $(PYTARGETS), \
+ $(foreach p, $(PYTHONS), \
+ $t/$p))
+ALL_PYTARGETS = $(PYTARGETS)
+ALL_PYTARGETS += $(SINGLE_PYTARGETS) $(PYTHON_PYTARGETS)
+
+$(foreach t, $(ALL_PYTARGETS), $t-hook):: %:
+
+$(SINGLE_PYTARGETS):: %: %-hook setup.py
+$(PYTARGETS):: %: %-hook $(foreach p, $(PYTHONS), %/$p)
+$(PYTHON_PYTARGETS):: %: %-hook setup.py
+ $(call pysetup,$(patsubst %/,%,$(dir $*)),$(notdir $*))
+.PHONY: $(ALL_PYTARGETS)
###--------------------------------------------------------------------------
### Release builds.
###--------------------------------------------------------------------------
### Release builds.