Skip to content

Commit aac4088

Browse files
Merge pull request #3838 from ipfs/fix/make/install-hash
make: fix `make install` not using ldflags for git hash
2 parents c441ecb + bf23a81 commit aac4088

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

Rules.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ nofuse: GOTAGS += nofuse
9999
nofuse: build
100100
.PHONY: nofuse
101101

102-
install: $$(DEPS_GO)
103-
go install $(go-flags-with-tags) ./cmd/ipfs
102+
install: cmd/ipfs-install
104103
.PHONY: install
105104

106105
install_unsupported:

cmd/ipfs/Rules.mk

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,20 @@ PATH := $(realpath $(d)):$(PATH)
1212
# DEPS_OO_$(d) += merkledag/pb/merkledag.pb.go namesys/pb/namesys.pb.go
1313
# DEPS_OO_$(d) += pin/internal/pb/header.pb.go unixfs/pb/unixfs.pb.go
1414

15-
$(IPFS_BIN_$(d)): GOFLAGS += -ldflags="-X "github.com/ipfs/go-ipfs/repo/config".CurrentCommit=$(shell git rev-parse --short HEAD)"
15+
$(d)_flags =-ldflags="-X "github.com/ipfs/go-ipfs/repo/config".CurrentCommit=$(shell git rev-parse --short HEAD)"
16+
17+
$(IPFS_BIN_$(d)): GOFLAGS += $(cmd/ipfs_flags)
1618

1719
# uses second expansion to collect all $(DEPS_GO)
1820
$(IPFS_BIN_$(d)): $(d) $$(DEPS_GO) ALWAYS #| $(DEPS_OO_$(d))
1921
$(go-build)
2022

23+
24+
$(d)-install: GOFLAGS += $(cmd/ipfs_flags)
25+
$(d)-install:
26+
go install $(go-flags-with-tags) ./cmd/ipfs
27+
.PHONY: $(d)-install
28+
2129
COVER_BIN_$(d) := $(d)/ipfs-test-cover
2230
CLEAN += $(COVER_BIN_$(d))
2331

0 commit comments

Comments
 (0)