Skip to content

Commit 7b498d3

Browse files
committed
makefile: update according to ipfs/go-ipfs-example-plugin#9
1 parent bbae895 commit 7b498d3

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Makefile

+9-3
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,22 @@ GO111MODULE = on
44
GOCC ?= go
55
GOFLAGS ?=
66

7-
# make reproducable
8-
GOFLAGS += -asmflags=all=-trimpath="$(GOPATH)" -gcflags=all=-trimpath="$(GOPATH)"
9-
107
# If set, override the install location for plugins
118
IPFS_PATH ?= $(HOME)/.ipfs
129

1310
# If set, override the IPFS version to build against. This _modifies_ the local
1411
# go.mod/go.sum files and permanently sets this version.
1512
IPFS_VERSION ?= $(lastword $(shell $(GOCC) list -m github.com/ipfs/go-ipfs))
1613

14+
# make reproducible
15+
ifneq ($(findstring /,$(IPFS_VERSION)),)
16+
# Locally built go-ipfs
17+
GOFLAGS += -asmflags=all=-trimpath="$(GOPATH)" -gcflags=all=-trimpath="$(GOPATH)"
18+
else
19+
# Remote version of go-ipfs (e.g. via `go get -trimpath` or official distribution)
20+
GOFLAGS += -trimpath
21+
endif
22+
1723
.PHONY: install build
1824

1925
go.mod: FORCE

0 commit comments

Comments
 (0)