提交 7edfc784 作者: Christian Couder

test: add GOFLAGS variable to the Makefile

This makes it possible to build binaries with
different flags.

The content of the GOFLAGS variable is stored
in a IPFS-BUILD-OPTIONS file, so that if GOFLAGS
changes a rebuild of the binaries with the new
flags is forced.

License: MIT
Signed-off-by: 's avatarChristian Couder <chriscool@tuxfamily.org>
上级 a2c41e65
......@@ -6,6 +6,9 @@ RANDOM_SRC = ../Godeps/_workspace/src/github.com/jbenet/go-random
MULTIHASH_SRC = ../Godeps/_workspace/src/github.com/jbenet/go-multihash
POLLENDPOINT_SRC= ../thirdparty/pollEndpoint
# User might want to override those on the command line
GOFLAGS =
all: deps
deps: bins
......@@ -15,17 +18,21 @@ clean:
bins: $(BINS)
bin/random: $(RANDOM_SRC)/**/*.go
go build -o bin/random $(RANDOM_SRC)/random
bin/random: $(RANDOM_SRC)/**/*.go IPFS-BUILD-OPTIONS
@echo "*** installing $@ ***"
go build $(GOFLAGS) -o bin/random $(RANDOM_SRC)/random
bin/multihash: $(MULTIHASH_SRC)/**/*.go
go build -o bin/multihash $(MULTIHASH_SRC)/multihash
bin/multihash: $(MULTIHASH_SRC)/**/*.go IPFS-BUILD-OPTIONS
@echo "*** installing $@ ***"
go build $(GOFLAGS) -o bin/multihash $(MULTIHASH_SRC)/multihash
bin/ipfs: $(IPFS_ROOT)/**/*.go
go build -o bin/ipfs $(IPFS_CMD)
bin/ipfs: $(IPFS_ROOT)/**/*.go IPFS-BUILD-OPTIONS
@echo "*** installing $@ ***"
go build $(GOFLAGS) -o bin/ipfs $(IPFS_CMD)
bin/pollEndpoint: $(POLLENDPOINT_SRC)/*.go
go build -o bin/pollEndpoint $(POLLENDPOINT_SRC)
bin/pollEndpoint: $(POLLENDPOINT_SRC)/*.go IPFS-BUILD-OPTIONS
@echo "*** installing $@ ***"
go build $(GOFLAGS) -o bin/pollEndpoint $(POLLENDPOINT_SRC)
test: test_expensive
......@@ -38,4 +45,7 @@ test_cheap:
cd sharness && make
cd 3nodetest && make
.PHONY: all clean
IPFS-BUILD-OPTIONS: FORCE
@bin/checkflags '$@' '$(GOFLAGS)' '*** new Go flags ***'
.PHONY: all clean FORCE
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论