DDNSUpdater/Makefile

32 lines
659 B
Makefile
Raw Normal View History

2026-03-17 14:02:56 +01:00
APP_NAME = DDNSUpdater
BIN_DIR = bin
VERSION = 0.1.0
all: build run
2026-03-17 15:07:24 +01:00
# Default build
2026-03-17 14:02:56 +01:00
build:
@if not exist $(BIN_DIR) mkdir $(BIN_DIR)
2026-03-17 15:07:24 +01:00
set CGO_ENABLED=0 && \
set GOOS=windows && set GOARCH=amd64 && \
go build -ldflags="-s -w -trimpath -X main.version=$(VERSION)" -o $(BIN_DIR)\$(APP_NAME).exe .
2026-03-17 14:02:56 +01:00
run:
go run .
clean:
@if exist $(BIN_DIR) rmdir /s /q $(BIN_DIR)
2026-03-17 15:07:24 +01:00
# Windows-specific optimized build
2026-03-17 14:02:56 +01:00
windows:
@if not exist $(BIN_DIR) mkdir $(BIN_DIR)
2026-03-17 15:07:24 +01:00
set CGO_ENABLED=0 && \
set GOOS=windows && set GOARCH=amd64 && \
go build -ldflags="-s -w -trimpath -X main.version=$(VERSION)" -o $(BIN_DIR)\$(APP_NAME).exe .
2026-03-17 14:02:56 +01:00
tidy:
go mod tidy
fmt:
go fmt ./...