make: fix make install not using ldflags for git hash

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
This commit is contained in:
Jakub Sztandera 2017-03-27 15:19:40 +02:00
parent a8b56d3ad7
commit bf23a81bb3
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA
2 changed files with 10 additions and 3 deletions

View File

@ -99,8 +99,7 @@ nofuse: GOTAGS += nofuse
nofuse: build
.PHONY: nofuse
install: $$(DEPS_GO)
go install $(go-flags-with-tags) ./cmd/ipfs
install: cmd/ipfs-install
.PHONY: install
install_unsupported:

View File

@ -12,12 +12,20 @@ PATH := $(realpath $(d)):$(PATH)
# DEPS_OO_$(d) += merkledag/pb/merkledag.pb.go namesys/pb/namesys.pb.go
# DEPS_OO_$(d) += pin/internal/pb/header.pb.go unixfs/pb/unixfs.pb.go
$(IPFS_BIN_$(d)): GOFLAGS += -ldflags="-X "github.com/ipfs/go-ipfs/repo/config".CurrentCommit=$(shell git rev-parse --short HEAD)"
$(d)_flags =-ldflags="-X "github.com/ipfs/go-ipfs/repo/config".CurrentCommit=$(shell git rev-parse --short HEAD)"
$(IPFS_BIN_$(d)): GOFLAGS += $(cmd/ipfs_flags)
# uses second expansion to collect all $(DEPS_GO)
$(IPFS_BIN_$(d)): $(d) $$(DEPS_GO) ALWAYS #| $(DEPS_OO_$(d))
$(go-build)
$(d)-install: GOFLAGS += $(cmd/ipfs_flags)
$(d)-install:
go install $(go-flags-with-tags) ./cmd/ipfs
.PHONY: $(d)-install
COVER_BIN_$(d) := $(d)/ipfs-test-cover
CLEAN += $(COVER_BIN_$(d))