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

Bug#499074: [checks/patch-systems] depend on $(QUILT_STAMPFN), not patch



Russ Allbery wrote:
> 
> Having a rule in debian/rules that depends on patch when using the quilt
> makefile fragment is almost always wrong, since patch is a phony target
> that will force any rule that depends on it to be rebuilt.  This often
> results in repeated compiles on the buildds, wasting resources.

Hmmm, I wouldn't be so "dramatic" (not quite the right word, but couldn't
think about any other, sorry) as it is not always the case. Example:

$ cat foo.mk

patch: patch-stamp

build: patch

build2: patch build

build3: patch build2 build
        @echo doing some stuff...

patch-stamp:
        touch $@

.PHONY: build patch build2 build3
$ make -f foo.mk build
touch patch-stamp
$ make -f foo.mk build
make: Nothing to be done for `build'.

BUT, of course if we ...

$ unlink patch-stamp
$ make -f foo.mk build2
touch patch-stamp
$ make -f foo.mk build2
make: Nothing to be done for `build2'.
$ make -f foo.mk build2
make: Nothing to be done for `build2'.
$ unlink patch-stamp
$ make -f foo.mk build3
touch patch-stamp
doing some stuff...
$ make -f foo.mk build3
doing some stuff...

So the key point here is: the warning should not be emitted if the phony
targets do *nothing* but depend on other targets.

> 
> Replacing the patch dependency with $(QUILT_STAMPFN) fixes this problem.
> 
> dpatch may have a similar issue; I haven't looked.
> 

Cheers,
-- 
Atomo64 - Raphael

Please avoid sending me Word, PowerPoint or Excel attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html




Reply to: