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

Kelly O'Hair kelly.ohair at oracle.com
Sat Jun 16 00:33:45 UTC 2012



foo.make:
	@if [ !-f foo.make ] ; then \
            echo "foo.make cannot be found"; \
         fi

-include foo.make


Just a thought.  Defining a rule should get rid of the implicit search.

-kto

On Jun 15, 2012, at 4:59 PM, David Holmes wrote:

> 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