Skip to content

Commit

Permalink
Makefile: add PHONY targets and a help message
Browse files Browse the repository at this point in the history
  • Loading branch information
atomgardner committed Jan 27, 2016
1 parent 081c6d9 commit 45598d6
Showing 1 changed file with 57 additions and 8 deletions.
65 changes: 57 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@

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

commit = `git rev-parse --short HEAD`
ldflags = "-X "github.com/ipfs/go-ipfs/repo/config".CurrentCommit=$(commit)"
COMMIT := $(shell git rev-parse --short HEAD)
ldflags = "-X "github.com/ipfs/go-ipfs/repo/config".CurrentCommit=$(COMMIT)"
MAKEFLAGS += --no-print-directory

all:
# no-op. try:
# make install
# make test
all: help

godep:
go get github.com/tools/godep
Expand All @@ -31,6 +29,14 @@ build:
nofuse:
cd cmd/ipfs && go install -tags nofuse -ldflags=$(ldflags)

clean:
cd cmd/ipfs && go clean -ldflags=$(ldflags)

uninstall:
cd cmd/ipfs && go clean -i -ldflags=$(ldflags)

PHONY += all help godep install build nofuse clean uninstall

##############################################################
# tests targets

Expand Down Expand Up @@ -76,3 +82,46 @@ test_all_commits_travis:
windows_build_check:
GOOS=windows GOARCH=amd64 go build -o .test.ipfs.exe ./cmd/ipfs
rm .test.ipfs.exe

PHONY += test test_short test_expensive

##############################################################
# A semi-helpful help message

help:
@echo 'DEPENDENCY TARGETS:'
@echo ''
@echo ' vendor - Create a Godep workspace of 3rd party dependencies'
@echo ''
@echo 'BUILD TARGETS:'
@echo ''
@echo ' all - print this help message'
@echo ' build - Build binary at ./cmd/ipfs/ipfs'
@echo ' nofuse - Build binary with no fuse support'
@echo ' install - Build binary and install into $$GOPATH/bin'
# @echo ' dist_install - TODO: c.f. ./cmd/ipfs/dist/README.md'
@echo ''
@echo 'CLEANING TARGETS:'
@echo ''
@echo ' clean - Remove binary from build directory'
@echo ' uninstall - Remove binary from $$GOPATH/bin'
@echo ''
@echo 'TESTING TARGETS:'
@echo ''
@echo ' test - Run expensive tests and Window$$ check'
@echo ' test_short - Run short tests and sharness tests'
@echo ' test_expensive - Run a few extras'
@echo ' test_3node'
@echo ' test_go_short'
@echo ' test_go_expensive'
@echo ' test_go_race'
@echo ' test_sharness_short'
@echo ' test_sharness_expensive'
@echo ' test_all_commits'
@echo " test_all_commits_travis - DON'T USE: takes way too long"
@echo ' windows_build_check'
@echo ''

PHONY += help

.PHONY: $(PHONY)

0 comments on commit 45598d6

Please sign in to comment.