build: add make help menu listing all targets
GNU make reserves 'make --help' for its own options, so a project cannot override that flag; the idiomatic equivalent is 'make help'. Add a self-maintaining help target that parses the Makefile (via scripts/make_help.py) and lists every target with a one-line description, so it stays in sync when targets are added/removed. Also add the missing external-fix / external-fix-apply rows to the README make-command table. Verified: 'make help' lists all 16 targets (exit 0); default build unchanged.
This commit is contained in:
1 parent
9ae82dcd57
commit
6149a156cd
3 files changed
+75
-5
No files matched your search
@@ -13,8 +13,9 @@ LYCHEE_VERSION := 0.24.2
|
||||
TOOLS_BIN := $(CURDIR)/.tools/bin
|
||||
export PATH := $(TOOLS_BIN):$(PATH)
|
||||
|
||||
.PHONY: all build index serve run link-check link-fix external-check external-fix external-fix-apply serve-lan clean bootstrap tool-versions preflight
|
||||
.PHONY: all build index serve run link-check link-fix external-check external-fix external-fix-apply serve-lan clean bootstrap tool-versions preflight help
|
||||
|
||||
# Default target: build content + search index (same as `make index`).
|
||||
all: index
|
||||
|
||||
# ONE-TIME per machine: install the pinned hugo/node/lychee into .tools/bin.
|
||||
@@ -45,6 +46,7 @@ index: build
|
||||
serve: index
|
||||
$(PAGEFIND) --site $(OUT) --serve
|
||||
|
||||
# Alias for `serve` (build + index + serve with search on :1414).
|
||||
run: serve
|
||||
|
||||
# DEAD LINKS -- internal (offline, fast): scan the SOURCE markdown; internal links
|
||||
@@ -88,8 +90,14 @@ external-fix-apply:
|
||||
serve-lan: preflight
|
||||
python3 scripts/serve_lan.py
|
||||
|
||||
# NOTE: clean does NOT remove .tools/ -- the pinned toolchain is expensive to
|
||||
# reinstall and independent of build output. Remove it manually if ever needed.
|
||||
|
||||
# Remove build output (public/ and linkcheck/).
|
||||
# NOTE: does NOT remove .tools/ -- the pinned toolchain is expensive to reinstall
|
||||
# and independent of build output. Remove it manually if ever needed.
|
||||
clean:
|
||||
rm -rf $(OUT) linkcheck
|
||||
|
||||
# List every make target with a one-line description (self-maintaining menu).
|
||||
# NOTE: `make --help` is reserved by GNU make (it prints make's own options and
|
||||
# cannot run a project target); use `make help` for this project's targets.
|
||||
help:
|
||||
@python3 scripts/make_help.py
|
||||
Reference in new issue
Block a user