You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.3 KiB
48 lines
1.3 KiB
GO = go
|
|
APP_NAME = wormhole-client
|
|
VERSION = v1.0.0
|
|
LDFLAGS = -ldflags "-X main.version=$(VERSION) -X main.buildTime=$(shell date -u '+%Y-%m-%d_%H:%M:%S')"
|
|
|
|
.PHONY: all build clean deps test run install uninstall
|
|
|
|
all: clean deps build
|
|
|
|
deps:
|
|
$(GO) mod download
|
|
$(GO) mod tidy
|
|
|
|
build:
|
|
$(GO) build $(LDFLAGS) -o bin/$(APP_NAME) cmd/wormhole-client/main.go
|
|
|
|
run-http: build
|
|
./bin/$(APP_NAME) -config configs/client.yaml -mode http
|
|
|
|
run-global: build
|
|
sudo ./bin/$(APP_NAME) -config configs/client.yaml -mode global
|
|
|
|
run-transparent: build
|
|
sudo ./bin/$(APP_NAME) -config configs/client.yaml -mode transparent
|
|
|
|
test:
|
|
$(GO) test -v ./...
|
|
|
|
clean:
|
|
rm -rf bin/
|
|
|
|
install: build
|
|
sudo cp bin/$(APP_NAME) /usr/local/bin/
|
|
|
|
uninstall:
|
|
sudo rm -f /usr/local/bin/$(APP_NAME)
|
|
|
|
help:
|
|
@echo "Available targets:"
|
|
@echo " build - Build the client binary"
|
|
@echo " run-http - Run HTTP proxy mode"
|
|
@echo " run-global - Run global proxy mode (needs sudo)"
|
|
@echo " run-transparent - Run transparent proxy mode (needs sudo)"
|
|
@echo " test - Run tests"
|
|
@echo " clean - Clean build artifacts"
|
|
@echo " deps - Download dependencies"
|
|
@echo " install - Install to /usr/local/bin"
|
|
@echo " uninstall - Remove from /usr/local/bin"
|
|
|