mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 09:13:37 +02:00
projects.mk -> platform.mk: Move definitions up
To remove redundancy, get-os.sh needs to be retired in favor of pkg.py distro info. It's needed in platform.mk, but the only definiton of JW_PKG_PY is in projects.mk, so move it, along with the variables essential for the command: include $(JWBDIR)/make/py-version.mk (defining PYTHON) JW_PKG_PY DEVELOPMENT VERSION_FILE Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
6483de1a8f
commit
521600bc56
3 changed files with 28 additions and 27 deletions
|
|
@ -16,6 +16,9 @@ Q ?= @
|
||||||
|
|
||||||
include $(JWBDIR)/make/projects.mk
|
include $(JWBDIR)/make/projects.mk
|
||||||
|
|
||||||
|
ifndef WHICH
|
||||||
|
WHICH := $(firstword $(wildcard /usr/bin/which) $(shell which which))
|
||||||
|
endif
|
||||||
ifndef GREP
|
ifndef GREP
|
||||||
GREP := $(shell $(WHICH) grep)
|
GREP := $(shell $(WHICH) grep)
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,26 @@ $(eval $(call try_include,$(JWBDIR)/make/pre-local.mk))
|
||||||
$(eval $(call try_include,$(TOPDIR)/make/pre-local.mk))
|
$(eval $(call try_include,$(TOPDIR)/make/pre-local.mk))
|
||||||
$(eval $(call try_include,pre-local.mk))
|
$(eval $(call try_include,pre-local.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
|
||||||
|
|
||||||
ifeq ($(MAKE_BENCHMARK),true)
|
ifeq ($(MAKE_BENCHMARK),true)
|
||||||
export SHELL := /bin/bash $(JWB_SCRIPT_DIR)/timed-make-shell.sh
|
export SHELL := /bin/bash $(JWB_SCRIPT_DIR)/timed-make-shell.sh
|
||||||
else
|
else
|
||||||
|
|
@ -25,6 +45,11 @@ else
|
||||||
endif
|
endif
|
||||||
|
|
||||||
JWB_SCRIPT_DIR := $(firstword $(wildcard $(JWBDIR)/scripts $(JWBDIR)/bin))
|
JWB_SCRIPT_DIR := $(firstword $(wildcard $(JWBDIR)/scripts $(JWBDIR)/bin))
|
||||||
|
|
||||||
|
include $(JWBDIR)/make/py-version.mk
|
||||||
|
|
||||||
|
JW_PKG_PY = $(PYTHON) $(JWB_SCRIPT_DIR)/jw-pkg.py -p $(PROJECTS_DIR) -t $(TOPDIR) --topdir-format absolute $(JW_PKG_PY_EXTRA_OPTS)
|
||||||
|
|
||||||
ifndef GET_OS_SH
|
ifndef GET_OS_SH
|
||||||
GET_OS_SH := $(SHELL) $(JWB_SCRIPT_DIR)/get-os.sh
|
GET_OS_SH := $(SHELL) $(JWB_SCRIPT_DIR)/get-os.sh
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
|
|
@ -2,36 +2,9 @@
|
||||||
|
|
||||||
include $(JWBDIR)/make/platform.mk
|
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:
|
# -- 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),)
|
ifneq ($(TOPDIR),)
|
||||||
JW_PKG_PY = PYTHONPATH=$(JWBDIR)/src/python $(PYTHON) $(JWB_SCRIPT_DIR)/jw-pkg.py -p $(PROJECTS_DIR) -t $(TOPDIR) --topdir-format absolute $(JW_PKG_PY_EXTRA_OPTS)
|
|
||||||
proj_query_cmd = $(JW_PKG_PY) projects
|
proj_query_cmd = $(JW_PKG_PY) projects
|
||||||
proj_query = $(shell $(proj_query_cmd) $(1))
|
proj_query = $(shell $(proj_query_cmd) $(1))
|
||||||
proj_dir = $(call proj_query,proj-dir $(1))
|
proj_dir = $(call proj_query,proj-dir $(1))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue