blob: 931b83bc54501ace19cdf001bb09d5d452443b36 [file] [log] [blame]
Pawel Wieczorekcc752912019-05-26 11:40:36 +02001PROJECT = check
2BIN_DIR = bin
Pawel Wieczorekab8186e2019-08-07 13:38:38 +02003SRC_DIR = src
4PKG_DIR = pkg
Pawel Wieczorekcc752912019-05-26 11:40:36 +02005BIN = check
6
7all: run
8
9run: build
10 $(BIN_DIR)/$(BIN)
11
12build: $(BIN)
13
14$(BIN): export GOPATH = $(shell pwd)
Pawel Wieczorekab8186e2019-08-07 13:38:38 +020015$(BIN): deps
Pawel Wieczorekcc752912019-05-26 11:40:36 +020016 go install $(PROJECT)/cmd/$(BIN)
17
Pawel Wieczorekab8186e2019-08-07 13:38:38 +020018deps: export GOPATH = $(shell pwd)
19deps:
20 go get $(PROJECT)/...
21
22clean_deps: export GOPATH = $(shell pwd)
23clean_deps:
24 go clean -i -r $(PROJECT)/... 2>/dev/null || true
25
Pawel Wieczorek056ef4c2019-07-08 14:17:55 +020026test: export GOPATH = $(shell pwd)
Pawel Wieczorek2b2b7992019-08-07 13:52:49 +020027test: test_deps
Pawel Wieczorek056ef4c2019-07-08 14:17:55 +020028 go test $(PROJECT)/...
29
Pawel Wieczorek2b2b7992019-08-07 13:52:49 +020030test_watch: export GOPATH = $(shell pwd)
31test_watch: test_deps
32 $(BIN_DIR)/ginkgo watch $(SRC_DIR)/$(PROJECT)/...
33
34test_deps: export GOPATH = $(shell pwd)
35test_deps:
36 go get github.com/onsi/ginkgo/ginkgo
37 go get -t $(PROJECT)/...
38
39clean_test_deps: export GOPATH = $(shell pwd)
40clean_test_deps:
41 go clean -i -r github.com/onsi/ginkgo/ginkgo 2>/dev/null || true
42
43clean: clean_deps clean_test_deps
Pawel Wieczorek660f4962019-07-08 14:24:19 +020044 -rmdir $(BIN_DIR)
Pawel Wieczorekab8186e2019-08-07 13:38:38 +020045 rm -rf $(PKG_DIR)
46 find $(SRC_DIR) -mindepth 1 -maxdepth 1 ! -name $(PROJECT) -exec rm -rf {} +
Pawel Wieczorekcc752912019-05-26 11:40:36 +020047
Pawel Wieczorek2b2b7992019-08-07 13:52:49 +020048.PHONY: all run build deps clean_deps test test_watch test_deps clean_test_deps clean $(BIN)