File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -6,14 +6,21 @@ export GOPATH
6
6
GO := $(CURDIR ) /script/go
7
7
GOFMT := $(CURDIR ) /script/gofmt
8
8
9
- GOFLAGS := \
10
- -ldflags "-X main.BuildVersion=$(shell git rev-parse HEAD) -X main.BuildDescribe=$(shell git describe --tags --always --dirty) "
9
+ GO_LDFLAGS := -X main.BuildVersion=$(shell git rev-parse HEAD)
10
+ GO_LDFLAGS += -X main.BuildDescribe=$(shell git describe --tags --always --dirty)
11
+ GOFLAGS := -ldflags "$(GO_LDFLAGS ) "
11
12
12
13
ifdef USE_ISATTY
13
14
GOFLAGS := $(GOFLAGS ) --tags isatty
14
15
endif
15
16
16
- GO_SRCS := $(shell cd $(GOPATH ) /src/$(PACKAGE ) && $(GO ) list -f '{{$$ip := .ImportPath}}{{range .GoFiles}}{{printf ".gopath/src/% s/% s\n" $$ip .}}{{end}}{{range .CgoFiles}}{{printf ".gopath/src/% s/% s\n" $$ip .}}{{end}}{{range .TestGoFiles}}{{printf ".gopath/src/% s/% s\n" $$ip .}}{{end}}{{range .XTestGoFiles}}{{printf ".gopath/src/% s/% s\n" $$ip .}}{{end}}' ./...)
17
+ GO_SRCS := $(sort $(shell cd $(GOPATH ) /src/$(PACKAGE ) && $(GO ) list -f ' \
18
+ {{$$ip := .ImportPath}} \
19
+ {{range .GoFiles }}{{printf ".gopath/src/% s/% s\n" $$ip .}}{{end}} \
20
+ {{range .CgoFiles }}{{printf ".gopath/src/% s/% s\n" $$ip .}}{{end}} \
21
+ {{range .TestGoFiles }}{{printf ".gopath/src/% s/% s\n" $$ip .}}{{end}} \
22
+ {{range .XTestGoFiles}}{{printf ".gopath/src/% s/% s\n" $$ip .}}{{end}} \
23
+ ' ./...) )
17
24
18
25
.PHONY : all
19
26
all : bin/git-sizer
@@ -94,6 +101,7 @@ govet:
94
101
clean :
95
102
rm -rf bin
96
103
104
+ # List all of this project's Go sources, excluding vendor, within .gopath:
97
105
.PHONY : srcs
98
106
srcs :
99
107
@printf " %s\n" $(GO_SRCS )
You can’t perform that action at this time.
0 commit comments