2014-11-15 18:08:15 +00:00
|
|
|
# try to get version from git
|
|
|
|
VERSION = $(shell ./version.sh)
|
|
|
|
VERSION ?= "unknown version"
|
|
|
|
LDFLAGS = -X main.version $(VERSION)
|
|
|
|
TAGS =
|
|
|
|
|
|
|
|
.PHONY: all clean debug
|
|
|
|
|
2014-11-16 14:40:04 +00:00
|
|
|
# include config file if it exists
|
|
|
|
-include $(CURDIR)/config.mk
|
|
|
|
|
2014-11-15 18:08:15 +00:00
|
|
|
all: khepri
|
|
|
|
|
2014-11-23 14:15:11 +00:00
|
|
|
khepri: $(wildcard *.go) $(wildcard ../../*.go) $(wildcard ../../*/*.go)
|
2014-11-15 18:08:15 +00:00
|
|
|
go build $(TAGS) -ldflags "$(LDFLAGS)"
|
|
|
|
|
2014-11-16 14:40:04 +00:00
|
|
|
debug: TAGS=-tags debug_cmd
|
2014-11-15 18:08:15 +00:00
|
|
|
debug: khepri
|
|
|
|
|
|
|
|
clean:
|
|
|
|
go clean
|