# Generated by yjcli (managed — regenerated when platforms or plugins change).
# Platforms: {{platforms}}
{{#if runner}}
#   make <platform>                 # all services under that platform (concurrent)
#   make <platform> NAME=<service>  # one service
{{/if}}
{{#if builder}}
# Build/deploy scripts are POSIX shell (.sh) only — build/deploy tooling (Docker, etc.)
# is not native to Windows. Run this Makefile through WSL on Windows for those targets.
# Per-platform build/deploy scripts intentionally fail until the repository
# implements the printed build/package/upload steps.
{{/if}}

PLATFORMS := {{platforms}}
{{#if builder}}
BUILD_DEVELOPMENT_TARGETS := $(addsuffix -build-development,$(PLATFORMS))
BUILD_PRODUCTION_TARGETS := $(addsuffix -build-production,$(PLATFORMS))
DEPLOY_DEVELOPMENT_TARGETS := $(addsuffix -deploy-development,$(PLATFORMS))
DEPLOY_PRODUCTION_TARGETS := $(addsuffix -deploy-production,$(PLATFORMS))
{{/if}}

.PHONY: help{{#if runner}} $(PLATFORMS){{/if}}{{#if builder}} $(BUILD_DEVELOPMENT_TARGETS) $(BUILD_PRODUCTION_TARGETS) $(DEPLOY_DEVELOPMENT_TARGETS) $(DEPLOY_PRODUCTION_TARGETS){{/if}}

help:
	@echo "Usage:"
{{#if runner}}
	@echo "  make <platform>                 # start all services concurrently"
	@echo "  make <platform> NAME=<service>  # start one service"
{{/if}}
{{#if builder}}
	@echo "  make <platform>-build-development  [NAME=<service>]"
	@echo "  make <platform>-build-production   [NAME=<service>]"
	@echo "  make <platform>-deploy-development [NAME=<service>]"
	@echo "  make <platform>-deploy-production  [NAME=<service>]"
{{/if}}
	@echo ""
	@echo "Platforms:"
	@for p in $(PLATFORMS); do echo "  $$p"; done
{{#if runner}}

$(PLATFORMS):
	@test -x "tools/runner/run.sh" || (echo "missing: tools/runner/run.sh"; exit 1)
	@if [ -n "$(NAME)" ]; then \
		tools/runner/run.sh "$@" "$(NAME)" $(ARGS); \
	else \
		tools/runner/run.sh "$@" $(ARGS); \
	fi
{{/if}}
{{#if builder}}

$(BUILD_DEVELOPMENT_TARGETS): %-build-development:
	@test -x "tools/builder/$*/build-development.sh" || (echo "missing: tools/builder/$*/build-development.sh"; exit 1)
	@"tools/builder/$*/build-development.sh" "$(NAME)" $(ARGS)

$(BUILD_PRODUCTION_TARGETS): %-build-production:
	@test -x "tools/builder/$*/build-production.sh" || (echo "missing: tools/builder/$*/build-production.sh"; exit 1)
	@"tools/builder/$*/build-production.sh" "$(NAME)" $(ARGS)

$(DEPLOY_DEVELOPMENT_TARGETS): %-deploy-development:
	@test -x "tools/builder/$*/deploy-development.sh" || (echo "missing: tools/builder/$*/deploy-development.sh"; exit 1)
	@"tools/builder/$*/deploy-development.sh" "$(NAME)" $(ARGS)

$(DEPLOY_PRODUCTION_TARGETS): %-deploy-production:
	@test -x "tools/builder/$*/deploy-production.sh" || (echo "missing: tools/builder/$*/deploy-production.sh"; exit 1)
	@"tools/builder/$*/deploy-production.sh" "$(NAME)" $(ARGS)
{{/if}}
