summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-01-12 20:16:04 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-01-12 20:16:04 (GMT)
commitfd7510119c442f32b61745dc5cb053cf9a84e86c (patch)
treeeb97e07e56939d58f9a808204b3abac5080c25df
parent50fdce377e2f83f3d8baa11e9b742e2126313e7b (diff)
improved makefile
-rw-r--r--Makefile40
-rw-r--r--src/rhrdtime/rhrdtime.go (renamed from src/helsinki.at/rhrdtime/rhrdtime.go)0
2 files changed, 24 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index d4f1b38..2ccf0c9 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/src/helsinki.at/rhrdtime/rhrdtime.go b/src/rhrdtime/rhrdtime.go
index 4bdf680..4bdf680 100644
--- a/src/helsinki.at/rhrdtime/rhrdtime.go
+++ b/src/rhrdtime/rhrdtime.go