@@ -6,6 +6,9 @@ RANDOM_SRC = ../Godeps/_workspace/src/github.com/jbenet/go-random
6
6
MULTIHASH_SRC = ../Godeps/_workspace/src/github.com/jbenet/go-multihash
7
7
POLLENDPOINT_SRC = ../thirdparty/pollEndpoint
8
8
9
+ # User might want to override those on the command line
10
+ GOFLAGS =
11
+
9
12
all : deps
10
13
11
14
deps : bins
@@ -15,17 +18,21 @@ clean:
15
18
16
19
bins : $(BINS )
17
20
18
- bin/random : $(RANDOM_SRC ) /** /* .go
19
- go build -o bin/random $(RANDOM_SRC ) /random
21
+ bin/random : $(RANDOM_SRC ) /** /* .go IPFS-BUILD-OPTIONS
22
+ @echo " *** installing $@ ***"
23
+ go build $(GOFLAGS ) -o bin/random $(RANDOM_SRC ) /random
20
24
21
- bin/multihash : $(MULTIHASH_SRC ) /** /* .go
22
- go build -o bin/multihash $(MULTIHASH_SRC ) /multihash
25
+ bin/multihash : $(MULTIHASH_SRC ) /** /* .go IPFS-BUILD-OPTIONS
26
+ @echo " *** installing $@ ***"
27
+ go build $(GOFLAGS ) -o bin/multihash $(MULTIHASH_SRC ) /multihash
23
28
24
- bin/ipfs : $(IPFS_ROOT ) /** /* .go
25
- go build -o bin/ipfs $(IPFS_CMD )
29
+ bin/ipfs : $(IPFS_ROOT ) /** /* .go IPFS-BUILD-OPTIONS
30
+ @echo " *** installing $@ ***"
31
+ go build $(GOFLAGS ) -o bin/ipfs $(IPFS_CMD )
26
32
27
- bin/pollEndpoint : $(POLLENDPOINT_SRC ) /* .go
28
- go build -o bin/pollEndpoint $(POLLENDPOINT_SRC )
33
+ bin/pollEndpoint : $(POLLENDPOINT_SRC ) /* .go IPFS-BUILD-OPTIONS
34
+ @echo " *** installing $@ ***"
35
+ go build $(GOFLAGS ) -o bin/pollEndpoint $(POLLENDPOINT_SRC )
29
36
30
37
test : test_expensive
31
38
@@ -38,4 +45,12 @@ test_cheap:
38
45
cd sharness && make
39
46
cd 3nodetest && make
40
47
41
- .PHONY : all clean
48
+ test_race :
49
+ cd sharness && make GOFLAGS=-race TEST_EXPENSIVE=1
50
+ cd 3nodetest && make GOFLAGS=-race
51
+ cd dependencies && make GOFLAGS=-race
52
+
53
+ IPFS-BUILD-OPTIONS : FORCE
54
+ @bin/checkflags ' $@' ' $(GOFLAGS)' ' *** new Go flags ***'
55
+
56
+ .PHONY : all clean FORCE
0 commit comments