diff --git a/src/ifcopenshell-python/Makefile b/src/ifcopenshell-python/Makefile index 11fa50887e..b814cb3163 100644 --- a/src/ifcopenshell-python/Makefile +++ b/src/ifcopenshell-python/Makefile @@ -27,26 +27,15 @@ SED:=sed -i '' -e endif endif -# TODO: we should simplify this at some point... -ifeq ($(PYVERSION), py310) -PYNUMBER:=310 -endif -ifeq ($(PYVERSION), py311) -PYNUMBER:=311 -endif -ifeq ($(PYVERSION), py312) -PYNUMBER:=312 -endif -ifeq ($(PYVERSION), py313) -PYNUMBER:=313 -endif -ifeq ($(PYVERSION), py314) -PYNUMBER:=314 -endif -ifndef PYNUMBER -$(error Unsupported PYVERSION '$(PYVERSION)') +SUPPORTED_PYVERSIONS := py310 py311 py312 py313 py314 + +ifeq ($(filter $(PYVERSION),$(SUPPORTED_PYVERSIONS)),) +$(error Unsupported PYVERSION=$(PYVERSION). Must be one of $(SUPPORTED_PYVERSIONS)) endif +PYMINOR:=$(subst py3,,$(PYVERSION)) +PYNUMBER:=3$(PYMINOR) + # We actually do support glibc 2.28-2.30 (see #5636) # but those are old and there's no demand for it. ifeq ($(PLATFORM), linux64)