forked from tailscale/tsidp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
23 lines (16 loc) · 727 Bytes
/
Makefile
File metadata and controls
23 lines (16 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
LDFLAGS := -ldflags="-s -w -X main.version=$(VERSION)"
.PHONY: build build-osx build-linux test clean docker-image
build: build-osx build-linux
build-osx:
@mkdir -p build
GOOS=darwin GOARCH=arm64 go build $(LDFLAGS) -o build/tsidp-server-darwin-arm64-$(shell date +%Y-%m-%d)-$(shell git rev-parse --short=5 HEAD) ./tsidp-server.go
build-linux:
@mkdir -p build
GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o build/tsidp-server-linux-amd64-$(shell date +%Y-%m-%d)-$(shell git rev-parse --short=5 HEAD) ./tsidp-server.go
docker-image:
docker build -t tsidp:latest .
test:
go test -count 1 . ./server
clean:
rm -f build/tsidp-server*