Files
motr-enclave/Makefile

66 lines
1.5 KiB
Makefile

.PHONY: all init generate build build-wasm test test-cover lint fmt vet clean tidy help
MODULE := enclave
BINARY := enclave
BUILD_DIR := build
all: generate build
generate:
@sqlc generate
build:
@mkdir -p $(BUILD_DIR)
@go build -o $(BUILD_DIR)/$(BINARY) ./...
build-wasm:
@mkdir -p $(BUILD_DIR)
@GOOS=js GOARCH=wasm go build -o $(BUILD_DIR)/$(BINARY).wasm ./...
test:
@go test -v ./...
test-cover:
@go test -coverprofile=coverage.out ./...
@go tool cover -html=coverage.out -o coverage.html
lint:
@golangci-lint run ./...
fmt:
@go fmt ./...
@gofumpt -w .
vet:
@go vet ./...
clean:
@rm -rf $(BUILD_DIR)
@rm -f coverage.out coverage.html
tidy:
@go mod tidy
deps:
@go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
@go install mvdan.cc/gofumpt@latest
verify: fmt vet lint test
help:
@echo "Available targets:"
@echo " init - Initialize Go module"
@echo " generate - Run sqlc to generate Go code"
@echo " build - Build binary"
@echo " build-wasm - Build WASM binary"
@echo " test - Run tests"
@echo " test-cover - Run tests with coverage"
@echo " lint - Run golangci-lint"
@echo " fmt - Format code"
@echo " vet - Run go vet"
@echo " clean - Remove build artifacts"
@echo " tidy - Run go mod tidy"
@echo " deps - Install development dependencies"
@echo " verify - Run fmt, vet, lint, and test"