bug-make
[Top][All Lists]
Advanced

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

Re: Bug#218367: make: strange behavior with multi-target rules


From: Manoj Srivastava
Subject: Re: Bug#218367: make: strange behavior with multi-target rules
Date: Tue, 11 Nov 2003 01:52:00 -0600
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux) (i386-pc-linux-gnu)

Hi,

      [Please retain the CC to address@hidden
       so that the Debian Bug Tracking system can record your
       input]

      This has been reported by a debian user.

Package: make
Version: 3.80-4

I have always thought that a normal (non-pattern) rule with multiple
targets gets run multiple times, once per each target that is out of
date.  At least, that's what the manual says.  Sometimes one would
like a different behavior, namely to update all the targets at once
with one run, but as long as it's documented and established I am
willing to live with it.  But there seems to be more to it.

MODULES := \
        Blah \
        Bleh \

SOURCES := $(addsuffix .sml,$(MODULES)) 

TEX := $(addsuffix .tex,$(MODULES)) 

modules.tex : $(TEX)
        cat $(TEX) > modules.tex

$(TEX) : $(SOURCES)
        ./bin/plit $(SOURCES)

I have files Blah.sml and Bleh.sml.
Surprise #1: make modules.tex runs the last rule _once_ (which happens
to be what I want in this case).

Surprise #2: add a flag to the command, so now the last rule is

$(TEX) : $(SOURCES)
        ./bin/plit -n $(SOURCES)

touch one of the .sml files, make modules.tex again.  Now plit runs twice!

Surprise #3: refactor like this

$(TEX) : junk

junk: $(SOURCES)
        ./bin/plit -n $(SOURCES)

touch Blah.sml.  Now make modules.tex runs the last rule (once), but
not the first rule (for modules.tex itself), even though it clearly is
out of date!

-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux homage 2.4.22custom1 #4 Fri Oct 3 19:15:17 PDT 2003 i586
Locale: LANG=C, LC_CTYPE=C

Versions of packages make depends on:
ii  libc6                         2.3.2-7    GNU C Library: Shared libraries an

        manoj
-- 
People don't usually make the same mistake twice -- they make it three
times, four time, five times...
Manoj Srivastava   <address@hidden>  <http://www.debian.org/%7Esrivasta/>
1024R/C7261095 print CB D9 F4 12 68 07 E4 05  CC 2D 27 12 1D F5 E8 6E
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C




reply via email to

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