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

Re: Quilt and patches directory



Michael Biebl <biebl@debian.org> writes:

> Could you give a real-world example when that can happen. I've always
> used the patch target (instead of $(QUILT_STAMPFN)) in my debian/rules
> files and so far haven't encountered any issues.
>
> Given that patch depends on $(QUILT_STAMPFN) I can't imagine a scenario
> where I would run into problems using the patch target.

windlord:~> cat rules
QUILT_STAMPFN = quilt-stamp

$(QUILT_STAMPFN):
        touch $@

patch: $(QUILT_STAMPFN)

build: build-stamp
build-stamp: patch
        @echo 'Running build'
        touch $@
windlord:~> make -f rules build
touch quilt-stamp
Running build
touch build-stamp
windlord:~> make -f rules build
Running build
touch build-stamp

Notice that the build was repeated even though nothing changed and the
stamp file already exists.  This is because patch is phony and will always
force any rule that depends on it to be rebuilt.  If you change this rules
file to depend on QUILT_STAMPFN instead:

windlord:~> cat rules 
QUILT_STAMPFN = quilt-stamp

$(QUILT_STAMPFN):
        touch $@

patch: $(QUILT_STAMPFN)

build: build-stamp
build-stamp: $(QUILT_STAMPFN)
        @echo 'Running build'
        touch $@
windlord:~> make -f rules build
touch quilt-stamp
Running build
touch build-stamp
windlord:~> make -f rules build
make: Nothing to be done for `build'.

dependency management works properly.

-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>


Reply to: