From e8d6471b740649d7f2076ba242fae277956fcf9a Mon Sep 17 00:00:00 2001 From: Blake Ridgway Date: Sun, 22 Mar 2026 11:29:56 -0500 Subject: [PATCH] add makefile --- Makefile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9849717 --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +BINARY := arcline-uptime +VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo dev) +LDFLAGS := -ldflags "-s -w -X main.version=$(VERSION)" + +.PHONY: build clean install run test linux-amd64 linux-arm64 all + +build: + go build $(LDFLAGS) -o $(BINARY) ./cmd/arcline-uptime + +linux-amd64: + GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o $(BINARY)-linux-amd64 ./cmd/arcline-uptime + +linux-arm64: + GOOS=linux GOARCH=arm64 go build $(LDFLAGS) -o $(BINARY)-linux-arm64 ./cmd/arcline-uptime + +all: linux-amd64 linux-arm64 + +run: build + ./$(BINARY) start --config uptime.example.yaml + +test: + go test ./... + +install: build + install -m 0755 $(BINARY) /usr/local/bin/$(BINARY) + +clean: + rm -f $(BINARY) $(BINARY)-linux-*