-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
75 lines (61 loc) · 1.42 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
GOPATH=$(shell go env GOPATH)
GOBIN=$(GOPATH)/bin
GOCMD=go
export PATH:=$(GOBIN):$(PATH)
# We don't need make's built-in rules.
MAKEFLAGS += --no-builtin-rules
.SUFFIXES:
.PHONY: help
help:
@echo "make targets"
@echo
@echo " deps"
@echo " goagen"
@echo " check check all the things"
@echo " help this help message"
.PHONY: deps
deps: tools
@echo "Downloading modules..."
go mod download
.PHONY: goagen
goagen:
@goagen app -d github.com/artefactual-labs/amflow/design -o internal/api
@goagen js -d github.com/artefactual-labs/amflow/design -o web/ --noexample
@mv web/js/client.js web/client.amd.js
@rm -rf web/js
@cd web && npm run amdtoes6
.PHONY: clean
clean:
git clean -f -d -x
.PHONY: build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GOFLAGS=-ldflags=-w \
go build \
-o dist/amflow \
-ldflags="-s -X github.com/artefactual-labs/amflow/internal/version.version=try" \
github.com/artefactual-labs/amflow
.PHONY: frontend
frontend:
yarn --cwd web install
yarn --cwd web build
.PHONY: build
try: build
dist/amflow version
.PHONY: test
test:
go test ./...
.PHONY: testrace
testrace:
go test -race ./...
.PHONY: vet
vet:
go vet ./...
.PHONY: fmt
fmt:
@echo "gofmt -s -l -d -e ."
@test -z "$(shell gofmt -s -l -d -e . | tee /dev/stderr)"
.PHONY: staticcheck
staticcheck:
staticcheck -checks all,-ST1000,-ST1001 ./...
.PHONY: check
check: test testrace vet fmt staticcheck