-
Notifications
You must be signed in to change notification settings - Fork 32
/
Makefile
103 lines (74 loc) · 1.92 KB
/
Makefile
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
## TEST
TESTER = ./node_modules/.bin/mocha
OPTS = --ignore-leaks -t 15000
TESTS = test/*.test.js
test:
$(TESTER) $(OPTS) $(TESTS)
test-verbose:
$(TESTER) $(OPTS) --reporter spec $(TESTS)
testing:
$(TESTER) $(OPTS) --watch $(TESTS)
test-all: test
$(MAKE) -C hatch_modules/core-widgets
## WORKFLOW
GITBRANCH = $(shell git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
REPO = inventures/hatchjs
FROM = $(GITBRANCH)
TO = $(GITBRANCH)
install:
node install
pull:
git pull origin $(FROM)
safe-pull:
git pull origin $(FROM) --no-commit
push: test
git push origin $(TO)
feature:
git checkout -b feature-$(filter-out $@,$(MAKECMDGOALS))
%:
@:
deps: package.json
npm install > deps
gst-clean:
ifeq ($(findstring nothing to commit,$(shell git status 2>&1)),)
$(error Working copy contains uncommitted changes)
else
endif
update:
ifeq ($(findstring Already up-to-date,$(shell git pull origin $(FROM) 2>&1)),)
$(deps)
else
$(error Local copy is up to date)
endif
safe-update: gst-clean
ifeq ($(findstring Already up-to-date,$(shell git pull origin $(FROM) 2>&1)),)
$(deps)
$(test)
$(shell git commit -m "Merge branch '$(FROM)' of $(REPO)")
else
$(error Local copy is up to date)
endif
pr: push
open "https://github.com/$(REPO)/pull/new/inventures:master...$(GITBRANCH)"
# MAN DOCS
man/%.1: doc/cli/%.md scripts/doc.sh
@[ -d man ] || mkdir man
scripts/doc.sh $< $@
man/%.3: doc/api/%.md scripts/doc.sh
@[ -d man ] || mkdir man
scripts/doc.sh $< $@
man/html/%.3.html: doc/api/%.md scripts/doc.sh doc/footer.html
@[ -d man/html ] || mkdir -p man/html
scripts/doc.sh $< $@
man/html/%.1.html: doc/cli/%.md scripts/doc.sh
@[ -d man/html ] || mkdir -p man/html
scripts/doc.sh $< $@
man/html/changelog.3.html: CHANGELOG.md scripts/doc.sh
scripts/doc.sh $< $@
MAN = $(API_MAN) $(CLI_MAN)
HTML: $(API_WEB) $(CLI_WEB)
web: $(HTML)
man: $(MAN)
all: $(MAN) $(HTML)
build: man
.PHONY: test doc