email-mcp/Makefile

26 lines
610 B
Makefile
Raw Normal View History

2026-04-10 12:31:38 +00:00
BINARY_NAME := email-mcp
BUILD_DIR := build
GOCACHE ?= /tmp/$(BINARY_NAME)-gocache
2026-04-13 16:01:28 +00:00
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
2026-04-10 12:31:38 +00:00
GOOS ?= $(shell go env GOOS)
GOARCH ?= $(shell go env GOARCH)
ifeq ($(GOOS),windows)
EXT := .exe
else
EXT :=
endif
OUTPUT := $(BUILD_DIR)/$(BINARY_NAME)-$(GOOS)-$(GOARCH)$(EXT)
.PHONY: build test
build:
@mkdir -p $(BUILD_DIR) $(GOCACHE)
2026-04-13 16:01:28 +00:00
GOCACHE=$(GOCACHE) GOOS=$(GOOS) GOARCH=$(GOARCH) go build -ldflags "-X main.version=$(VERSION)" -o $(OUTPUT) ./cmd/email-mcp
2026-04-10 12:31:38 +00:00
test:
@mkdir -p $(GOCACHE)
GOCACHE=$(GOCACHE) go test ./...