-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (35 loc) · 860 Bytes
/
Makefile
File metadata and controls
47 lines (35 loc) · 860 Bytes
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
NM := node_modules/.bin
SRCS := $(shell find src -name '*.js')
DISTS := $(patsubst src/%,dist/%,$(SRCS))
DISTDIRS := $(sort $(dir $(DISTS)))
DEPS := $(DISTS) node_modules
# these are not files
.PHONY: dev build clean debug test
# disable default suffixes
.SUFFIXES:
build: $(DEPS)
dist/%.js: src/%.js node_modules .babelrc | $(DISTDIRS)
$(NM)/babel $< -o $@
$(DISTDIRS):
mkdir -p $@
ifneq ("$(wildcard yarn.lock)","")
node_modules: yarn.lock
@yarn install --production=false
touch node_modules
yarn.lock: package.json
touch yarn.lock
else # yarn.lock does not exist
node_modules: yarn.lock
touch node_modules
yarn.lock: package.json
@yarn install --production=false
endif
debug:
$(info SRCS: $(SRCS))
$(info DISTS: $(DISTS))
$(info DISTDIRS: $(DISTDIRS))
publish:
npm version patch
npm publish
clean:
rm -rf node_modules dist yarn.lock