From d173554892339e5211020c60d6af610840eef7ed Mon Sep 17 00:00:00 2001 From: radhitya Date: Sun, 14 Jun 2026 17:17:56 +0700 Subject: config, rebranding, fix cache --- Makefile | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f1f8ac7..daaf3bf 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,17 @@ -BINARY = sdns +BINARY = linum GO = go -GOMOD = . +MAIN = . +OUTPUT = build/$(BINARY) +LDFLAGS = -ldflags="-s -w -X main.version=$(VERSION)" -.PHONY: default build test lint fmt clean run install fuzz race +.PHONY: default build test lint fmt clean run install fuzz race \ + build-linux default: test lint build build: - $(GO) build -o $(BINARY) $(GOMOD) + $(GO) build $(LDFLAGS) -o $(OUTPUT) $(MAIN) test: $(GO) test -race -count=1 ./... @@ -20,16 +23,25 @@ fmt: gofmt -w . clean: - rm -f $(BINARY) + rm -f $(OUTPUT) run: build - ./$(BINARY) + ./$(OUTPUT) install: - $(GO) install $(GOMOD) + $(GO) install $(LDFLAGS) $(MAIN) fuzz: $(GO) test -fuzz=FuzzBuildResponse -fuzztime=30s ./internal/server/ +build-linux: + GOOS=linux GOARCH=amd64 $(GO) build $(LDFLAGS) -o build/$(BINARY)-linux-amd64 $(MAIN) + +build-darwin: + GOOS=darwin GOARCH=amd64 $(GO) build $(LDFLAGS) -o build/$(BINARY)-darwin-amd64 $(MAIN) + +build-arm: + GOOS=linux GOARCH=arm64 $(GO) build $(LDFLAGS) -o build/$(BINARY)-linux-arm64 $(MAIN) + race: $(GO) test -race -count=1 ./... -- cgit v1.2.3