mirror of
https://git.freecumextremist.com/grumbulon/pomme.git
synced 2024-11-22 04:03:46 +00:00
Not Sam
b5599eb055
Co-authored-by: Sam Therapy <sam@samtherapy.net> Reviewed-on: https://git.freecumextremist.com/grumbulon/pomme/pulls/13
37 lines
955 B
Makefile
37 lines
955 B
Makefile
CGO_ENABLED ?= 0
|
|
GOFLAGS ?= -trimpath -ldflags="-s -w"
|
|
|
|
PROG ?= pomme
|
|
GO_SOURCES ?= $(shell find . -name "*.go" -type f ! -name '*_test*')
|
|
GO_TEST_SOURCES ?= $(shell find . -name "*_test.go" -type f)
|
|
|
|
NODE_SOURCES ?= $(shell find ./frontend -type d \( -name node_modules -o -name .svelte-kit -o -name tests \) -prune -o -name '*.ts' -o -name '*.js' -o -name '*.html' -o -name '*.svelte' -o -name '*.json' -print)
|
|
|
|
all: frontend backend
|
|
|
|
.PHONY: frontend
|
|
frontend: $(NODE_SOURCES)
|
|
pnpm -F frontend build
|
|
|
|
.PHONY: backend
|
|
$(PROG): $(GO_SOURCES)
|
|
go build $(GOFLAGS) ./cmd/pomme
|
|
backend: $(PROG)
|
|
|
|
.PHONY: format format-frontend format-backend
|
|
format: format-frontend format-backend
|
|
|
|
format-frontend:
|
|
pnpm -F frontend format
|
|
|
|
format-backend:
|
|
gofmt -w -s .
|
|
|
|
.PHONY: lint lint-frontend lint-backend
|
|
lint: lint-frontend lint-backend
|
|
|
|
lint-frontend:
|
|
pnpm -F frontend lint
|
|
|
|
lint-backend:
|
|
golangci-lint run --timeout=5m --out-format colored-line-number:stdout
|