-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (23 loc) · 1.01 KB
/
Copy pathMakefile
File metadata and controls
29 lines (23 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Resolve repository root (Makefile can live anywhere)
REPO_ROOT := $(shell git rev-parse --show-toplevel 2>/dev/null || pwd)
MK_COMMON_REPO ?= leinardi/make-common
MK_COMMON_VERSION ?= v1
MK_COMMON_DIR := $(REPO_ROOT)/.mk
MK_COMMON_FILES := help.mk pre-commit.mk password.mk
MK_COMMON_BOOTSTRAP_SCRIPT := $(REPO_ROOT)/scripts/bootstrap-mk-common.sh
# Bootstrap: the script will self-update and fetch the selected .mk snippets
MK_COMMON_BOOTSTRAP := $(shell "$(MK_COMMON_BOOTSTRAP_SCRIPT)" \
"$(MK_COMMON_REPO)" \
"$(MK_COMMON_VERSION)" \
"$(MK_COMMON_DIR)" \
"$(MK_COMMON_FILES)")
# Include shared make logic
include $(addprefix $(MK_COMMON_DIR)/,$(MK_COMMON_FILES))
.PHONY: mk-common-update
mk-common-update: ## Check for remote updates of shared .mk files
@echo "[mk] Checking for updates from $(MK_COMMON_REPO)@$(MK_COMMON_VERSION)"
MK_COMMON_UPDATE=1 "$(MK_COMMON_BOOTSTRAP_SCRIPT)" \
"$(MK_COMMON_REPO)" \
"$(MK_COMMON_VERSION)" \
"$(MK_COMMON_DIR)" \
"$(MK_COMMON_FILES)"