[Top][All Lists]

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

[Question] multiple targets for implicit rule

From: Masahiro Yamada
Subject: [Question] multiple targets for implicit rule
Date: Wed, 20 Feb 2019 00:51:42 +0900


I have a question about the following behavior.

------------(Makefile begin)---------
.PHONY: all
all: foo.x foo.z

%.x %.z:
        touch $@
-------------(Makefile end)----------

$ rm foo*
$ make
touch foo.x
$ make
touch foo.z
$ make
make: Nothing to be done for 'all'.

When multiple targets appear in one implicit rule,
Make runs the recipe just once instead of twice
even when it is requested to create two targets.

In this case, does Make assume the recipe
will create both %.x and %.z ?

Is this behavior intentional?
Documented somewhere?

Best Regards
Masahiro Yamada

reply via email to

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