SPB Git forge
15commits 1branches 0releases
29.7 MBsize
maindefault branch
10 days agolast push
TypeScript 36.3% Python 31.8% Go 18% JavaScript 9.8% Shell 1.9% SQL 1.4% CSS 0.5%
1.9 KB · 59 lines make
Raw Blame History
1# InternetPressure.io probe agent — build / test / lint2#3#   make build      → dist/ip-probe-darwin-arm64, dist/ip-probe-linux-amd64 (static, stripped, version-stamped)4#   make test       → go test ./...5#   make lint       → gofmt check + go vet6#   make run-dev    → build for the host and run with probe.dev.yaml (create it from probe.example.yaml)7#   make once T=www.cloudflare.com → one-shot checks against a target89VERSION   ?= $(shell cat VERSION)10MODULE    := internetpressure.io/probe-agent11LDFLAGS   := -s -w -X main.version=$(VERSION)12GOFLAGS   := -trimpath13DIST      := dist14HOST_OS   := $(shell go env GOOS)15HOST_ARCH := $(shell go env GOARCH)16T         ?= www.cloudflare.com1718.PHONY: all build build-host test lint vet fmt run-dev once clean checksums1920all: lint test build2122build: $(DIST)/ip-probe-darwin-arm64 $(DIST)/ip-probe-linux-amd64 checksums2324$(DIST)/ip-probe-darwin-arm64: $(shell find . -name '*.go' -not -path './dist/*') go.mod go.sum VERSION25	@mkdir -p $(DIST)26	CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build $(GOFLAGS) -ldflags "$(LDFLAGS)" -o $@ .2728$(DIST)/ip-probe-linux-amd64: $(shell find . -name '*.go' -not -path './dist/*') go.mod go.sum VERSION29	@mkdir -p $(DIST)30	CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build $(GOFLAGS) -ldflags "$(LDFLAGS)" -o $@ .3132# Convenience: a binary for the machine running make (used by run-dev / once).33build-host:34	@mkdir -p $(DIST)35	CGO_ENABLED=0 go build $(GOFLAGS) -ldflags "$(LDFLAGS)" -o $(DIST)/ip-probe .3637checksums:38	@cd $(DIST) && shasum -a 256 ip-probe-darwin-arm64 ip-probe-linux-amd64 > SHA256SUMS && cat SHA256SUMS3940test:41	go test ./...4243vet:44	go vet ./...4546fmt:47	@test -z "$$(gofmt -l . | grep -v '^dist/')" || (echo "gofmt needed on:" && gofmt -l . && exit 1)4849lint: fmt vet5051run-dev: build-host52	./$(DIST)/ip-probe run --config probe.dev.yaml5354once: build-host55	./$(DIST)/ip-probe once --target $(T)5657clean:58	rm -rf $(DIST)59