-
Notifications
You must be signed in to change notification settings - Fork 4
/
makefile
79 lines (55 loc) · 1.87 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
# Defining shell is necessary in order to modify PATH
SHELL := sh
export PATH := node_modules/.bin/:$(PATH)
export NODE_OPTIONS := --trace-deprecation
# On CI servers, use the `npm ci` installer to avoid introducing changes to the package-lock.json
# On developer machines, prefer the generally more flexible `npm install`. 💪
NPM_I := $(if $(CI), ci, install)
# User-overridable
TSC_FLAGS :=
ESLINT_FLAGS :=
NPM_FLAGS :=
GITFILES := $(patsubst utils/githooks/%, .git/hooks/%, $(wildcard utils/githooks/*))
SRCFILES := $(shell find src -type f -name "*.ts")
SRCTHEME := $(wildcard src/themes/*)
DSTTHEME := $(patsubst src/themes/%, themes/%-color-theme.json, $(SRCTHEME))
# Do this when make is invoked without targets
all: compile themes $(GITFILES)
# GENERIC TARGETS
.buildstate:
mkdir .buildstate
.buildstate/tsconfig.tsbuildinfo: node_modules tsconfig.json $(SRCFILES) .buildstate
tsc $(TSC_FLAGS) && touch $@
node_modules: package.json
npm $(NPM_I) $(NPM_FLAGS) && touch $@
# Default target for all possible git hooks
.git/hooks/%: utils/githooks/%
cp $< $@
themes/%-color-theme.json: src/themes/% .buildstate/tsconfig.tsbuildinfo $(SRCFILES)
@mkdir -p themes
node src/bin/generate $< $@
%.vsix: $(DSTTHEME)
vsce package --out $@
# TASK DEFINITIONS
extension: remedy.vsix
themes: $(DSTTHEME) .buildstate/tsconfig.tsbuildinfo
node src/bin/refresh-package $(SRCTHEME)
compile: .buildstate/tsconfig.tsbuildinfo
watch/compile: force install
tsc $(TSC_FLAGS) --watch
install: node_modules $(GITFILES)
lint: force install
eslint --cache $(ESLINT_FLAGS) .
remark --quiet .
clean:
rm -rf {.nyc_output,coverage,docs,.eslintcache} *.vsix
find . -not -path '*/node_modules/*' -name '*.log' -print -delete
distclean: clean
git clean -Xf src
rm -rf themes .buildstate
pristine: distclean
rm -rf node_modules
release: force
@utils/make/release.sh
.PHONY: force
-include local.mk