From 270e0e42a8cc110121a5070c0b51b23bfddc3cea Mon Sep 17 00:00:00 2001 From: Joseph Richey Date: Tue, 24 Mar 2020 00:16:12 -0700 Subject: [PATCH] Makefile: Use trimpath if available (#208) Passing -trimpath makes the build entirely reproducible. Signed-off-by: Joe Richey --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 014c610..0dbb8fe 100644 --- a/Makefile +++ b/Makefile @@ -73,6 +73,10 @@ override GO_LINK_FLAGS += $(VERSION_FLAG) -extldflags "$(LDFLAGS)" override GO_FLAGS += --ldflags '$(GO_LINK_FLAGS)' # Always use Go modules export GO111MODULE = on +# Use -trimpath if available +ifneq "" "$(shell go help build | grep trimpath)" +override GO_FLAGS += -trimpath +endif ###### Find All Files and Directories ###### FILES := $(shell find . -path '*/.git*' -prune -o -type f -printf "%P\n") -- 2.39.5