Makefile 1.8 KB
Newer Older
1 2 3 4 5 6 7

ifeq ($(TEST_NO_FUSE),1)
go_test=go test -tags nofuse
else
go_test=go test
endif

8 9
commit = `git rev-parse --short HEAD`
ldflags = "-X "github.com/ipfs/go-ipfs/repo/config".CurrentCommit=$(commit)"
10

11
all:
12 13 14
	# no-op. try:
	#   make install
	#   make test
15 16 17 18 19 20 21 22 23

godep:
	go get github.com/tools/godep

# saves/vendors third-party dependencies to Godeps/_workspace
# -r flag rewrites import paths to use the vendored path
# ./... performs operation on all packages in tree
vendor: godep
	godep save -r ./...
24

25
install:
26
	cd cmd/ipfs && go install
27

28
build:
29
	cd cmd/ipfs && go build -i -ldflags=$(ldflags)
30

Henry's avatar
Henry committed
31 32 33
nofuse:
	cd cmd/ipfs && go install -tags nofuse

34 35 36
##############################################################
# tests targets

37
test: test_expensive windows_build_check
38

39
test_short: build test_go_short test_sharness_short
40

41
test_expensive: build test_go_expensive test_sharness_expensive
42

43 44
test_3node:
	cd test/3nodetest && make
Brian Tiger Chow's avatar
Brian Tiger Chow committed
45

46
test_go_short:
47
	$(go_test) -test.short ./...
48 49

test_go_expensive:
50
	$(go_test) ./...
51

Brian Tiger Chow's avatar
Brian Tiger Chow committed
52
test_go_race:
53
	$(go_test) ./... -race
Brian Tiger Chow's avatar
Brian Tiger Chow committed
54

55
test_sharness_short:
56
	cd test/sharness/ && make
57 58

test_sharness_expensive:
59
	cd test/sharness/ && TEST_EXPENSIVE=1 make
60 61 62 63 64 65

test_all_commits:
	@echo "testing all commits between origin/master..HEAD"
	@echo "WARNING: this will 'git rebase --exec'."
	@test/bin/continueyn
	GIT_EDITOR=true git rebase -i --exec "make test" origin/master
66 67 68 69 70 71 72 73

test_all_commits_travis:
	# these are needed because travis.
	# we don't use this yet because it takes way too long.
	git config --global user.email "nemo@ipfs.io"
	git config --global user.name "IPFS BOT"
	git fetch origin master:master
	GIT_EDITOR=true git rebase -i --exec "make test" master
74 75 76

# since we have CI for osx and linux but not windows, this should help
windows_build_check:
77
	GOOS=windows GOARCH=amd64 go build -o .test.ipfs.exe ./cmd/ipfs
78
	rm .test.ipfs.exe