diff options
author | Mike Crute <mike@crute.us> | 2023-07-29 12:26:23 -0700 |
---|---|---|
committer | Mike Crute <mike@crute.us> | 2023-07-29 12:26:23 -0700 |
commit | 6d867608837f879be2eb934d034f49359f973c84 (patch) | |
tree | 5c35ec4d145d95e5a8b52b4fd778a9c906827e31 /Makefile | |
parent | 4e995f9e6c3adc43a361b6fa9b976d25378f1594 (diff) | |
download | websocket_proxy-6d867608837f879be2eb934d034f49359f973c84.tar.bz2 websocket_proxy-6d867608837f879be2eb934d034f49359f973c84.tar.xz websocket_proxy-6d867608837f879be2eb934d034f49359f973c84.zip |
Allow building standalone client
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -1,7 +1,8 @@ | |||
1 | IMAGE=docker.crute.me/ssh-proxy | 1 | IMAGE=docker.crute.me/ssh-proxy |
2 | BINARY=ssh-proxy | 2 | BINARY=ssh-proxy |
3 | CLIENT_BINARY=ssh-proxy-client | ||
3 | 4 | ||
4 | $(BINARY): $(shell find . -name '*.go') | 5 | $(BINARY): $(CLIENT_BINARY) $(shell find . -name '*.go') |
5 | @[ "$(CLIENT_ID)" ] || ( echo "CLIENT_ID must be set"; exit 1 ) | 6 | @[ "$(CLIENT_ID)" ] || ( echo "CLIENT_ID must be set"; exit 1 ) |
6 | 7 | ||
7 | CGO_ENABLED=0 go build \ | 8 | CGO_ENABLED=0 go build \ |
@@ -9,6 +10,15 @@ $(BINARY): $(shell find . -name '*.go') | |||
9 | -X code.crute.us/mcrute/ssh-proxy/cmd/client.clientId=$(CLIENT_ID)" \ | 10 | -X code.crute.us/mcrute/ssh-proxy/cmd/client.clientId=$(CLIENT_ID)" \ |
10 | -o $@ | 11 | -o $@ |
11 | 12 | ||
13 | $(CLIENT_BINARY): $(shell find . -name '*.go') | ||
14 | @[ "$(CLIENT_ID)" ] || ( echo "CLIENT_ID must be set"; exit 1 ) | ||
15 | |||
16 | CGO_ENABLED=0 go build \ | ||
17 | -tags clientonly \ | ||
18 | -ldflags "-X main.appVersion=$(shell git describe --long --tags --dirty --always) \ | ||
19 | -X code.crute.us/mcrute/ssh-proxy/cmd/client.clientId=$(CLIENT_ID)" \ | ||
20 | -o $@ | ||
21 | |||
12 | .PHONY: vet | 22 | .PHONY: vet |
13 | vet: main.go | 23 | vet: main.go |
14 | go vet $< | 24 | go vet $< |