Understands and extends the sane.mk GNU Make framework for shared deps, check, build, test, dist, debug, and system workflows. Use when: * editing this repo * adding Make targets/includes * wiring behavior through `SANE_*` variables * adopting sane.mk in another project * debugging why a target is not reachable
Resources
25Install
npx skillscat add ysoftwareab/sane-mk Install via the SkillsCat registry.
SKILL.md
sane.mk
Quick model
- Choose the smallest entrypoint:
sane.mk,sane.std.mk,sane.extra.mk, ortemplate/sane.tf.mk. - Extend behavior by appending leaf targets to
SANE_*variables such asSANE_DEPS,SANE_CHECK,SANE_TEST, andSANE_SYSTEM. - Keep top-level verbs declarative; put real work in
deps/*,check/*,test/*,system/*,debug/*.
Repo rules
##comments feedmake help.- Target names use
/; keep.PHONYon its own line. - Make vars use
$(VAR); bash vars use$${VAR}. - Resolve tools with
$(call which,NAME,gname name)into ALL_CAPS variables. - Prefer wrappers like
$(MKDIR),$(CP),$(LN),$(RM)and lazy helpers like$(call make-lazy-once,VAR).
Common tasks
- Add a checker:
Use real tab characters in actual recipe lines.
SANE_CHECK += \
check/foo \
.PHONY: check/foo
check/foo: ## Check foo.
<TAB>$(FOO) --check .- Add a system dependency:
# Brewfile
brew "shellcheck"Run make system or make test/system/brewfile.
- Add a generated file or folder:
SANE_DEPS_FILES += config/generated.env
SANE_DEPS_FOLDERS += deps/folders/tmp
config/generated.env:
<TAB>$(TOUCH) $@Guardrails
- Do not reimplement
all,deps,check,build,test,dist,ci,clean,debug, orsystemunless changing the framework itself. - Preserve formatting and comment conventions;
helpoutput depends on them.