Bootstrap probod deamon

Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
gearnode
2025-01-16 13:32:55 +01:00
parent 516995708d
commit 8983a0d7ed
6 changed files with 216 additions and 1 deletions

View File

@@ -1,10 +1,34 @@
NPX?= npx
PRETTIER?= $(NPX) prettier
GO?= go
VERSION= unknown
LDFLAGS= -ldflags "-X 'main.version=$(VERSION)' -X 'main.env=prod'"
GCFLAGS= -gcflags="-e"
GO_BUILD= CGO_ENABLED=$(CGO_ENABLED) GOOS=$(GOOS) $(GO) build $(LDFLAGS) $(GCFLAGS)
CONTROL_SRC:= $(shell find ./controls -type f -name "*.md")
PROBOD_BIN= bin/probod
PROBOD_SRC= cmd/probod/main.go
.PHONY: all
all: fmt
all: build
.PHONY: lint
lint: fmt-check vet
.PHONY: vet
vet:
$(GO) vet ./...
.PHONY: build
build: bin/probod
.PHONY: bin/probod
bin/probod:
$(GO_BUILD) -o $(PROBOD_BIN) $(PROBOD_SRC)
.PHONY: fmt
fmt:
@@ -13,3 +37,7 @@ fmt:
.PHONY: fmt-check
fmt-check:
$(PRETTIER) --check --prose-wrap always $(CONTROL_SRC)
.PHONY: clean
clean:
$(RM) -rf bin/*