mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 20:13:32 +01:00
For a project to supply templates, it needs to advertise their location. For this, the tmpl_dir make variable is added to projects.mk. If other-project wants to get hold of some-project's templates, it can do, e.g.: TEMPLATES = $(wilcard $(call tmpl_dir,some-project)/*.tmpl) To achieve this, support for the tmpls-dir command is added to jw-projects.py. Signed-off-by: Jan Lindemann <jan@janware.com>
38 lines
1.2 KiB
Makefile
38 lines
1.2 KiB
Makefile
# == Variables for inter-project-communication
|
|
|
|
include $(JWBDIR)/make/platform.mk
|
|
|
|
# -- What do I know about myself?
|
|
VERSION_FILE := $(firstword $(wildcard VERSION) $(TOPDIR)/VERSION)
|
|
ifndef DEVELOPMENT
|
|
ifeq ($(wildcard $(VERSION_FILE)),)
|
|
DEVELOPMENT := true
|
|
else
|
|
DEVELOPMENT := $(shell grep -q 'dev' $(VERSION_FILE) && echo true)
|
|
endif
|
|
endif
|
|
|
|
# -- Conclude the build system's location:
|
|
ifeq ($(PROJECTS_DIR),)
|
|
ifeq ($(DEVELOPMENT),true)
|
|
PROJECTS_DIR ?= $(TOPDIR)/..
|
|
else
|
|
PROJECTS_DIR ?= /opt
|
|
endif
|
|
endif
|
|
|
|
# -- Query the build system about other projects:
|
|
|
|
ifndef WHICH
|
|
WHICH := $(firstword $(wildcard /usr/bin/which) $(shell which which))
|
|
endif
|
|
|
|
include $(JWBDIR)/make/py-version.mk
|
|
|
|
ifneq ($(TOPDIR),)
|
|
proj_query_cmd = PYTHONPATH=$(JWBDIR)/src/python $(PYTHON) $(JWB_SCRIPT_DIR)/jw-projects.py -p $(PROJECTS_DIR) -t $(TOPDIR) $(PROJECTS_PY_EXTRA_ARGS)
|
|
proj_query = $(shell $(proj_query_cmd) $(1))
|
|
proj_dir = $(call proj_query,proj-dir $(1))
|
|
htdocs_dir = $(call proj_query,htdocs-dir $(1))
|
|
tmpl_dir = $(call proj_query,tmpl-dir $(1))
|
|
endif
|