Merge pull request #1015 from ipfs/fix/1012-Makefile-trim

Fix #1012: Trim paths on Makefile builds
This commit is contained in:
Hector Sanjuan 2020-03-13 14:23:48 +01:00 committed by GitHub
commit 9ad268162b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 9 deletions

View File

@ -1,15 +1,17 @@
# go source files # go source files
SRC := $(shell find .. -type f -name '*.go') SRC := $(shell find ../.. -type f -name '*.go')
GOPATH := $(shell go env GOPATH)
GOFLAGS := "-asmflags=all='-trimpath=$(GOPATH)'" "-gcflags=all='-trimpath=$(GOPATH)'"
all: ipfs-cluster-ctl all: ipfs-cluster-ctl
ipfs-cluster-ctl: $(SRC) ipfs-cluster-ctl: $(SRC)
go build -mod=readonly go build $(GOFLAGS) -mod=readonly
build: ipfs-cluster-ctl build: ipfs-cluster-ctl
install: install:
go install go install $(GOFLAGS)
clean: clean:
rm -f ipfs-cluster-ctl rm -f ipfs-cluster-ctl

View File

@ -1,15 +1,17 @@
# go source files # go source files
SRC := $(shell find .. -type f -name '*.go') SRC := $(shell find ../.. -type f -name '*.go')
GOPATH := $(shell go env GOPATH)
GOFLAGS := "-asmflags=all='-trimpath=$(GOPATH)'" "-gcflags=all='-trimpath=$(GOPATH)'"
all: ipfs-cluster-follow all: ipfs-cluster-follow
ipfs-cluster-follow: $(SRC) ipfs-cluster-follow: $(SRC)
go build -mod=readonly -ldflags "-X main.commit=$(shell git rev-parse HEAD)" go build $(GOFLAGS) -mod=readonly -ldflags "-X main.commit=$(shell git rev-parse HEAD)"
build: ipfs-cluster-follow build: ipfs-cluster-follow
install: install:
go install -ldflags "-X main.commit=$(shell git rev-parse HEAD)" go install $(GOFLAGS) -ldflags "-X main.commit=$(shell git rev-parse HEAD)"
clean: clean:
rm -f ipfs-cluster-follow rm -f ipfs-cluster-follow

View File

@ -1,15 +1,17 @@
# go source files # go source files
SRC := $(shell find .. -type f -name '*.go') SRC := $(shell find ../.. -type f -name '*.go')
GOPATH := $(shell go env GOPATH)
GOFLAGS := "-asmflags=all='-trimpath=$(GOPATH)'" "-gcflags=all='-trimpath=$(GOPATH)'"
all: ipfs-cluster-service all: ipfs-cluster-service
ipfs-cluster-service: $(SRC) ipfs-cluster-service: $(SRC)
go build -mod=readonly -ldflags "-X main.commit=$(shell git rev-parse HEAD)" go build $(GOFLAGS) -mod=readonly -ldflags "-X main.commit=$(shell git rev-parse HEAD)"
build: ipfs-cluster-service build: ipfs-cluster-service
install: install:
go install -ldflags "-X main.commit=$(shell git rev-parse HEAD)" go install $(GOFLAGS) -ldflags "-X main.commit=$(shell git rev-parse HEAD)"
clean: clean:
rm -f ipfs-cluster-service rm -f ipfs-cluster-service