COMMIT = $(shell git describe --always --long --dirt) TIME = $(shell date +'%Y-%m-%d/%H:%M:%S') VERSION = $(COMMIT) at $(TIME) LDFLAGS = -ldflags "-X 'main.BuildVersion=$(VERSION)'" prefix = /usr/local build: go build $(LDFLAGS) -v -o bin/ ./... fmt: go fmt tunnel/... test: go test tunnel/pkg/test install: install -D -m644 init/tunnel.service /etc/systemd/system/ install -D -m644 init/tunnel@.service /etc/systemd/system/ install -D bin/tunnel $(prefix)/bin/tunnel install -D bin/tunneld $(prefix)/bin/tunneld .PHONY: build fmt test