diff options
| author | Joseph Richey <joerichey@google.com> | 2020-03-24 00:16:12 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-24 00:16:12 -0700 |
| commit | 270e0e42a8cc110121a5070c0b51b23bfddc3cea (patch) | |
| tree | cad4a7f38a1f895cb982f10611002fc078ef341b | |
| parent | f10aadb2675b26d351365c6c208c930b6d4c619c (diff) | |
Makefile: Use trimpath if available (#208)
Passing -trimpath makes the build entirely reproducible.
Signed-off-by: Joe Richey <joerichey@google.com>
| -rw-r--r-- | Makefile | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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") |