# Kindergarten — local-only build helpers (.so plugin workflow)
#
# IMPORTANT: This Makefile intentionally omits the `rebuild` family of targets
# that other themes ship; this build pass only validates that the plugin
# compiles locally and passes the safety check.

.PHONY: all clean templ help

PLUGIN_NAME := kindergarten

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

# Local plugin build (no container). Requires CGO + matching glibc/go toolchain.
$(PLUGIN_NAME).so: $(wildcard *.go) plugin.mod go.mod
	CGO_ENABLED=1 go build -buildmode=plugin -ldflags="-s -w" -o $(PLUGIN_NAME).so .

clean:
	rm -f $(PLUGIN_NAME).so

# Regenerate templ Go files locally (for development).
templ:
	templ generate

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