diff options
| author | radhitya <alif@radhitya.org> | 2026-06-14 17:17:56 +0700 |
|---|---|---|
| committer | radhitya <alif@radhitya.org> | 2026-06-14 17:17:56 +0700 |
| commit | d173554892339e5211020c60d6af610840eef7ed (patch) | |
| tree | 295ce37851532e6180b47c63ed34146a01adc12c /Makefile | |
| parent | 4e6a897a0b55ee533c05f89fa38dbe0704f2798d (diff) | |
config, rebranding, fix cache
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 26 |
1 files changed, 19 insertions, 7 deletions
@@ -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 ./... |
