Skip to content

Commit 552fd71

Browse files
committed
Makefile: break up some long lines
1 parent 2594459 commit 552fd71

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Makefile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,21 @@ export GOPATH
66
GO := $(CURDIR)/script/go
77
GOFMT := $(CURDIR)/script/gofmt
88

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)"
1112

1213
ifdef USE_ISATTY
1314
GOFLAGS := $(GOFLAGS) --tags isatty
1415
endif
1516

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+
' ./...))
1724

1825
.PHONY: all
1926
all: bin/git-sizer
@@ -94,6 +101,7 @@ govet:
94101
clean:
95102
rm -rf bin
96103

104+
# List all of this project's Go sources, excluding vendor, within .gopath:
97105
.PHONY: srcs
98106
srcs:
99107
@printf "%s\n" $(GO_SRCS)

0 commit comments

Comments
 (0)