Declare pass-through words PHONY in the Makefile
`make build ctrl` ran the build and then printed "make: 'ctrl' is up to date." The empty rule from $(eval $(ARGS):;@:) is not enough when the word names a real directory — and cfg, ctrl, docs, gen and init all exist at this level. Only .PHONY stops make consulting the filesystem. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
6
Makefile
6
Makefile
@@ -33,6 +33,12 @@ ifneq ($(ARGS),)
|
|||||||
# then fails with "No rule to make target 'sample'", because make reads every
|
# then fails with "No rule to make target 'sample'", because make reads every
|
||||||
# word on the line as something it has been asked to build.
|
# word on the line as something it has been asked to build.
|
||||||
$(eval $(ARGS):;@:)
|
$(eval $(ARGS):;@:)
|
||||||
|
# ...and as PHONY, because some of those words name real directories. `cfg`,
|
||||||
|
# `ctrl`, `docs`, `gen` and `init` all exist at this level, and make considers a
|
||||||
|
# target that is an existing directory already built — so `make build ctrl` ran
|
||||||
|
# the build and then printed "make: 'ctrl' is up to date". The empty rule above
|
||||||
|
# is not enough on its own; only .PHONY stops make consulting the filesystem.
|
||||||
|
.PHONY: $(ARGS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.DEFAULT_GOAL := help
|
.DEFAULT_GOAL := help
|
||||||
|
|||||||
Reference in New Issue
Block a user