jw-pkg/make/projects.mk
Jan Lindemann c5be183a73 projects.mk: Add variable proj_query_cmd
proj_query_command is not a callable function, as opposed to proj_query, which
now uses it. This adds the possibilty to use it multiple times in pipes.

Signed-off-by: Jan Lindemann <jan@janware.com>
2017-07-22 18:14:58 +00:00

22 lines
899 B
Makefile

# == Variables for inter-project-communication
# -- What do I know about myself?
VERSION_FILE ?= $(firstword $(wildcard VERSION $(TOPDIR)/VERSION))
DEVELOPMENT ?= $(shell grep -q 'dev' $(VERSION_FILE) && echo true)
# -- Conclude the build system's location:
CVS_PROJ_DIR ?= $(TOPDIR)/..
ifeq ($(DEVELOPMENT),true)
PROJECTS_DIR ?= $(CVS_PROJ_DIR)
else
PROJECTS_DIR ?= /opt
endif
MOD_SCRIPT_DIR ?= $(firstword $(wildcard $(MODDIR)/scripts $(MODDIR)/bin))
# -- Query the build system about other projects:
PYTHON ?= /usr/bin/python
proj_query_cmd = $(PYTHON) $(MOD_SCRIPT_DIR)/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))