diff --git a/Makefile b/Makefile index b7f6dd9..b6c3bec 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,23 @@ -all: - -git pull - echo "build it!" - GO111MODULE=off go build -v -x +VERSION = $(shell git describe --tags) +BUILDTIME = $(shell date +%Y.%m.%d) + +all: build ./powerpaneld --hostname=breen # su -c "setcap 'cap_net_bind_service=+ep' go.wit.com" -run: - GO111MODULE=off go build -v -x +build: + GO111MODULE=off go build \ + -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" + +verbose: + GO111MODULE=off go build -v -x \ + -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" + +install: + GO111MODULE=off go install \ + -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" + +run: build -systemctl stop powerpaneld.service ./powerpaneld