-
Notifications
You must be signed in to change notification settings - Fork 129
/
GNUmakefile
51 lines (38 loc) · 1.38 KB
/
GNUmakefile
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
MAKE_MAJOR_VER := $(shell echo $(MAKE_VERSION) | cut -d'.' -f1)
ifneq ($(shell test $(MAKE_MAJOR_VER) -gt 3; echo $$?),0)
$(error Make version $(MAKE_VERSION) is not supported, please install GNU Make 4.x)
endif
AWK ?= $(shell command -v gawk 2> /dev/null || command -v awk 2> /dev/null)
Q = $(if $(filter 1,$V),,@)
M = $(shell printf "\033[34;1m▶\033[0m")
# Use docker based commitsar if it isn't in the path
ifeq ($(COMMITSAR),)
COMMITSAR = $(COMMITSAR_DOCKER)
endif
.PHONY: help
help:
@grep --no-filename -E '^[ a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
$(AWK) 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-28s\033[0m %s\n", $$1, $$2}' | sort
.PHONY: test
test: ## Run all tests
$Q $(CURDIR)/test.sh --type oss --unprivileged false --latest-njs false
# Check if the 'open' command exists on the system
OPEN := $(shell command -v open 2> /dev/null)
# Define the open command based on availability
ifeq ($(OPEN),)
OPEN_COMMAND = xdg-open
else
OPEN_COMMAND = open
endif
docs_destination_directory = "reference"
.PHONY: docs
docs:
npx jsdoc -c $(CURDIR)/jsdoc/conf.json -d $(CURDIR)/$(docs_destination_directory) || true
.PHONY: jsdoc
jsdoc: docs ## Build JSDoc output
.PHONY: jsdoc-open
jsdoc-open: docs
$(OPEN_COMMAND) $(CURDIR)/$(docs_destination_directory)/index.html
.PHONY: clean
clean: ## Clean up build artifacts
$Q rm -rf $(CURDIR)/$(docs_destination_directory)