forked from coreos/issue-sync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (31 loc) · 805 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
34
35
36
37
38
39
40
41
42
43
export CGO_ENABLED:=0
PROJ=issue-sync
ORG_PATH=github.com/coreos
REPO_PATH=$(ORG_PATH)/$(PROJ)
VERSION=$(shell ./git-version)
BUILD_TIME=`date +%FT%T%z`
GOOS=$(shell go env GOOS)
GOARCH=$(shell go env GOARCH)
SOURCES := $(shell find . -name '*.go')
LD_FLAGS=-ldflags "-X $(REPO_PATH)/cmd.Version=$(VERSION)"
GOBIN_DEFAULT := $(GOPATH)/bin
export GOBIN ?= $(GOBIN_DEFAULT)
HAS_DEP := $(shell command -v dep;)
$(GOBIN):
echo "create gobin"
mkdir -p $(GOBIN)
work: $(GOBIN)
depend: work
ifndef HAS_DEP
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
endif
dep ensure
depend-update: work
dep ensure -update
build: bin/$(PROJ)
bin/$(PROJ): $(SOURCES)
@go build -o bin/$(PROJ) $(LD_FLAGS) $(REPO_PATH)
clean:
@rm bin/*
.PHONY: clean depend build
.DEFAULT_GOAL: build