@cryptotaxi247 / kubo / commits / de4e34d24

Makefile: add PHONY targets and a help message

License: MIT Signed-off-by: Thomas Gardner <tmg@fastmail.com>

Thomas Gardner committed Jan 27, 2016 at 10:51 UTC de4e34d24257c6e56192d15a266fd0f2f2a91855
1 file changed +57 -8
Makefile
+57 -8
@@ -1,17 +1,15 @@
1
2 ifeq ($(TEST_NO_FUSE),1)
3 -go_test=go test -tags nofuse
3 + go_test=go test -tags nofuse
4 else
5 -go_test=go test
5 + go_test=go test
6 endif
7
8 -commit = `git rev-parse --short HEAD`
9 -ldflags = "-X "github.com/ipfs/go-ipfs/repo/config".CurrentCommit=$(commit)"
8 +COMMIT := $(shell git rev-parse --short HEAD)
9 +ldflags = "-X "github.com/ipfs/go-ipfs/repo/config".CurrentCommit=$(COMMIT)"
10 +MAKEFLAGS += --no-print-directory
11
11 -all:
12 - # no-op. try:
13 - # make install
14 - # make test
12 +all: help
13
14 godep:
15 go get github.com/tools/godep
@@ -31,6 +29,14 @@ build:
29 nofuse:
30 cd cmd/ipfs && go install -tags nofuse -ldflags=$(ldflags)
31
32 +clean:
33 + cd cmd/ipfs && go clean -ldflags=$(ldflags)
34 +
35 +uninstall:
36 + cd cmd/ipfs && go clean -i -ldflags=$(ldflags)
37 +
38 +PHONY += all help godep install build nofuse clean uninstall
39 +
40 ##############################################################
41 # tests targets
42
@@ -76,3 +82,46 @@ test_all_commits_travis:
82 windows_build_check:
83 GOOS=windows GOARCH=amd64 go build -o .test.ipfs.exe ./cmd/ipfs
84 rm .test.ipfs.exe
85 +
86 +PHONY += test test_short test_expensive
87 +
88 +##############################################################
89 +# A semi-helpful help message
90 +
91 +help:
92 + @echo 'DEPENDENCY TARGETS:'
93 + @echo ''
94 + @echo ' vendor - Create a Godep workspace of 3rd party dependencies'
95 + @echo ''
96 + @echo 'BUILD TARGETS:'
97 + @echo ''
98 + @echo ' all - print this help message'
99 + @echo ' build - Build binary at ./cmd/ipfs/ipfs'
100 + @echo ' nofuse - Build binary with no fuse support'
101 + @echo ' install - Build binary and install into $$GOPATH/bin'
102 +# @echo ' dist_install - TODO: c.f. ./cmd/ipfs/dist/README.md'
103 + @echo ''
104 + @echo 'CLEANING TARGETS:'
105 + @echo ''
106 + @echo ' clean - Remove binary from build directory'
107 + @echo ' uninstall - Remove binary from $$GOPATH/bin'
108 + @echo ''
109 + @echo 'TESTING TARGETS:'
110 + @echo ''
111 + @echo ' test - Run expensive tests and Window$$ check'
112 + @echo ' test_short - Run short tests and sharness tests'
113 + @echo ' test_expensive - Run a few extras'
114 + @echo ' test_3node'
115 + @echo ' test_go_short'
116 + @echo ' test_go_expensive'
117 + @echo ' test_go_race'
118 + @echo ' test_sharness_short'
119 + @echo ' test_sharness_expensive'
120 + @echo ' test_all_commits'
121 + @echo " test_all_commits_travis - DON'T USE: takes way too long"
122 + @echo ' windows_build_check'
123 + @echo ''
124 +
125 +PHONY += help
126 +
127 +.PHONY: $(PHONY)