From f2dea829b48a0f81d086d734dae3ec36354b8e87 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Wed, 24 Jun 2015 19:57:27 +0200 Subject: [PATCH] Makefile: Use new build system --- Makefile | 60 ++++++++++---------------------------------------------- 1 file changed, 10 insertions(+), 50 deletions(-) diff --git a/Makefile b/Makefile index 68419d5be..e5a11720b 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,4 @@ -.PHONY: all clean env test bench gox test-integration - -TMPGOPATH=$(PWD)/.gopath -VENDORPATH=$(PWD)/Godeps/_workspace -BASE=github.com/restic/restic -BASEPATH=$(TMPGOPATH)/src/$(BASE) - -GOPATH=$(TMPGOPATH):$(VENDORPATH) - -GOTESTFLAGS ?= -v -GOX_OS ?= linux darwin openbsd freebsd -SFTP_PATH ?= /usr/lib/ssh/sftp-server - -CMDS=$(patsubst cmd/%,%,$(wildcard cmd/*)) -CMDS_DEBUG=$(patsubst %,%.debug,$(CMDS)) +.PHONY: all clean test SOURCE=$(wildcard *.go) $(wildcard */*.go) $(wildcard */*/*.go) @@ -20,43 +6,17 @@ export GOPATH GOX_OS all: restic -.gopath: - mkdir -p .gopath/src/github.com/restic - ln -snf ../../../.. .gopath/src/github.com/restic/restic +restic: $(SOURCE) + go run build.go -%: cmd/% .gopath $(SOURCE) - cd $(BASEPATH) && \ - go build -a -tags release -ldflags "-s" -o $@ ./$< - -%.debug: cmd/% .gopath $(SOURCE) - cd $(BASEPATH) && \ - go build -a -tags debug -ldflags "-s" -o $@ ./$< +restic.debug: $(SOURCE) + go run build.go -tags debug clean: - rm -rf .gopath $(CMDS) $(CMDS_DEBUG) *.cov restic_* - go clean ./... + rm -rf restic restic.debug -test: .gopath - cd $(BASEPATH) && \ - go test $(GOTESTFLAGS) ./... +test: $(SOURCE) + go run run_tests.go /dev/null -bench: .gopath - cd $(BASEPATH) && \ - go test $(GOTESTFLAGS) -bench ./... - -gox: .gopath $(SOURCE) - cd $(BASEPATH) && \ - gox -verbose -os "$(GOX_OS)" ./cmd/restic - -all.cov: .gopath $(SOURCE) - cd $(BASEPATH) && go run run_tests.go all.cov - -env: - @echo export GOPATH=\"$(GOPATH)\" - -goenv: - go env - -list: .gopath - cd $(BASEPATH) && \ - go list ./... +all.cov: $(SOURCE) + go run run_tests.go all.cov