summaryrefslogtreecommitdiff
path: root/Makefile
blob: 046a78b359742670235919c06a8f232dbb218e05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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