sysinfo/Makefile
2025-05-01 03:07:12 -07:00

17 lines
451 B
Makefile

# Infer VERSION from the most recent tag; if none, use short commit hash.
VERSION ?= $(shell git describe --tags --abbrev=0 2>/dev/null || \
git rev-parse --short HEAD)
GOLDFLAGS += -s -w \
-X 'git.eeqj.de/sneak/sysinfo/internal/sysinfo.Version=$(VERSION)'
all: build
build:
GOFLAGS=-ldflags="$(GOLDFLAGS)" go build ./cmd/sysinfo
install:
GOFLAGS=-ldflags="$(GOLDFLAGS)" go install ./cmd/sysinfo
.PHONY: all build install