2018-03-08 14:07:14 -08:00
|
|
|
.PHONY: default
|
|
|
|
default: bin/hw bin/hwc bin/hwl
|
|
|
|
|
2018-03-08 16:09:51 -08:00
|
|
|
VERSION := $(shell git describe --tags 2> /dev/null || echo "unreleased")
|
|
|
|
V_DIRTY := $(shell git describe --exact-match HEAD 2> /dev/null > /dev/null || echo "-unreleased")
|
2018-03-08 16:17:54 -08:00
|
|
|
GIT := $(shell git rev-parse --short HEAD)
|
|
|
|
DIRTY := $(shell git diff-index --quiet HEAD 2> /dev/null > /dev/null || echo "-dirty")
|
|
|
|
|
2018-03-08 13:45:40 -08:00
|
|
|
bin/hw: cmd/hw/main.go bin
|
2018-03-08 16:24:00 -08:00
|
|
|
@echo hw
|
2018-03-08 16:22:19 -08:00
|
|
|
@go build -ldflags \
|
2018-03-08 16:17:54 -08:00
|
|
|
"-X mcquay.me/hw.Version=$(VERSION)$(V_DIRTY) \
|
|
|
|
-X mcquay.me/hw.Git=$(GIT)$(DIRTY)" \
|
2018-03-08 16:09:51 -08:00
|
|
|
-v -o bin/hw ./cmd/hw
|
2018-01-09 16:31:38 -08:00
|
|
|
|
2018-03-08 14:07:14 -08:00
|
|
|
bin/hwc: cmd/hwc/main.go bin
|
2018-03-08 16:24:00 -08:00
|
|
|
@echo hwc
|
2018-03-08 16:22:19 -08:00
|
|
|
@go build -ldflags \
|
2018-03-08 16:17:54 -08:00
|
|
|
"-X mcquay.me/hw.Version=$(VERSION)$(V_DIRTY) \
|
|
|
|
-X mcquay.me/hw.Git=$(GIT)$(DIRTY)" \
|
2018-03-08 16:09:51 -08:00
|
|
|
-v -o bin/hwc ./cmd/hwc
|
2018-03-08 14:07:14 -08:00
|
|
|
|
|
|
|
bin/hwl: cmd/hwl/main.go bin
|
2018-03-08 16:24:00 -08:00
|
|
|
@echo hwl
|
2018-03-08 16:22:19 -08:00
|
|
|
@go build -ldflags \
|
2018-03-08 16:17:54 -08:00
|
|
|
"-X mcquay.me/hw.Version=$(VERSION)$(V_DIRTY) \
|
|
|
|
-X mcquay.me/hw.Git=$(GIT)$(DIRTY)" \
|
2018-03-08 16:09:51 -08:00
|
|
|
-v -o bin/hwl ./cmd/hwl
|
2018-03-08 14:07:14 -08:00
|
|
|
|
2018-01-09 16:31:38 -08:00
|
|
|
bin:
|
|
|
|
mkdir bin
|
2018-03-08 16:23:50 -08:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
@rm -fv bin/{hw,hwl,hwc}
|