From 46588cd9dd8aba487b2d281f4f92da8dacac4ea0 Mon Sep 17 00:00:00 2001 From: Michelle Noorali Date: Wed, 3 Feb 2016 14:14:49 -0800 Subject: [PATCH] makefile consolidations --- .travis.yml | 3 +-- Makefile | 7 ++----- expandybird/Makefile | 16 ---------------- include.mk | 25 +++++++++++++++++++++---- manager/Makefile | 16 ---------------- resourcifier/Makefile | 16 ---------------- 6 files changed, 24 insertions(+), 59 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8b017fb9f..69baae606 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,5 +9,4 @@ install: - sudo pip install -r expandybird/requirements.txt script: - - make setup-gotools - - make test + - make setup-gotools test diff --git a/Makefile b/Makefile index a165552be..507ad93a2 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +include include.mk + SUBDIRS := expandybird/. resourcifier/. manager/. TARGETS := all build test push container clean @@ -34,10 +36,6 @@ clean: test: build go test -v $(GO_DEPS) -.PHONY: setup-gotools -setup-gotools: - $(SETUP_GOTOOLS) - push: container container: .project .docker @@ -52,4 +50,3 @@ $(TARGETS) : % : $(addsuffix %,$(SUBDIRS)) $(SUBDIRS_TARGETS) : $(MAKE) -C $(@D) $(@F:.%=%) - diff --git a/expandybird/Makefile b/expandybird/Makefile index 80108a627..6d647bc62 100644 --- a/expandybird/Makefile +++ b/expandybird/Makefile @@ -51,19 +51,3 @@ clean: .PHONY: test test: lint vet test-unit - -.PHONY: test-unit -test-unit: - $(GO_TEST) - -.PHONY: lint -lint: - $(GO_LINT) - -.PHONY: vet -vet: - $(GO_VET) - -.PHONY: setup-gotools -setup-gotools: - $(SETUP_GOTOOLS) diff --git a/include.mk b/include.mk index 932a1e4a7..40c67d14f 100644 --- a/include.mk +++ b/include.mk @@ -1,4 +1,21 @@ -SETUP_GOTOOLS := @echo "Installing golint and vet" && go get -u github.com/golang/lint/golint && go get -u -v golang.org/x/tools/cmd/vet -GO_VET := @echo "Running go vet ..." && go vet ./... -GO_LINT := @echo "Running golint ..." && golint ./... -GO_TEST := @echo "Running tests ..." && go test -v ./... +.PHONY: test-unit +test-unit: + @echo Running tests... + go test -v ./... + +.PHONY: lint +lint: + @echo Running golint... + golint ./... + +.PHONY: vet +vet: + @echo Running go vet... + go vet ./... + +.PHONY: setup-gotools +setup-gotools: + @echo Installing golint + go get -u github.com/golang/lint/golint + @echo Installing vet + go get -u -v golang.org/x/tools/cmd/vet diff --git a/manager/Makefile b/manager/Makefile index 8b0f1d5a3..287c32daa 100644 --- a/manager/Makefile +++ b/manager/Makefile @@ -45,19 +45,3 @@ clean: .PHONY: test test: lint vet test-unit - -.PHONY: test-unit -test-unit: - $(GO_TEST) - -.PHONY: lint -lint: - $(GO_LINT) - -.PHONY: vet -vet: - $(GO_VET) - -.PHONY: setup-gotools -setup-gotools: - $(SETUP_GOTOOLS) diff --git a/resourcifier/Makefile b/resourcifier/Makefile index 1fb513939..41d130df5 100644 --- a/resourcifier/Makefile +++ b/resourcifier/Makefile @@ -47,19 +47,3 @@ clean: .PHONY: test test: lint vet test-unit - -.PHONY: test-unit -test-unit: - $(GO_TEST) - -.PHONY: lint -lint: - $(GO_LINT) - -.PHONY: vet -vet: - $(GO_VET) - -.PHONY: setup-gotools -setup-gotools: - $(SETUP_GOTOOLS)