help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Conditional include directories


From: Stephan Beal
Subject: Re: Conditional include directories
Date: Tue, 4 Aug 2015 13:31:01 +0200

On Tue, Aug 4, 2015 at 1:24 PM, Stephan Beal <address@hidden>
wrote:

> On Mon, Aug 3, 2015 at 6:38 PM, Mike Gran <address@hidden> wrote:
>
>> On a 32-bit box, I need to add it as
>> -I/stage2/lib/dbus-1.0/include
>>
>> One a 64-bit box, I need to add it as
>> -I/stage2/lib64/dbus-1.0/include
>>
>> There are a bunch of ways to do this, I guess.  I could
>> check to see if the /stage2/lib64 directory exists.  I could
>> somehow check if the box is 32-bit or 64-bit.
>>
>> What's easiest (in a readability / maintainability sense)?
>
>
>
> i would think the simplest way is simply to use the first one it finds:
>

this time with the missing piece (use only the first entry):

address@hidden:~/tmp]$ cat foo.make
foodir := $(wildcard /usr/nono /usr/share /usr/lib)
bardir := $(word 1,$(foodir))
all:
# foodir=$(foodir)
# bardir=$(bardir)
address@hidden:~/tmp]$ make -f foo.make
# foodir=/usr/share /usr/lib
# bardir=/usr/share


-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal


reply via email to

[Prev in Thread] Current Thread [Next in Thread]