Idea: Allow certain special targets as dependencies

Problem:
It's often the case that a target also needs to be a special target. E.g.:
.PHONY: all
all: do-this do-that

Obviously this *works*, but it consumes many extra lines &
requires duplication of target names.  For example,
if you misspell the "duplicated" names bad things happen.
For short makefiles this isn't a big deal, but with lots of rules
it gets annoying.

Solution:
As syntactic sugar,
I'd like to see selected special targets allowed as dependencies.
When this happens, it's the same thing as if the target was listed
as a dependency of the special target. E.g., you could express
the same thing above as:

all: .PHONY do-this do-that

This doesn't add new *functionality* to a makefile, but if you're
creating a GNU make specific makefile anyway the savings of
lines can be significant.  It also eliminates a source of errors.

I propose that this abbreviation with the following special targets:
.PHONY
.PRECIOUS
.INTERMEDIATE
.SECONDARY
.IGNORE
.SILENT
.NOTPARALLEL
.ONESHELL

--- David A. Wheeler

_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to