jw-pkg/make/projects.mk
Jan Lindemann 0a04f98785 projects.mk: Disable proj_query macros for undefined $TOPDIR
proj_query based commands run projects.py, which needs $(TOPDIR), which in turn
is undefined, notably for standalone-exe.mk. This commit avoids related
warnings.

Signed-off-by: Jan Lindemann <jan@janware.com>
2019-02-14 09:00:41 +00:00

27 lines
997 B
Makefile

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