blob: e7f978fc259b4841714149d811ed366a5e9ffe77 [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)
27test:
28 go test $(PROJECT)/...
29
Pawel Wieczorekab8186e2019-08-07 13:38:38 +020030clean: clean_deps
Pawel Wieczorek660f4962019-07-08 14:24:19 +020031 -rmdir $(BIN_DIR)
Pawel Wieczorekab8186e2019-08-07 13:38:38 +020032 rm -rf $(PKG_DIR)
33 find $(SRC_DIR) -mindepth 1 -maxdepth 1 ! -name $(PROJECT) -exec rm -rf {} +
Pawel Wieczorekcc752912019-05-26 11:40:36 +020034
Pawel Wieczorekab8186e2019-08-07 13:38:38 +020035.PHONY: all run build deps clean_deps test clean $(BIN)