py-defs.mk: Move boolean vars to top

Move the PY_XXX = true|false variable definitions meant to be preset
by including makefiles to the top of py-defs.mk to make the structure
of the file clearer.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-03-17 13:43:07 +01:00
commit 5a48143064

View file

@ -1,5 +1,18 @@
include $(JWBDIR)/make/py-version.mk
PY_INSTALL_INIT_PY ?= true
PY_UPDATE_INIT_PY ?= true
PY_INSTALL ?= true
PY_INSTALL_REG ?= true
ifneq ($(PY_INSTALL),true)
PY_INSTALL_REG = false
endif
PY_INSTALL_PYC ?= true
ifneq ($(PY_INSTALL_REG),true)
PY_INSTALL_PYC = false
endif
ifeq ($(DEVELOPMENT),true)
PY_SITE_PACKAGES_PATH := $(PREFIX)/python$(PYTHON_VERSION)/site-packages
else
@ -22,8 +35,6 @@ ifneq ($(PY_INSTALL_DIR),)
PY_INSTALL_DIR_PY ?= $(PY_INSTALL_DIR)
endif
PY_INSTALL_INIT_PY ?= true
# deduce PY_INSTALL_DIR_PY from working directory below .. python/
ifeq ($(PY_INSTALL_DIR_PY),)
PY_INSTALL_PKG_MOD ?= $(shell $(ECHO) $(CWD) | $(SED) 's%.*/python/%%; s%/.*%%')
@ -50,17 +61,6 @@ else
PY_INSTALL_DIR_PYC ?= $(PY_INSTALL_DIR_PY)
endif
PY_UPDATE_INIT_PY ?= true
PY_INSTALL ?= true
PY_INSTALL_REG ?= true
ifneq ($(PY_INSTALL),true)
PY_INSTALL_REG = false
endif
PY_INSTALL_PYC ?= true
ifneq ($(PY_INSTALL_REG),true)
PY_INSTALL_PYC = false
endif
PY_INSTALL_DIRS ?= $(sort $(PY_INSTALL_DIR_PY) $(PY_INSTALL_DIR_PYC))
PY_INSTALLED_PY = $(addprefix $(PY_INSTALL_DIR_PY)/,$(sort $(PY_ALL_PY)))
ifeq ($(PY_INSTALL_PYC),true)