bug-make
[Top][All Lists]
Advanced

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

Re: Static multiple target rules


From: tom honermann
Subject: Re: Static multiple target rules
Date: Wed, 31 Mar 2010 02:26:10 -0700
User-agent: Thunderbird 2.0.0.24 (Windows/20100228)

On 3/31/2010 1:01 AM, tom honermann wrote:
True, but it introduces the problem of making sense of these:
+ b1 + b2 +: d1
b1 + + b2: d1
b1 + b2 b3: d1
Solaris 10 make appears to silently drop dangling and extra '+' connectors - which is convenient
for handling macros that are empty when expanded.  It also appears to silently insert missing
'+' connectors if there are any '+' connectors in the target group.  Thus, I think Solaris make would
treat the following rules as equivalent to the ones above:
+ b1 b2: d1
+ b1 b2 b3: d1
Strike that.  It seems Solaris make does not insert '+' connectors and does support multiple target
groups.  This behavior can be seen with rules that fail to actually produce all group members.
all: a1 a2 a3 a4

clean:
        rm -f a1 a2 a3 a4

d1:
        @touch $@

a1 + a2 a3 + a4: d1
        touch $@

The above Makefile has two target groups: a1+a2 and a3+a4.  The group target rule however will only
build the "current" target.
$ make clean
rm -f a1 a2 a3 a4
$ make a1 a2
touch a1

Only a1 is built.  Solaris make assumes a2 was built as well (or treats it similar to GNU make .PHONY
targets)
$ make clean
rm -f a1 a2 a3 a4
$ make a1 a3
touch a1
touch a3

Both a1 and a3 are built in this last case since a1 and a3 are not in the same group.
$ make clean
rm -f a1 a2 a3 a4
$ make a1 a2 a3 a4
touch a1
touch a3
$ make a1 a2 a3 a4
`a1' is up to date.
touch a2
`a3' is up to date.
touch a4

The first make invocation builds a1 and a3 and assumes a2 and a4 were built.  A second invocation
causes a2 and a4 to actually get built.

Tom.

reply via email to

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