On 7/15/10 10:25 PM, Mark J. Nelson wrote:

usr/src/Makefile:
- Won't this cause stand to build twice on sparc (once as a dependency
of psm and once because it's listed in sparc_SUBDIRS)? The second time
should be a nop, but still unnecessary, right?

No.  We were previously relying on the implicit behavior of dmake to
evaluate dependencies in the specified order, but we were listing psm in
both sparc_ and i386_ subdirs to get the order correct.

Right. I understand why the previous approach was wrong.


Specifying the dependency makes that explicit, and will work correctly
even if SUBDIRS are built in parallel.  But the rule for the stand
target will only be executed once.

Yes, I see why you need psm to depend on stand. Why do you also need stand (again) in sparc_SUBDIRS?

Are you saying that psm is not strictly needed in sparc_SUBDIRS, but it's not wrong because dmake (and any other make variant someone uses) will keep track of the fact that it has already done a make in psm when it sees that dependency for the second time?


usr/src/pkg/Makefile:
- What's the advantage of having install depend on $(ALL_TARGETS)
instead of all?

In this case, none, really.  In general, targets that don't correspond
to actual files will be rebuilt when they don't exist.  So if you had

        all: dep1
                fu

        installA: dep1
                bar

        installB: all
                whee

and you did "make all," then a subsequent "make installA" would execute
only "bar," but a "make installB" would execute "fu" and "whee."

That's a longwinded way to say "trying to practice good makefile
hygiene, even when it doesn't actually make a difference."


Yes, I realize it would make a difference if the all target had commands associated with it (fu in the example above). In this case there are no commands for the all target.

I always thought using the target name (all, in this case) was the best practice in cases like this. But I'll defer to your Makefile experience if you think this represents better hygiene.

        Scott


--
Scott Rotondo
Senior Principal Engineer, Solaris Core OS Engineering
President, Trusted Computing Group
Phone: +1 650 786 6309 (Internal x86309)
_______________________________________________
tools-discuss mailing list
tools-discuss@opensolaris.org

Reply via email to