Merge pull request #1032 from torarnv/cleanup-makefiles

Fix various issues in the test makefiles
This commit is contained in:
Juan Batiz-Benet 2015-04-07 17:51:37 -07:00
commit 20dbea5e5c
3 changed files with 17 additions and 10 deletions

View File

@ -18,19 +18,21 @@ clean:
bins: $(BINS)
bin/random: $(RANDOM_SRC)/**/*.go IPFS-BUILD-OPTIONS
find_go_files = $(shell find $(1) -name "*.go")
bin/random: $(call find_go_files, $(RANDOM_SRC)) IPFS-BUILD-OPTIONS
@echo "*** installing $@ ***"
go build $(GOFLAGS) -o bin/random $(RANDOM_SRC)/random
bin/multihash: $(MULTIHASH_SRC)/**/*.go IPFS-BUILD-OPTIONS
bin/multihash: $(call find_go_files, $(MULTIHASH_SRC)) IPFS-BUILD-OPTIONS
@echo "*** installing $@ ***"
go build $(GOFLAGS) -o bin/multihash $(MULTIHASH_SRC)/multihash
bin/ipfs: $(IPFS_ROOT)/**/*.go IPFS-BUILD-OPTIONS
bin/ipfs: $(call find_go_files, $(IPFS_ROOT)) IPFS-BUILD-OPTIONS
@echo "*** installing $@ ***"
go build $(GOFLAGS) -o bin/ipfs $(IPFS_CMD)
bin/pollEndpoint: $(POLLENDPOINT_SRC)/*.go IPFS-BUILD-OPTIONS
bin/pollEndpoint: $(call find_go_files, $(POLLENDPOINT_SRC)) IPFS-BUILD-OPTIONS
@echo "*** installing $@ ***"
go build $(GOFLAGS) -o bin/pollEndpoint $(POLLENDPOINT_SRC)

View File

@ -14,9 +14,11 @@ shift
shift
FLAG_MSGS="$@"
test -f $FLAG_FILE || touch $FLAG_FILE
# Use x in front of tested values as flags could be
# interpreted by "test" to be for itself.
if test x"$FLAG_VALS" != x"$(cat "$FLAG_FILE" 2>/dev/null)"
if test x"$FLAG_VALS" != x"$(cat "$FLAG_FILE")"
then
echo "$FLAG_MSGS"
echo "$FLAG_VALS" >"$FLAG_FILE"

View File

@ -14,18 +14,21 @@ IPFS_ROOT = ../..
# User might want to override those on the command line
GOFLAGS =
all: clean deps $(T) aggregate
all: aggregate
clean:
clean: clean-test-results
@echo "*** $@ ***"
-rm -rf test-results
-rm -rf bin/ipfs
$(T):
clean-test-results:
@echo "*** $@ ***"
-rm -rf test-results
$(T): clean-test-results deps
@echo "*** $@ ***"
./$@
aggregate:
aggregate: clean-test-results $(T)
@echo "*** $@ ***"
lib/test-aggregate-results.sh