mirror of
https://github.com/onyx-and-iris/q3rcon-proxy.git
synced 2025-01-18 08:40:53 +00:00
add multi platform targets to makefile
This commit is contained in:
parent
c2266ac9d9
commit
6c83d6ad2c
42
Makefile
42
Makefile
@ -1,2 +1,40 @@
|
|||||||
go-build:
|
program = q3rcon-proxy
|
||||||
go build ./cmd/q3rcon-proxy/
|
|
||||||
|
GO = @go
|
||||||
|
BIN_DIR := bin
|
||||||
|
|
||||||
|
WINDOWS=$(BIN_DIR)/$(program)_windows_amd64.exe
|
||||||
|
LINUX=$(BIN_DIR)/$(program)_linux_amd64
|
||||||
|
VERSION=$(shell git describe --tags --always --long --dirty)
|
||||||
|
|
||||||
|
.DEFAULT_GOAL := build
|
||||||
|
|
||||||
|
.PHONY: fmt vet build windows linux test clean
|
||||||
|
fmt:
|
||||||
|
$(GO) fmt ./...
|
||||||
|
|
||||||
|
vet: fmt
|
||||||
|
$(GO) vet ./...
|
||||||
|
|
||||||
|
build: vet windows linux | $(BIN_DIR)
|
||||||
|
@echo version: $(VERSION)
|
||||||
|
|
||||||
|
windows: $(WINDOWS)
|
||||||
|
|
||||||
|
linux: $(LINUX)
|
||||||
|
|
||||||
|
|
||||||
|
$(WINDOWS):
|
||||||
|
env GOOS=windows GOARCH=amd64 go build -v -o $(WINDOWS) -ldflags="-s -w -X main.version=$(VERSION)" ./cmd/q3rcon-proxy/
|
||||||
|
|
||||||
|
$(LINUX):
|
||||||
|
env GOOS=linux GOARCH=amd64 go build -v -o $(LINUX) -ldflags="-s -w -X main.version=$(VERSION)" ./cmd/q3rcon-proxy/
|
||||||
|
|
||||||
|
test:
|
||||||
|
$(GO) test ./...
|
||||||
|
|
||||||
|
$(BIN_DIR):
|
||||||
|
@mkdir -p $@
|
||||||
|
|
||||||
|
clean:
|
||||||
|
@rm -rv $(BIN_DIR)
|
Loading…
Reference in New Issue
Block a user