wireguard-gui/Makefile
Simon Vieille 99d098ed86
Some checks failed
ci/woodpecker/push/build Pipeline failed
moving to gtk3
2024-08-05 19:16:50 +02:00

37 lines
672 B
Makefile

CGO_ENABLED = 1
DIR = ./build
GO_ARCH_AMD = amd64
GO_OS_LINUX = linux
EXECUTABLE = wireguard-gui
BIN_LINUX_AMD64 = $(DIR)/$(EXECUTABLE)-$(GO_OS_LINUX)-$(GO_ARCH_AMD)
CC = go build
LDFLAGS = all=-w -s
.PHONY: all
all: linux
.PHONY: linux
linux: $(BIN_LINUX_AMD64)
chmod +x $(BIN_LINUX_AMD64)
.PHONY: $(BIN_LINUX_AMD64)
$(BIN_LINUX_AMD64):
CGO_ENABLED=$(CGO_ENABLED) \
GOARCH=$(GO_ARCH_AMD) \
GOOS=$(GO_OS_LINUX) \
$(CC) -ldflags="$(LDFLAGS)" \
-o $(BIN_LINUX_AMD64) .
.PHONY: clean
clean:
rm -rf $(DIR)/*
tool-gofumpt:
which golangci-lint > /dev/null 2>&1 || go install mvdan.cc/gofumpt@latest
fmt: tool-gofumpt
gofumpt -w --extra .