[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Equivalent to VPATH for searching for Makefiles?
From: |
Garrett Cooper |
Subject: |
Re: Equivalent to VPATH for searching for Makefiles? |
Date: |
Thu, 4 Dec 2008 20:05:20 -0800 |
On Thu, Dec 4, 2008 at 8:03 PM, Garrett Cooper <address@hidden> wrote:
> On Thu, Dec 4, 2008 at 4:27 PM, Mike Shal <address@hidden> wrote:
>> On 12/4/08, Garrett Cooper <address@hidden> wrote:
>>> On Thu, Dec 4, 2008 at 2:04 PM, Garrett Cooper <address@hidden> wrote:
>>> > On Thu, Dec 4, 2008 at 11:55 AM, Sam Ravnborg <address@hidden> wrote:
>>> >> This works only for the submake you spawn from the Makefile
>>> >> that contains the assignment.
>>> >>
>>> >> Sam
>>
>> This bit of info seems to be what you are missing.
>
> Yeah, I missed that.
>
>>> >
>>> address@hidden pciutils-3.0.3]$ make
>>>
>>> NOVA_WORKSPACE=/scratch/hoover -f Makefile.nova
>>> Makefile.nova:3: nova-binos-compat.mk: No such file or directory
>>>
>>> make-3.81: *** No rule to make target `nova-binos-compat.mk'. Stop.
>>>
>>> address@hidden pciutils-3.0.3]$ cat Makefile.nova
>>> override MAKEFLAGS += --include=$(NOVA_WORKSPACE)/build/make-lib/
>>>
>>>
>>> include nova-binos-compat.mk
>>>
>>> all clean install:
>>> $(MAKE) \
>>> CROSS_COMPILE=\"$(CROSS_COMPILE)\" \
>>> HOST=\"$(TARGET)-unknown-linux\" \
>>> CFLAGS=\"-isystem -I$(NOVA_INSTALL_BASE)/usr/include\" \
>>> LDFLAGS=\"-L$(NOVA_INSTALL_BASE)/usr/lib -lc -lzlib\" \
>>> $@
>>>
>>>
>>> Ideas?
>>
>> I don't know the best way to do it, but you could have another
>> Makefile that sets MAKEFLAGS appropriately, and then does the '$(MAKE)
>> -f Makefile.nova'. That seemed to work when I tried it, though since
>> Makefile.nova just does a $(MAKE) I got into an infinite loop :). It
>> did find the included .mk file, though.
>>
>> -Mike
>
> Well, the way we do it right now is via a script for the initial
> invocation, but I might just try and simplify this .
Sorry -- incomplete thought:
-> invocation, but I might just try and simplify this
by revising the directory layout of our repository so Makefiles with
the name `Makefile' don't collide with the contributed / generated
Makefiles.
> I did run into the infinite loop though last night. It was pretty
> awesome. After properly setting the variables though and making sure
> the Makefile is named Makefile.nova, things work.
>
> Kind of a bummer though -- I really wanted to get away from using
> scripts without having to redesign the Make system too much for now..
>
> Thanks!
> -Garrett
Ok, phew.
-Garrett