jw-pkg/make/projects.mk
Jan Lindemann cb1e735f9c make: Add projects.mk and prefixed win32 objects with win32-
- Add new makefile projects.mk, which is the place to define the minimally
  required set of variables to get a project's makefile oriented about
  the build machinery itself, mostly its locations in the file system. This
  also includes querying other projects. It's been pushed into a seperate
  makefile includeable early in the Makefile hierarchy, so that other
  special build variables (i.e. TARGET) can be specialized from within the
  project later to define build characteristics.
- Prefixed object files with $(FLAVOUR_PREFIX), to allow for building two
  targets from the same directory

Signed-off-by: Jan Lindemann <jan@janware.com>
2016-12-25 13:45:12 +00:00

21 lines
864 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)/devutil/scripts $(MODDIR)/bin))
# -- Query the build system about other projects:
PYTHON ?= /usr/bin/python
proj_query = $(shell $(PYTHON) $(MOD_SCRIPT_DIR)/projects.py -p $(PROJECTS_DIR) -t $(TOPDIR) $(PROJECTS_PY_EXTRA_ARGS) $(1))
proj_dir = $(call proj_query,proj-dir $(1))
htdocs_dir = $(call proj_query,htdocs-dir $(1))