Files
rtnetmon/Makefile
T
sneak 49457a6abf
check / check (push) Successful in 2m9s
more idiomatic makefile
2026-11-06 20:29:02 -08:00

58 lines
875 B
Makefile

.PHONY: bootstrap setup test lint fmt fmt-check check build run dev deps \
docker cibuild clean hooks
# Target bodies live in script/ (Scripts to Rule Them All); the targets
# below are thin shims that call them.
.DEFAULT_GOAL := build
VERSION ?= $(shell git describe --tags --always)
bootstrap:
@script/bootstrap
setup:
@script/setup
test:
@script/test
lint:
@script/lint
fmt:
@script/fmt
fmt-check:
@script/fmt-check
check:
@script/check
docker:
@script/docker
cibuild:
@script/cibuild
hooks:
@script/install-precommit
build: ./bin/rtnetmon
./bin/rtnetmon: ./cmd ./internal go.sum go.mod
CGO_ENABLED=0 go build -trimpath -ldflags "-X main.Version=$(VERSION)" \
-o bin/rtnetmon ./cmd/rtnetmon
run: build
./bin/rtnetmon
dev:
go run -ldflags "-X main.Version=$(VERSION)" ./cmd/rtnetmon
deps:
go mod download
go mod tidy
clean:
rm -rf bin/