diff --git a/make/defs.mk b/make/defs.mk index 0533ae55..46647ac1 100644 --- a/make/defs.mk +++ b/make/defs.mk @@ -12,7 +12,7 @@ space := $(empty) $(empty) comma := , Q ?= @ -# ----- executables +# ----- Executables include $(JWBDIR)/make/projects.mk @@ -99,7 +99,7 @@ ifndef PRISTINE_MAKE PRISTINE_MAKE := umask $(MINIMAL_UMASK) && MAKEFLAGS=$(MINIMAL_MAKEFLAGS) LD_LIBRARY_PATH=$(MINIMAL_LD_LIBRARY_PATH) PATH=$(MINIMAL_PATH) $(MAKE) endif -# ----- function definitions +# ----- Function definitions reverse = $(if $(wordlist 2,2,$(1)),$(call reverse,$(wordlist 2,$(words $(1)),$(1))) $(firstword $(1)),$(1)) make_subdirs = set -e; for D in $(SUBDIRS) ; do make -C $$D ; done @@ -123,7 +123,7 @@ endef uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1))) -# ----- standard variables +# ----- Standard variables ifeq ($(PROJECT),) PROJECT := $(shell $(ECHO) $(patsubst $(FLAVOUR_PREFIX)%,%,$(notdir $(realpath $(TOPDIR)))) | $(SED) 's/-[0-9]\+\..*//') @@ -146,7 +146,7 @@ ifdef BUILD_LIBS_PREFIX endif endif -# ----- user and organization +# ----- User and organization ifndef BUILD_USER BUILD_USER := $(shell $(ID) -un) @@ -173,7 +173,7 @@ PUBLIC_PATH_DEVEL_DOC = /doc/devel UPLOAD_URL_DEVEL_DOC = rsync_ssh://$(JANWARE_USER)@janware.com:/srv/dav/pub/clients/$(JANWARE_CLIENT)/$(PUBLIC_PATH_DEVEL_DOC) PKG_VENDOR ?= janware GmbH -# ----- packaging variables +# ----- Packaging variables PKG_SH_EXE := /bin/bash $(JWB_SCRIPT_DIR)/pkg.sh LOG_INSTALL_SH := $(PKG_SH_EXE) log-install -f $(PKG_FORMAT) @@ -259,7 +259,7 @@ BUILD_NUMBER = $(word 4,$(DIST_VERSION_WORDS)) MAJOR_MINOR_RELEASE = $(MAJOR_VERSION).$(MINOR_VERSION).$(RELEASE_VERSION) CVS_RSH ?= /usr/bin/ssh -# ----- input dirs +# ----- Input dirs JW_PKG_DIR = $(JWBDIR) JW_PKG_CONF_BASE_DIR ?= $(firstword $(wildcard $(JW_PKG_DIR)/conf /etc/opt/jw-pkg)) @@ -381,7 +381,7 @@ INSTALLED_CGI += $(addprefix $(INSTALL_CGIDIR)/,$(EXE_CGI)) # -- SYSTEMD INSTALLATION_FILE_TYPES += SYSTEMD BUILD_SYSTEMDDIR = $(TOPDIR)/bin/systemd -LOCAL_SYSTEMD += $(filter-out $(DONT_INSTALL),$(wildcard *.service *.mount *.target *.timer *.socket)) +LOCAL_SYSTEMD += $(filter-out $(DONT_INSTALL),$(wildcard *.service *.mount *.target *.timer *.socket *.slice)) INSTALL_SYSTEMDDIR = $(SYSTEMD_DIR) INSTALLED_SYSTEMD += $(addprefix $(INSTALL_SYSTEMDDIR)/,$(LOCAL_SYSTEMD)) @@ -518,11 +518,11 @@ endif # ----- local.mk $(eval $(call try_include,$(JWBDIR)/make/local.mk)) - -#-include $(JWBDIR)/make/local.mk $(eval $(call try_include,$(TOPDIR)/make/local.mk)) $(eval $(call try_include,local.mk)) +# ----- Omnipresent rules + all: nothing: diff --git a/make/platform.mk b/make/platform.mk index 198a086c..117b4dc0 100644 --- a/make/platform.mk +++ b/make/platform.mk @@ -12,12 +12,20 @@ endef CACHE_PROJECTS_MK := $(JWBDIR)/cache-projects.mk -$(eval $(call try_include,$(CACHE_PROJECTS_MK))) $(eval $(call try_include,$(TOPDIR)/make/.cache-project.mk)) +$(eval $(call try_include,$(CACHE_PROJECTS_MK))) $(eval $(call try_include,$(JWBDIR)/make/pre-local.mk)) $(eval $(call try_include,$(TOPDIR)/make/pre-local.mk)) $(eval $(call try_include,pre-local.mk)) +ifdef PREREQ_RUN_ADD + # If PREREQ_RUN_ADD was defined in pre-local.mk, set these potentially cached + # paths up for fresh calculation in ldlibpath.mk / py-path.mk + undefine JW_PKG_EXE_PATH + undefine JW_PKG_LD_LIBRARY_PATH + undefine JW_PKG_PYTHON_PATH + PREREQ_RUN += $(PREREQ_RUN_ADD) +endif # -- What do I know about myself? VERSION_FILE ?= $(firstword $(wildcard VERSION) $(TOPDIR)/VERSION) diff --git a/make/projects-dir.mk b/make/projects-dir.mk index dc616693..96d0a2ee 100644 --- a/make/projects-dir.mk +++ b/make/projects-dir.mk @@ -270,12 +270,11 @@ pkg-%: $(filter-out $(UNAVAILABLE_TARGETS),pull.done) # --- generic cleanup targets -clean-dirs: - echo $(sort $(subst /,,$(dir $(wildcard */*.done)))) | xargs -r $(JW_PKG_PY_BUILD) clean - clean-all-dirs: + $(JW_PKG_PY_BUILD) clean $(sort $(subst /,,$(dir $(wildcard */*.done))) $(PROJECTS)) + +clean-dirs: $(JW_PKG_PY_BUILD) clean $(PROJECTS) - make clean-dirs purge: $(SSH_WRAPPER_SH) ifneq ($(PURGE_SH),/bin/bash purge-not-found) diff --git a/make/py-defs.mk b/make/py-defs.mk index 4c104b9f..b96d5cf4 100644 --- a/make/py-defs.mk +++ b/make/py-defs.mk @@ -71,20 +71,6 @@ ifeq ($(PY_INSTALL_REG),true) PY_INSTALLED_REG = $(PY_INSTALLED_PY) $(PY_INSTALLED_PYC) $(PY_INSTALLED_PY_TYPED) endif -ifeq ($(origin PYTHONPATH),undefined) - PYTHONPATH := $(JW_PKG_PYTHON_PATH) -endif - -#PYTHONPATH = $(subst $(space),,$(ENV_PYTHONPATH)$(foreach d,$(PY_MODULE_DIRS),:$(d))) -MYPYPATH = $(PYTHONPATH) -export PYTHONPATH MYPYPATH - -# not used anywhere -#PY_PROJ_MODULE_DIRS ?= $(wildcard $(foreach subdir,/tools/python /src/python,$(addsuffix $(subdir),$(TOPDIR) $(PY_PREREQ_BUILD_DIRS)))) -#PY_MODULE_DIRS ?= $(PY_PROJ_MODULE_DIRS) -#PY_MODULES ?= $(PY_PROJ_MODULES) -#PY_PROJ_MODULES += $(dir $(wildcard $(PY_MODULE_DIRS)/*/__init__.py)) - ifneq ($(PY_DEFS_MK_INCLUDED),true) all: clean: pyc.clean @@ -99,9 +85,6 @@ echo-py: @echo 'MYPYPATH = $(MYPYPATH)' @echo 'PY_INSTALL_MOD = $(PY_INSTALL_MOD)' @echo 'PY_INSTALL_SUB_MOD = $(PY_INSTALL_SUB_MOD)' - # not used anywhere' - #@echo 'PY_PROJ_MODULE_DIRS = $(PY_PROJ_MODULE_DIRS)' - #@echo 'PY_MODULE_DIRS = $(PY_MODULE_DIRS)' pyc.clean: $(RM) -rf $(wildcard *.pyc) __pycache__ diff --git a/make/py-path.mk b/make/py-path.mk index 39c72737..d6fee0cb 100644 --- a/make/py-path.mk +++ b/make/py-path.mk @@ -1,7 +1,7 @@ # -- PYTHONPATH PYTHONPATH_ENV := $(PYTHONPATH) -JW_PKG_PYTHON_PATH_PREREQ += $(PROJECT) ifeq ($(origin JW_PKG_PYTHON_PATH),undefined) JW_PKG_PYTHON_PATH := $(shell $(JW_PKG_PY) --topdir-format absolute projects pythonpath --delimiter ' ' $(PROJECT) $(PREREQ_RUN)) endif export PYTHONPATH := $(subst $(space),:,$(JW_PKG_PYTHON_PATH)) +export MYPYPATH := $(PYTHONPATH)