2016-12-25 13:45:12 +00:00
|
|
|
# == Variables for inter-project-communication
|
|
|
|
|
|
2019-06-29 21:34:18 +00:00
|
|
|
include $(JWBDIR)/make/platform.mk
|
2019-03-02 19:59:53 +00:00
|
|
|
|
2016-12-25 13:45:12 +00:00
|
|
|
# -- What do I know about myself?
|
2019-03-03 18:12:28 +00:00
|
|
|
VERSION_FILE := $(firstword $(wildcard VERSION) $(TOPDIR)/VERSION)
|
2019-02-27 20:46:54 +00:00
|
|
|
ifndef DEVELOPMENT
|
|
|
|
|
ifeq ($(wildcard $(VERSION_FILE)),)
|
2019-03-03 18:12:28 +00:00
|
|
|
DEVELOPMENT := true
|
2019-02-27 20:46:54 +00:00
|
|
|
else
|
2019-03-03 18:12:28 +00:00
|
|
|
DEVELOPMENT := $(shell grep -q 'dev' $(VERSION_FILE) && echo true)
|
2019-02-27 20:46:54 +00:00
|
|
|
endif
|
2018-12-27 17:03:53 +00:00
|
|
|
endif
|
2016-12-25 13:45:12 +00:00
|
|
|
|
|
|
|
|
# -- Conclude the build system's location:
|
2019-06-24 12:44:14 +00:00
|
|
|
ifeq ($(PROJECTS_DIR),)
|
|
|
|
|
ifeq ($(DEVELOPMENT),true)
|
|
|
|
|
PROJECTS_DIR ?= $(TOPDIR)/..
|
|
|
|
|
else
|
|
|
|
|
PROJECTS_DIR ?= /opt
|
|
|
|
|
endif
|
2016-12-25 13:45:12 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
# -- Query the build system about other projects:
|
2019-06-24 12:44:14 +00:00
|
|
|
|
|
|
|
|
ifndef WHICH
|
|
|
|
|
WHICH := $(firstword $(wildcard /usr/bin/which) $(shell which which))
|
|
|
|
|
endif
|
|
|
|
|
|
2020-05-16 13:22:51 +00:00
|
|
|
ifneq ($(PYTHON_VERSION),)
|
|
|
|
|
PYTHON := /usr/bin/python$(PYTHON_VERSION)
|
2019-06-24 12:44:14 +00:00
|
|
|
else
|
2020-05-16 13:22:51 +00:00
|
|
|
ifeq ($(PYTHON),)
|
2020-05-18 13:15:35 +00:00
|
|
|
PYTHON := $(lastword $(shell ls -v /usr/bin/python[0-9].[0-9]))
|
2020-05-16 13:22:51 +00:00
|
|
|
endif
|
|
|
|
|
PYTHON_VERSION ?= $(patsubst python%,%,$(notdir $(PYTHON)))
|
2019-06-24 12:44:14 +00:00
|
|
|
endif
|
2020-05-16 13:22:51 +00:00
|
|
|
PYTHON_MAJOR = $(basename $(PYTHON_VERSION))
|
2019-06-24 12:44:14 +00:00
|
|
|
|
2019-02-14 09:00:41 +00:00
|
|
|
ifneq ($(TOPDIR),)
|
2019-06-29 21:45:24 +00:00
|
|
|
proj_query_cmd = $(PYTHON) $(JWB_SCRIPT_DIR)/projects.py -p $(PROJECTS_DIR) -t $(TOPDIR) $(PROJECTS_PY_EXTRA_ARGS)
|
2019-03-03 18:12:28 +00:00
|
|
|
proj_query = $(shell $(proj_query_cmd) $(1))
|
|
|
|
|
proj_dir = $(call proj_query,proj-dir $(1))
|
|
|
|
|
htdocs_dir = $(call proj_query,htdocs-dir $(1))
|
2019-02-14 09:00:41 +00:00
|
|
|
endif
|