# Art Deco — local build helpers (.so plugin workflow).
#
# `make` produces art-deco.so via CGO go build -buildmode=plugin. This is the
# local-only build used by check-safety. The full `rebuild` target intentionally
# does NOT ship here — production deployment goes through the upstream gotham-style
# Makefile, which is reserved for human-run cycles, not autonomous agents.

.PHONY: all clean templ help

PLUGIN_NAME := art-deco
TEMPL_BIN   := $(HOME)/go/bin/templ

# Default target: build the .so locally.
all: $(PLUGIN_NAME).so

# Local plugin build (no container).
$(PLUGIN_NAME).so: $(wildcard *.go) plugin.mod go.mod
	CGO_ENABLED=1 go build -buildmode=plugin -ldflags="-s -w" -o $(PLUGIN_NAME).so .

# Regenerate templ Go files from .templ sources.
templ:
	$(TEMPL_BIN) generate

# Remove build artefacts.
clean:
	rm -f $(PLUGIN_NAME).so

help:
	@echo "Targets:"
	@echo "  all     Build $(PLUGIN_NAME).so locally (default)"
	@echo "  templ   Regenerate templ Go files"
	@echo "  clean   Remove build artefacts"
