Dear Maintainer,
(N.B. I've backported make 4.3-4 to buster as I need grouped targets but
I have made no changes other than to depend on guile-2.2-dev instead of
guile-3.0-dev)
In some cases you need to run make -t multiple times to touch all the
targets of a grouped target that should all be built by a single
invocation of a recipe.
Example makefile to build debs from a dsc:
$ cat Makefile
chroot=/tmp/chroot
TARGETS=libfoo.deb foo.deb
all : $(TARGETS)
$(TARGETS) &: foo.dsc
#fakeroot fakechroot chroot $(chroot) $(MAKE) -C /build chroot-foo
$(MAKE) chroot-foo
cp $(chroot)/build/libfoo.deb libfoo.deb
cp $(chroot)/build/foo.deb foo.deb
.PHONY: chroot-foo
chroot-foo:
apt-get -y build-dep foo
cd foo-1.1 && dpkg-buildpackage -b --no-sign
Now consider the following:
$ touch foo.dsc
$ make -t
make chroot-foo
make[1]: Entering directory '/tmp/x'
make[1]: Nothing to be done for 'chroot-foo'.
make[1]: Leaving directory '/tmp/x'
touch libfoo.deb
touch libfoo.deb
$
$ make -t
make chroot-foo
make[1]: Entering directory '/tmp/x'
make[1]: Nothing to be done for 'chroot-foo'.
make[1]: Leaving directory '/tmp/x'
touch foo.deb
touch foo.deb
I have to run make -t twice to touch both the targets. I'm not sure why
they get touched twice but that might be expected, see below, but I only
expect to have to run make -t once to touch all the targets.
Change the &: to a simple : rule and we get:
$ make -t
make chroot-foo
make[1]: Entering directory '/tmp/x'
make[1]: Nothing to be done for 'chroot-foo'.
make[1]: Leaving directory '/tmp/x'
touch libfoo.deb
touch libfoo.deb
make chroot-foo
make[1]: Entering directory '/tmp/x'
make[1]: Nothing to be done for 'chroot-foo'.
make[1]: Leaving directory '/tmp/x'
touch foo.deb
touch foo.deb
As expected the rule gets executed twice, once for each target. Each
file is still touched twice.