common.mk: Add file #123
8 changed files with 26 additions and 23 deletions
15
make/common.mk
Normal file
15
make/common.mk
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# Common fragment for all jw-pkg-aware Makefiles. Its contents is pulled in
|
||||
# - from every directory of every project
|
||||
# - from the projects directory (i.e. the directory containing projects)
|
||||
|
||||
ifndef COMMON_MK_INCLUDED
|
||||
COMMON_MK_INCLUDED = true
|
||||
|
||||
Q ?= @
|
||||
INTERACTIVE ?= auto
|
||||
BROWSER ?= xdg-open
|
||||
JWB_SCRIPT_DIR ?= $(firstword $(wildcard $(JWBDIR)/scripts $(JWBDIR)/bin) jwb-script-dir-not-found)
|
||||
|
||||
LIST_VCS_FILES = /bin/bash $(JWB_SCRIPT_DIR)/scm.sh ls-files
|
||||
|
||||
endif
|
||||
|
|
@ -10,12 +10,12 @@ MAKEFLAGS += -r
|
|||
empty :=
|
||||
space := $(empty) $(empty)
|
||||
comma := ,
|
||||
Q ?= @
|
||||
|
||||
include $(JWBDIR)/make/common.mk
|
||||
include $(JWBDIR)/make/projects.mk
|
||||
|
||||
# ----- Executables
|
||||
|
||||
include $(JWBDIR)/make/projects.mk
|
||||
|
||||
ifndef WHICH
|
||||
WHICH := $(firstword $(wildcard /usr/bin/which) $(shell which which))
|
||||
endif
|
||||
|
|
@ -34,9 +34,6 @@ endif
|
|||
ifndef CAT
|
||||
CAT := $(shell $(WHICH) cat)
|
||||
endif
|
||||
ifndef BROWSER
|
||||
BROWSER := $(shell $(WHICH) xdg-open)
|
||||
endif
|
||||
ifeq ($(origin RM),default)
|
||||
RM := $(shell $(WHICH) rm)
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
LIST_VCS_FILES := /bin/bash $(JWB_SCRIPT_DIR)/scm.sh ls-files
|
||||
|
||||
ifndef LIST_FILES_MK_INCLUDED
|
||||
LIST_FILES_MK_INCLUDED := true
|
||||
|
||||
|
|
|
|||
|
|
@ -63,8 +63,6 @@ else
|
|||
export SHELL := /bin/bash
|
||||
endif
|
||||
|
||||
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) $(JW_PKG_PY_EXTRA_OPTS)
|
||||
|
|
|
|||
|
|
@ -3,3 +3,4 @@
|
|||
# projects-dir-minimal.mk / projects-dir.mk for details)
|
||||
|
||||
PGIT_SH = /bin/bash $(JWB_SCRIPT_DIR)/pgit.sh
|
||||
PKG_MANAGER ?= $(TIME) $(JW_PKG_PY) --interactive=$(INTERACTIVE) pkg
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ PROJECTS_MAKEFILE_NAME := $(firstword $(MAKEFILE_LIST))
|
|||
-include local.mk
|
||||
|
||||
JWBDIR ?= jw-pkg
|
||||
# The bootstrap recipes below run before jw-pkg's common.mk is
|
||||
# parsed, so Q must be defined here; a no-op in the steady state.
|
||||
Q ?= @
|
||||
|
||||
ifeq ($(origin PROJECTS_DIR_REMOTE_BASE),undefined)
|
||||
|
|
|
|||
|
|
@ -25,8 +25,9 @@ JWBDIR_NAME ?= jw-pkg
|
|||
JWBDIR_SEARCH_PATH ?= $(DEV_PROJECTS_DIR) $(BUILD_TOOLS_PREFIX)/opt/$(FLAVOUR_PATH_PREFIX)
|
||||
JWBDIR ?= $(firstword $(wildcard $(addsuffix /$(JWBDIR_NAME),$(JWBDIR_SEARCH_PATH))))
|
||||
|
||||
include $(JWBDIR)/make/common.mk
|
||||
|
||||
JW_PKG_BINDIR = $(JWBDIR)/bin
|
||||
JWB_SCRIPT_DIR = $(firstword $(wildcard $(JWBDIR)/scripts $(JW_PKG_BINDIR)) jwb-script-dir-not-found)
|
||||
JW_PKG_REMOTE_BINDIR = /opt/jw-pkg/bin
|
||||
|
||||
SHELL = /bin/bash -o pipefail +H
|
||||
|
|
@ -110,12 +111,8 @@ ifneq ($(EXCLUDE_FROM_BUILD),)
|
|||
JW_PKG_PY_EXTRA_BUILD_OPTS += --exclude "$(EXCLUDE_FROM_BUILD)"
|
||||
endif
|
||||
|
||||
# non-interactive mode
|
||||
INTERACTIVE ?= auto
|
||||
|
||||
# ------------ external programs II
|
||||
|
||||
BROWSER ?= xdg-open
|
||||
EDITOR ?= xdg-open
|
||||
ifeq ($(TIME),)
|
||||
TIME := $(shell which time)
|
||||
|
|
@ -123,11 +120,9 @@ ifeq ($(TIME),)
|
|||
TIME += -p
|
||||
endif
|
||||
endif
|
||||
JW_PKG_PY_PROJECTS = $(JW_PKG_PY) projects
|
||||
PKG_RELATIONS_BUILD ?= requires,recommends
|
||||
JW_PKG_PY_BUILD = $(JW_PKG_PY_PROJECTS) build --pkg-relations "$(PKG_RELATIONS_BUILD)" $(JW_PKG_PY_EXTRA_BUILD_OPTS)
|
||||
JW_PKG_PY_REQUIRED_OS_PKG = $(JW_PKG_PY_PROJECTS) required-os-pkg --quote --skip-excluded --pkg-relations "$(PKG_RELATIONS_BUILD)"
|
||||
PKG_MANAGER ?= $(TIME) $(JW_PKG_PY) --interactive=$(INTERACTIVE) pkg
|
||||
JW_PKG_PY_REQUIRED_OS_PKG = $(JW_PKG_PY) projects required-os-pkg --quote --skip-excluded --pkg-relations "$(PKG_RELATIONS_BUILD)"
|
||||
JW_PKG_PY_BUILD = $(JW_PKG_PY) projects build --pkg-relations "$(PKG_RELATIONS_BUILD)" $(JW_PKG_PY_EXTRA_BUILD_OPTS)
|
||||
|
||||
ifneq ($(origin PROJECTS_DIR_REMOTE_BASE),undefined)
|
||||
PGIT_SH += --remote-base $(PROJECTS_DIR_REMOTE_BASE)
|
||||
|
|
@ -147,7 +142,6 @@ endif
|
|||
|
||||
PURGE_SH = /bin/bash $(firstword $(wildcard $(JWB_SCRIPT_DIR)/purge-stale-projects.sh $(JW_PKG_BINDIR)/purge-stale-projects.sh) purge-not-found)
|
||||
CREATE_PROJECT_SH ?= /bin/bash $(firstword $(wildcard $(JWB_SCRIPT_DIR)/jw-pkg-create-project.sh $(JW_PKG_BINDIR)/jw-pkg-create-project.sh) jw-pkg-create-project-not-found)
|
||||
LIST_VCS_FILES_SH = /bin/bash $(firstword $(wildcard $(JWB_SCRIPT_DIR)/scm.sh $(JW_PKG_BINDIR)/scm.sh) scm-sh-not-found) ls-files
|
||||
GIT_SRV_ADMIN_SH = $(GIT_SSH) $(JANWARE_USER)@devgit.janware.com $(JW_PKG_REMOTE_BINDIR)/git-srv-admin.sh
|
||||
JANWARE_PACKAGE_FILTER = url =~ janware
|
||||
|
||||
|
|
@ -227,7 +221,7 @@ clean.text-files-cache:
|
|||
rm -f $(TEXT_FILES_CACHE)
|
||||
list-files:
|
||||
$(Q)for p in $(DEP_PROJECTS); do \
|
||||
$(LIST_VCS_FILES_SH) -znf $$p | sed -z "s/^/$$p\//" | \
|
||||
$(LIST_VCS_FILES) -znf $$p | sed -z "s/^/$$p\//" | \
|
||||
xargs -0 realpath -q ;\
|
||||
done
|
||||
$(TEXT_FILES_CACHE):
|
||||
|
|
|
|||
|
|
@ -61,8 +61,6 @@ GIT_DESCR = $(TOPDIR)/.git/description
|
|||
GIT_MAIN_BRANCH ?= master
|
||||
|
||||
OPT_JANWARE_PROJECT ?= -j
|
||||
INTERACTIVE ?= auto
|
||||
PKG_MANAGER ?= $(JW_PKG_PY) --interactive=$(INTERACTIVE) pkg
|
||||
|
||||
ifeq ($(OPT_JANWARE_PROJECT),-j)
|
||||
REMOTE_GIT_FLAVOUR ?= proj
|
||||
|
|
|
|||
Loading…
Reference in a new issue