-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmakefile
47 lines (45 loc) · 1.1 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
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GODOG=godog
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_NAME=clarity
BINARY_DIR=build
BINARY_WIN=$(BINARY_NAME).exe
BINARY_UNIX=$(BINARY_NAME)_unix
BINARY_DARWIN=$(BINARY_NAME)_osx
all: test build
build: build-darwin build-win build-linux
test: gen unit
unit:
$(GOTEST) ./pkg/... -v
integration:
$(GOTEST) ./test/integration/... -v
e2e:
$(GOTEST) ./test/e2e/... -v
clean:
$(GOCLEAN)
find . -name "*.test" | xargs rm
rm -fr $(BINARY_DIR)
gen:
go generate ./...
dep:
go get -u github.com/golang/dep/cmd/dep
dep ensure
build-darwin:
cd ./cmd/clarity && \
mkdir -p $(BINARY_DIR) && \
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 $(GODOG) -output $(BINARY_DIR)/$(BINARY_DARWIN)
build-win:
cd ./cmd/clarity && \
mkdir -p $(BINARY_DIR) && \
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 $(GODOG) -output $(BINARY_DIR)/$(BINARY_WIN)
build-linux:
cd ./cmd/clarity && \
mkdir -p $(BINARY_DIR) && \
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GODOG) -output $(BINARY_DIR)/$(BINARY_UNIX)
release:
./bin/create_new_release.sh
.PHONY: all test clean build