# SFCraft 文档 · 构建 / 开发入口 (跨平台)
#
# Linux / macOS:   make build / make dev / make sync
# Windows(有 make 时): 同样可用, 自动调用 PowerShell 脚本
#
# 可附加 hugo 参数: make dev HUGO_ARGS="--port 1314"

.PHONY: help sync build dev

HUGO_ARGS ?=

ifeq ($(OS),Windows_NT)
  PS := powershell -NoProfile -ExecutionPolicy Bypass -File
  BUILD_CMD := $(PS) scripts/build.ps1
  DEV_CMD   := $(PS) scripts/dev.ps1
  SYNC_CMD  := $(PS) scripts/sync-items.ps1
else
  BUILD_CMD := ./scripts/build.sh
  DEV_CMD   := ./scripts/dev.sh
  SYNC_CMD  := ./scripts/sync-items.sh
endif

help:
	@echo "SFCraft 文档"
	@echo "  make build   同步物品贴图并执行 hugo 构建"
	@echo "  make dev     同步物品贴图并启动 hugo 开发服务器"
	@echo "  make sync    仅同步物品贴图"
	@echo "  make help    显示本帮助"
	@echo ""
	@echo "可附加 hugo 参数: make dev HUGO_ARGS=\"--port 1314\""

sync:
	$(SYNC_CMD)

build:
	$(BUILD_CMD) $(HUGO_ARGS)

dev:
	$(DEV_CMD) $(HUGO_ARGS)
