diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 40 |
1 files changed, 24 insertions, 16 deletions
@@ -22,34 +22,42 @@ ## along with rhrdtime. If not, see <http://www.gnu.org/licenses/>. ## + curdir:= $(shell pwd) -GOCMD := go +GOCMD := GOPATH=$(curdir) go + +EXECUTEABLE := rhrdtime + +LIBS := "github.com/gorilla/websocket" + + +.PHONY: getlibs updatelibs vet format build clean distclean +all: build + -getlibs: export GOPATH=$(curdir) getlibs: - $(GOCMD) get "github.com/gorilla/websocket" + @$(foreach lib,$(LIBS), echo "fetching lib: $(lib)"; $(GOCMD) get $(lib);) + +updatelibs: + @$(foreach lib,$(LIBS), echo "updating lib: $(lib)"; $(GOCMD) get -u $(lib);) -vet: export GOPATH=$(curdir) vet: - $(GOCMD) vet helsinki.at/rhrdtime + @echo "vetting: $(EXECUTEABLE)" + @$(GOCMD) vet $(EXECUTEABLE) -format: export GOPATH=$(curdir) format: - $(GOCMD) fmt helsinki.at/rhrdtime + @echo "formating: $(EXECUTEABLE)" + @$(GOCMD) fmt $(EXECUTEABLE) -build: export GOPATH=$(curdir) build: getlibs - $(GOCMD) install helsinki.at/rhrdtime + @echo "installing: $(EXECUTEABLE)" + @$(GOCMD) install $(EXECUTEABLE) + clean: - rm -rf pkg/*/helsinki.at + rm -rf pkg/*/$(EXECUTEABLE) rm -rf bin distclean: clean - rm -rf src/github.com + @$(foreach dir,$(shell ls src/),$(if $(subst $(EXECUTEABLE),,$(dir)),$(shell rm -rf src/$(dir)))) rm -rf pkg - -all: build test - -.PHONY: getlibs build test clean distclean _setenv -.DEFAULT_GOAL = all |