-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
37 lines (30 loc) · 1.15 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
.DEFAULT_GOAL := help
TEST_PACKAGE = ./...
PWD = $(shell pwd)
COMMIT_HASH = $(shell git rev-parse --short HEAD)
.PHONY: help
help: ## print help (this message)
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| sed -n 's/^\(.*\): \(.*\)## \(.*\)/\1;\3/p' \
| column -t -s ';'
.PHONY: build
build: ## build binary
@echo "--------- running: $@ ---------"
CGO_ENABLED=1 GODEBUG=cgocheck=0 go build -o=gorender -pgo=default.pgo
.PHONY: build_noasm
build_noasm: ## build without assembly
@echo "--------- running: $@ ---------"
CGO_ENABLED=1 GODEBUG=cgocheck=0 go build -o=gorender -tags=purego -pgo=default.pgo
.PHONY: build
build_debug: ## build with additional checks
@echo "--------- running: $@ ---------"
GOARCH=amd64 CGO_ENABLED=1 GODEBUG=cgocheck=0 go build -o=gorender -pgo=default.pgo -gcflags="-m -d=ssa/check_bce" 2>&1 | tee build.log
go-escape-lint -f build.log
PHONY: test
test: ## run tests
@echo "--------- running: $@ ---------"
@go test -v $(TEST_PACKAGE)
.PHONY: bench
bench: ## run benchmarks
@echo "--------- running: $@ ---------"
@GOGC=off GODEBUG=asyncpreemptoff=1 go test -bench=. -cpuprofile bench_cpuprof.pprof $(TEST_PACKAGE)