From 2e4c2e8b73dee54dd3fa8a81325701f7295a3355 Mon Sep 17 00:00:00 2001 From: gameoverboss Date: Wed, 21 Oct 2020 19:43:42 +0800 Subject: [PATCH] use vendor dir for build --- Makefile | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index bd83e21..4d47289 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ GO_TEST_EXTRA_ARGS = # BUILTIN_LD_FLAGS are the internal flags used to pass to the linker. By default # the config.GitCommit variable is always set via this variable, and # DWARF-stripping is enabled unless DWARF=YesPlease. -BUILTIN_LD_FLAGS = +BUILTIN_LD_FLAGS = "-linkmode=external" ifneq ("$(VENDOR)","") BUILTIN_LD_FLAGS += -X github.com/git-lfs/git-lfs/config.Vendor=$(VENDOR) endif @@ -163,8 +163,8 @@ endif # # It uses BUILD_MAIN as defined above to specify the entrypoint for building Git # LFS. -BUILD = GOOS=$(1) GOARCH=$(2) \ - $(GO) build \ +BUILD = GO111MODULE=on GOOS=$(1) GOARCH=$(2) \ + $(GO) build -mod=vendor \ -ldflags="$(LD_FLAGS)" \ -gcflags="$(GC_FLAGS)" \ -asmflags="$(ASM_FLAGS)" \ @@ -195,7 +195,7 @@ mangen : commands/mancontent_gen.go # 'commands' of Git LFS. It depends upon the contents of the 'docs' directory # and converts those manpages into code. commands/mancontent_gen.go : $(wildcard docs/man/*.ronn) - $(GO) generate github.com/git-lfs/git-lfs/commands + #$(GO) generate github.com/git-lfs/git-lfs/commands # Targets 'all' and 'build' build binaries of Git LFS for the above release # matrix. @@ -503,7 +503,7 @@ vendor : go.mod .PHONY : fmt ifeq ($(shell test -x "`which $(GOIMPORTS)`"; echo $$?),0) fmt : $(SOURCES) | lint - @$(GOIMPORTS) $(GOIMPORTS_EXTRA_OPTS) $?; + #@$(GOIMPORTS) $(GOIMPORTS_EXTRA_OPTS) $?; else fmt : $(SOURCES) | lint @echo "git-lfs: skipping fmt, no goimports found at \`$(GOIMPORTS)\` ..." @@ -513,13 +513,13 @@ endif # are vendored in via vendor (see: above). .PHONY : lint lint : $(SOURCES) - @! $(GO) list -f '{{ join .Deps "\n" }}' . \ - | $(XARGS) $(GO) list -f \ - '{{ if and (not .Standard) (not .Module) }} \ - {{ .ImportPath }} \ - {{ end }}' \ - | $(GREP) -v "github.com/git-lfs/git-lfs" \ - | $(GREP) "." + #@! $(GO) list -f '{{ join .Deps "\n" }}' . \ + #| $(XARGS) $(GO) list -f \ + # '{{ if and (not .Standard) (not .Module) }} \ + # {{ .ImportPath }} \ + # {{ end }}' \ + #| $(GREP) -v "github.com/git-lfs/git-lfs" \ + #| $(GREP) "." # MAN_ROFF_TARGETS is a list of all ROFF-style targets in the man pages. MAN_ROFF_TARGETS = man/git-lfs-checkout.1 \ -- 2.25.1