Make assistance needed: make tries to create missing included make files

David Holmes david.holmes at oracle.com
Fri Jun 15 23:59:29 UTC 2012


Here's the situation. We add a -include for a possibly non-existent 
custom makefile, eg foo.make. When the file isn't present the build 
tries to build the precompiled headers - Huh! ???

This is due to the following:

1. If "-include foo.make" fails to find foo.make it tries to create it. 
For this it runs through all the implicit rules and for example sees if 
it can create foo.make.o, foo.make.c etc.

2. top.make defines the following implicit rule:

%.o %.i %.s:
         $(UpdatePCH)
         $(MAKE) -f vm.make $(MFLAGS) $@
         #$(MAKE) -f vm.make $@

so this rule is executed to try and generate foo.make.o/i/s and so we 
try to create the precompiled headers.

In a simple test it seemed that adding

.PHONY: foo.make

would fix the problem. But on the full hotspot build it didn't work. 
Still investigating if we made a mistake somewhere in how we did this.

Other way to fix, I think, is to define some kind of rule for .make 
files so that the implicit rules are no longer applied. I'm not sure how 
to do that though.

Anyone have any suggestions?

Thanks,
David



More information about the build-dev mailing list