From e1098eedacfb12ad341aa1f5ec9fa54f1af2e361 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 14 May 2015 11:10:01 +0200 Subject: [PATCH 1/2] Fix make -B (force rebuild) --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f3e36ad70..c601daedd 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ all: restic .gopath: mkdir -p .gopath/src/github.com/restic - ln -sf ../../../.. .gopath/src/github.com/restic/restic + ln -snf ../../../.. .gopath/src/github.com/restic/restic %: cmd/% .gopath cd $(BASEPATH) && \ From 3ace557dbe0d6e3416fbe1c91a666d1cf7785ee3 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 14 May 2015 11:11:30 +0200 Subject: [PATCH 2/2] Makefile: Add dependency on all Go source code --- Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index c601daedd..c0c198057 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,8 @@ SFTP_PATH ?= /usr/lib/ssh/sftp-server CMDS=$(patsubst cmd/%,%,$(wildcard cmd/*)) CMDS_DEBUG=$(patsubst %,%.debug,$(CMDS)) +SOURCE=$(wildcard *.go) $(wildcard */*.go) $(wildcard */*/*.go) + export GOPATH GOX_OS all: restic @@ -22,11 +24,11 @@ all: restic mkdir -p .gopath/src/github.com/restic ln -snf ../../../.. .gopath/src/github.com/restic/restic -%: cmd/% .gopath +%: cmd/% .gopath $(SOURCE) cd $(BASEPATH) && \ go build -a -ldflags "-s" -o $@ ./$< -%.debug: cmd/% .gopath +%.debug: cmd/% .gopath $(SOURCE) cd $(BASEPATH) && \ go build -a -tags debug -ldflags "-s" -o $@ ./$< @@ -42,7 +44,7 @@ bench: .gopath cd $(BASEPATH) && \ go test $(GOTESTFLAGS) -bench ./... -gox: .gopath +gox: .gopath $(SOURCE) cd $(BASEPATH) && \ gox -verbose -os "$(GOX_OS)" ./cmd/restic @@ -54,7 +56,7 @@ test-integration: .gopath restic restic.debug dirdiff cd $(BASEPATH)/backend && \ go test $(GOTESTFLAGS) -test.sftppath $(SFTP_PATH) ./... -all.cov: .gopath +all.cov: .gopath $(SOURCE) cd $(BASEPATH) && \ ./coverage_all.sh all.cov