Makefile 2.22 KB
Newer Older
1

2
BINS = bin/random bin/multihash bin/ipfs bin/pollEndpoint bin/iptb bin/go-sleep
3 4 5
IPFS_ROOT = ../
IPFS_CMD = ../cmd/ipfs
RANDOM_SRC = ../Godeps/_workspace/src/github.com/jbenet/go-random
6
RANDOM_FILES_SRC = ../Godeps/_workspace/src/github.com/jbenet/go-random-files
7
MULTIHASH_SRC = ../Godeps/_workspace/src/github.com/jbenet/go-multihash
8
IPTB_SRC = ./dependencies/iptb
Henry's avatar
Henry committed
9
POLLENDPOINT_SRC= ../thirdparty/pollEndpoint
10
GOSLEEP_SRC = ./dependencies/go-sleep
11

12 13 14
# User might want to override those on the command line
GOFLAGS =

15
all: deps
16

17
deps: bins
18 19

clean:
20
	rm $(BINS)
21

22
bins: $(BINS)
23

24 25 26
find_go_files = $(shell find $(1) -name "*.go")

bin/random: $(call find_go_files, $(RANDOM_SRC)) IPFS-BUILD-OPTIONS
27 28
	@echo "*** installing $@ ***"
	go build $(GOFLAGS) -o bin/random $(RANDOM_SRC)/random
29

30 31 32 33
bin/random-files:
	@echo "*** installing $@ ***"
	go build $(GOFLAGS) -o bin/random-files $(RANDOM_FILES_SRC)/random-files

34
bin/multihash: $(call find_go_files, $(MULTIHASH_SRC)) IPFS-BUILD-OPTIONS
35 36
	@echo "*** installing $@ ***"
	go build $(GOFLAGS) -o bin/multihash $(MULTIHASH_SRC)/multihash
37

38
bin/ipfs: $(call find_go_files, $(IPFS_ROOT)) IPFS-BUILD-OPTIONS
39 40
	@echo "*** installing $@ ***"
	go build $(GOFLAGS) -o bin/ipfs $(IPFS_CMD)
41

42
bin/pollEndpoint: $(call find_go_files, $(POLLENDPOINT_SRC)) IPFS-BUILD-OPTIONS
43 44
	@echo "*** installing $@ ***"
	go build $(GOFLAGS) -o bin/pollEndpoint $(POLLENDPOINT_SRC)
45

46 47 48 49
bin/iptb: $(call find_go_files, $(IPTB_SRC)) IPFS-BUILD-OPTIONS
	@echo "*** installing $@ ***"
	go build $(GOFLAGS) -o bin/iptb $(IPTB_SRC)

50 51 52 53
bin/go-sleep: $(call find_go_files, $(GOSLEEP_SRC)) IPFS-BUILD-OPTIONS
	@echo "*** installing $@ ***"
	go build $(GOFLAGS) -o bin/go-sleep $(GOSLEEP_SRC)

Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
54 55
test: test_expensive

rht's avatar
rht committed
56
test_expensive: verify_gofmt
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
57 58
	cd sharness && make TEST_EXPENSIVE=1
	cd 3nodetest && make
59
	cd dependencies && make
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
60

rht's avatar
rht committed
61
test_cheap: verify_gofmt
62
	cd sharness && make
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
63
	cd 3nodetest && make
64

rht's avatar
rht committed
65
test_race: verify_gofmt
66 67 68 69
	cd sharness && make GOFLAGS=-race TEST_EXPENSIVE=1
	cd 3nodetest && make GOFLAGS=-race
	cd dependencies && make GOFLAGS=-race

70 71 72 73 74
coverage: coverage_sharness

coverage_sharness:
	./sharness_test_coverage_helper.sh

75 76 77
IPFS-BUILD-OPTIONS: FORCE
	@bin/checkflags '$@' '$(GOFLAGS)' '*** new Go flags ***'

rht's avatar
rht committed
78 79 80
verify_gofmt:
	bin/verify-go-fmt.sh

81
.PHONY: all clean FORCE