VERSION ?= $(shell git describe --tags 2>/dev/null) ifeq "$(VERSION)" "" VERSION := UNKNOWN endif LDFLAGS=\ -X kevinschoon.com/hierarchy/pkg/version/internal.Version=$(VERSION) .PHONY: bin/hierarchy bin/hierarchy: bin cd cmd/hierarchy && \ go build -ldflags '${LDFLAGS}' -o ../../$@ bin: mkdir $@ clean: [[ -d bin ]] && rm -r bin watch: ./watch.sh "go build -o bin/hierarchy" man/hierarchy.8: bin/hierarchy bin/hierarchy gen_man > $@