git-lfs/Makefile

63 lines
1.2 KiB
Makefile
Raw Normal View History

GO ?= go
GO_TEST_EXTRA_ARGS =
GLIDE ?= glide
GREP ?= grep
RM ?= rm -f
XARGS ?= xargs
GOIMPORTS ?= goimports
GOIMPORTS_EXTRA_OPTS ?= -w -l
2018-07-16 21:10:31 +00:00
ifndef PKGS
PKGS =
PKGS += commands
PKGS += config
PKGS += errors
PKGS += filepathfilter
PKGS += fs
PKGS += git
PKGS += git/gitattr
PKGS += git/githistory
PKGS += git
PKGS += lfs
PKGS += lfsapi
PKGS += locking
PKGS += subprocess
PKGS += tasklog
PKGS += tools
PKGS += tools/humanize
PKGS += tools/kv
PKGS += tq
endif
TEST_TARGETS := test-bench test-verbose test-race
.PHONY : $(TEST_TARGETS) test
$(TEST_TARGETS) : test
test-bench : GO_TEST_EXTRA_ARGS=-run=__nothing__ -bench=.
test-verbose : GO_TEST_EXTRA_ARGS=-v
test-race : GO_TEST_EXTRA_ARGS=-race
test : fmt
$(GO) test $(GO_TEST_EXTRA_ARGS) $(addprefix ./,$(PKGS))
glide.lock : glide.yaml
$(GLIDE) update
vendor : glide.lock
$(GLIDE) install
$(RM) -r vendor/github.com/ThomsonReutersEikon/go-ntlm/utils
$(RM) -r vendor/github.com/davecgh/go-spew
$(RM) -r vendor/github.com/pmezard/go-difflib
2018-07-16 21:10:31 +00:00
fmt : $(PKGS) | lint
$(GOIMPORTS) $(GOIMPORTS_EXTRA_OPTS) $?
2018-07-16 21:10:31 +00:00
lint : $(PKGS)
$(GO) list -f '{{ join .Deps "\n" }}' . \
| $(XARGS) $(GO) list -f '{{ if not .Standard }}{{ .ImportPath }}{{ end }}' \
| $(GREP) -v "github.com/git-lfs/git-lfs" || exit 0