Files
laily 10d8800f07 feat: add skill init/check and isolate builder makefile
Give ack, builder, and deployer an explicit init/check mode that reports
missing project config instead of failing mid-work. Point builder at
makefile.builder so its contract targets do not collide with an existing
Makefile.
2026-08-25 16:49:28 +08:00

43 lines
1.5 KiB
Makefile

# Include from makefile.builder. Sets VERSION (canonical, no leading v)
# and IMAGE_TAG (Docker rendering) via builder version.sh.
#
# Command-line / environment VERSION= is passed as --version (official X.Y.Z
# only when HEAD exact-matches that tag). Unset or empty VERSION is derived.
#
# include $(HOME)/.pouch/skills/builder/scripts/version.mk
_builder_scripts_dir := $(dir $(lastword $(MAKEFILE_LIST)))
ifeq ($(BUILDER_VERSION_SH),)
BUILDER_VERSION_SH := $(wildcard $(_builder_scripts_dir)version.sh)
endif
ifeq ($(BUILDER_VERSION_SH),)
ifneq ($(BUILDER_SKILL_DIR),)
BUILDER_VERSION_SH := $(wildcard $(BUILDER_SKILL_DIR)/scripts/version.sh)
endif
endif
ifeq ($(BUILDER_VERSION_SH),)
BUILDER_VERSION_SH := $(wildcard $(HOME)/.pouch/skills/builder/scripts/version.sh)
endif
ifeq ($(BUILDER_VERSION_SH),)
BUILDER_VERSION_SH := $(wildcard $(HOME)/.skills/skills/builder/scripts/version.sh)
endif
ifeq ($(BUILDER_VERSION_SH),)
$(error version.sh not found; set BUILDER_SKILL_DIR or clone pouch to ~/.pouch)
endif
ifeq ($(filter command line environment,$(origin VERSION)),)
VERSION := $(shell "$(BUILDER_VERSION_SH)")
else ifeq ($(strip $(VERSION)),)
VERSION := $(shell "$(BUILDER_VERSION_SH)")
else
VERSION := $(shell "$(BUILDER_VERSION_SH)" --version "$(VERSION)")
endif
ifeq ($(strip $(VERSION)),)
$(error version.sh produced an empty version)
endif
ifeq ($(origin IMAGE_TAG),undefined)
IMAGE_TAG := $(shell "$(BUILDER_VERSION_SH)" --docker --version "$(VERSION)")
endif