bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Idea: Allow certain special targets as dependencies


From: David A. Wheeler
Subject: Idea: Allow certain special targets as dependencies
Date: Sun, 09 Jun 2019 18:46:24 -0400 (EDT)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]