forked from wal-g/wal-g
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
35 lines (25 loc) · 984 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
CMD_FILES = $(wildcard cmd/wal-g/*.go)
PKG_FILES = $(wildcard internal/**/*.go internal/**/**/*.go internal/*.go)
TEST_FILES = $(wildcard test/*.go testtools/*.go)
.PHONY: test fmt lint all install clean
ifdef GOTAGS
override GOTAGS := -tags $(GOTAGS)
endif
test: build
go list ./... | grep -Ev 'vendor|submodules|tmp' | xargs go vet
go test -v ./test/
go test -v ./internal/walparser/
fmt: $(CMD_FILES) $(PKG_FILES) $(TEST_FILES)
gofmt -s -w $(CMD_FILES) $(PKG_FILES) $(TEST_FILES)
lint: $(CMD_FILES) $(PKG_FILES) $(TEST_FILES)
go list ./... | grep -Ev 'vendor|submodules|tmp' | xargs golint
all: deps build
deps:
git submodule update --init
dep ensure
install: deps
(cd cmd/wal-g && go install)
clean:
(cd cmd/wal-g && go clean)
build: $(CMD_FILES) $(PKG_FILES)
(cd cmd/wal-g && go build $(GOTAGS) -ldflags "-s -w -X main.BuildDate=`date -u +%Y.%m.%d_%H:%M:%S` -X main.GitRevision=`git rev-parse --short HEAD` -X main.WalgVersion=`git tag -l --points-at HEAD`")