On Tue, Jun 9, 2020 at 9:46 AM Edward Welbourne <edward.welbou...@qt.io> wrote: > I presume the workaround is > > TGTDATE := $(shell date) > $(TARGETS): DATE := $(TGTDATE) > > at the slightly annoying price of calling the command once even if > making some target *not* in the TARGETS list.
It is possible to avoid this price with ifeq ($(findstring aa,$(MAKECMDGOALS)),aa) dt:=$(shell set -x; date) endif regards, Dmitry