-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile-old
61 lines (41 loc) · 910 Bytes
/
Makefile-old
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
GOFLAGS ?= $(GOFLAGS:)
TAG := $(VERSION)
ifeq ($(TAG),)
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
DT := $(shell date '+%F_%H%M')
VSN := $(BRANCH)-$(DT)
else
VSN := $(TAG)
endif
ENV := $(shell printenv)
GOFLAGS = -ldflags '-X=main.version=$(VSN)'
default: all
all: test install
install: get-deps
@go build $(GOFLAGS) ./cmd/quicklog/
test:
@go test $(GOFLAGS) ./...
get-deps:
@go get -t ./...
clean:
@go clean $(GOFLAGS) -i ./
#all: build
#bin:
# mkdir -p bin
#build: bin
# go build $(GOFLAGS) -o bin/quicklog ./cmd/quicklog
# go build $(GOFLAGS) -o bin/ql2etcd ./cmd/ql2etcd
#linux: bin
# CGO_ENABLED=0 GOOS=linux go build $(GOFLAGS) -ldflags "-s" -a -installsuffix cgo -o bin/quicklog-linux ./cmd/quicklog
#docker: linux
# docker build -t sheenobu/quicklog .
#clean:
# rm -f ./bin/
#test:
# go test ./...
#fmt:
# go fmt ./...
#vet:
# go vet ./...
#lint:
# golint ./...