Bug 2794

Summary: elfutils/backends builds twice
Product: frysk Reporter: Stepan Kasal <skasal>
Component: generalAssignee: Stepan Kasal <skasal>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Bug Depends on:    
Bug Blocks: 2785, 2654    

Description Stepan Kasal 2006-06-17 21:54:55 UTC
When I run "make all" in elfutils twice, the second one starts rebuilding
elfutils/backends and things which depend on it.

Consequently, if I run "./configure; make; make install", then the "make
install" rebuilds elfutils/backends, because install depends on all.

I found the cause:
there is a rule
%.os: %.o
Because the *.o files are not mentoned in the Makefile, they are intermediate,
and thus get removed at the end.

During the first build, dependecy files are generated, and they mention all the
*.o files.

In the second build, these autogenerated dependencies are included by Makefile,
and the *.o files are no longer intermediate, do they are built and trigger the
rebuild of the rest.

The fis is to add
dummy-target-non-intermediate: $(i386_SRCS:.c=.o) ... $(s390_SRCS:.c=.o)

I'll generate a patch sometime the next week.
Comment 1 Stepan Kasal 2006-06-26 17:48:34 UTC
Fixed in the CVS, I used GNU make extensions, since I'm not the first one. ;-)

non-intermediate-objects: $(foreach m,$(modules),$($(m)_SRCS:.c=.o))