-
Notifications
You must be signed in to change notification settings - Fork 35
/
Makefile
60 lines (50 loc) · 1.32 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
DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
INFOLOG := \033[34m ▸\033[0m
WARNLOG := \033[33m ▸\033[0m
ERROLOG := \033[31m ⨯\033[0m
TEST:="./..."
test: embed
@echo "$(INFOLOG) Running go tests..."
@go test -timeout=10m $(TEST)
.PHONY: tests
# Install the commands.
install:
@echo "$(INFOLOG) Installing Joy to the path..."
@go install ./cmd/...
.PHONY: install
embed:
@go-bindata -o ./internal/bindata/bindata.go -nometadata -pkg bindata ./internal/runtime ./macro/* ./stdlib/**/*
@gofmt -w ./internal/bindata/
.PHONY: embed
dom:
@echo "$(INFOLOG) Generating the DOM..."
@go run internal/dom/main.go
.PHONY: dom
vdom:
@echo "$(INFOLOG) Generating the virtual DOM..."
@go run internal/vdom/main.go
.PHONY: vdom
# Release binaries to GitHub.
release: embed
@read -p "> What's the new version? (e.g. 0.1.0) " version; \
echo "$(INFOLOG) Releasing... v$$version"; \
git tag v$$version; \
goreleaser -p 1 --rm-dist --config .goreleaser.yml;
.PHONY: release
# Show source statistics.
cloc:
@cloc -exclude-dir=vendor,node_modules,dom,vdom,chrome .
.PHONY: cloc
# Show to-do items per file.
todo:
@grep \
--exclude-dir=vendor \
--exclude-dir=node_modules \
--exclude-dir=chrome \
--exclude-dir=vdom \
--exclude-dir=dom \
--exclude=Makefile \
--text \
--color \
-nRo -E ' TODO:.*|SkipNow' .
.PHONY: todo