forked from giantswarm/kemp-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
33 lines (21 loc) · 715 Bytes
/
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
PROJECT=kemp-client
BUILD_PATH := $(shell pwd)/.gobuild
VERSION := $(shell cat VERSION)
COMMIT := $(shell git rev-parse --short HEAD)
.PHONY=all get-deps build clean
PROJECT_PATH := "$(BUILD_PATH)/src/github.com/giantswarm"
GOPATH := $(BUILD_PATH)
SOURCE=$(shell find . -name '*.go')
BIN := $(PROJECT)
all: .gobuild get-deps $(BIN)
get-deps: .gobuild
GOPATH=$(GOPATH) go get -d -v github.com/giantswarm/$(PROJECT)
.gobuild:
mkdir -p $(PROJECT_PATH)
cd "$(PROJECT_PATH)" && ln -s ../../../.. $(PROJECT)
$(BIN): $(SOURCE) VERSION
GOPATH=$(GOPATH) go build -a -ldflags "-X main.projectVersion $(VERSION) -X main.projectBuild $(COMMIT)" -o $(BIN)
clean:
rm -rf $(BUILD_PATH) $(BIN)
fmt:
gofmt -w -l .