From 1cc3e57c79dce9e7de1ea95603c33a132f726e34 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 8 Jan 2016 02:53:28 +0100 Subject: improved Makefile --- src/hub/Makefile | 58 ++++++++++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/hub/Makefile b/src/hub/Makefile index 037fa57..9113f97 100644 --- a/src/hub/Makefile +++ b/src/hub/Makefile @@ -31,46 +31,54 @@ # curdir:= $(shell pwd) -GOCMD := go +GOCMD := GOPATH=$(curdir) go #TESTFLAG := -test.v TESTFLAG := -getlibs: export GOPATH=$(curdir) +EXECUTEABLE := sfive-hub + +LIBS := "github.com/coopernurse/gorp" \ + "github.com/mattn/go-sqlite3" \ + "github.com/zenazn/goji" \ + "code.google.com/p/go-uuid/uuid" \ + "github.com/equinox0815/graphite-golang" +# "github.com/go-sql-driver/mysql" +# "github.com/ziutek/mymysql/godrv" + + +all: build test +.PHONY: getlibs updatelibs build test clean distclean + + getlibs: - $(GOCMD) get "github.com/coopernurse/gorp" - $(GOCMD) get "github.com/mattn/go-sqlite3" - $(GOCMD) get "github.com/zenazn/goji" - $(GOCMD) get "code.google.com/p/go-uuid/uuid" - $(GOCMD) get "github.com/equinox0815/graphite-golang" -# $(GOCMD) get "github.com/go-sql-driver/mysql" -# $(GOCMD) get "github.com/ziutek/mymysql/godrv" - -vet: export GOPATH=$(curdir) + @$(foreach lib,$(LIBS), echo "fetching lib: $(lib)"; $(GOCMD) get $(lib);) + +updatelibs: update-rhrd-go + @$(foreach lib,$(LIBS), echo "updating lib: $(lib)"; $(GOCMD) get -u $(lib);) + + vet: - $(GOCMD) vet spreadspace.org/sfive-hub + @echo "vetting: $(EXECUTEABLE)" + @$(GOCMD) vet spreadspace.org/$(EXECUTEABLE) -format: export GOPATH=$(curdir) format: - $(GOCMD) fmt spreadspace.org/sfive-hub + @echo "formatting: $(EXECUTEABLE)" + $(GOCMD) fmt spreadspace.org/$(EXECUTEABLE) -build: export GOPATH=$(curdir) build: getlibs - $(GOCMD) install spreadspace.org/sfive-hub + @echo "installing: $(EXECUTEABLE)" + @$(GOCMD) install spreadspace.org/$(EXECUTEABLE) + -test: export GOPATH=$(curdir) test: getlibs - $(GOCMD) test $(TESTFLAG) spreadspace.org/sfive + @echo "testing: sfive" + @$(GOCMD) test $(TESTFLAG) spreadspace.org/sfive + clean: rm -rf pkg/*/spreadspace.org rm -rf bin distclean: clean - rm -rf src/github.com - rm -rf src/code.google.com + $(foreach dir,$(shell ls src/),$(if $(subst spreadspace.org,,$(dir)),$(shell rm -rf src/$(dir)))) rm -rf pkg - -all: build test - -.PHONY: getlibs build test clean distclean _setenv -.DEFAULT_GOAL = all -- cgit v1.2.3