Package: make
Version: 4.3-4
Severity: normal

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.


-- System Information:
Debian Release: 10.8
  APT prefers stable-debug
  APT policy: (500, 'stable-debug'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-14-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages make depends on:
ii  libc6  2.28-10

make recommends no packages.

Versions of packages make suggests:
pn  make-doc  <none>

-- no debconf information

Reply via email to