[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Conditionals, step one
From: |
Daryl Lee |
Subject: |
Re: Conditionals, step one |
Date: |
Thu, 16 Sep 2010 15:10:47 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100825 Lightning/1.0b2 Thunderbird/3.1.3 |
On 9/16/2010 2:20 PM, Paul Smith wrote:
> On Thu, 2010-09-16 at 12:36 -0700, Radly wrote:
>> Thanks, that was helpful, except that 'info' seems to be a no-op.
>
> That means you're using an older version of GNU make where it wasn't
> implemented.
>
> You can use $(warning ...) instead; that was implemented earlier.
>
>> ifeq (${value OSTYPE},linux-gnu)
>> TXT = GOT_IT
>> else
>> TXT = MISSED_IT
>> endif
>>
>> all:
>> @echo ${TXT}
>
> You should not use the $(value ...) function, as I mentioned in my last
> email.
>
>> Now I would like to know how to pick up OSTYPE directly from the
>> shell, without having to type "make OSTYPE = $OSTYPE". If I enter it
>> that way, the makefile prints out "GOT_IT", but if I just type "make",
>> it prints "MISSED_IT".
>
> If you are correctly exporting your OSTYPE variable from the shell, then
> using the make variable $(OSTYPE) as we described will work.
>
> If, in your shell, you run "env | grep OSTYPE" does it show the value
> for OSTYPE? If so then it's exported properly.
>
> If not then you need to run "export OSTYPE" to export it. This is in no
> way related to make; this is a feature of the shell.
That's what I love about this career--the learning opportunities abound. I
ran the check you suggested, and sure enough there was nothing there. So I
added "export OSTYPE=$OSTYPE to my .bashrc and that cleaned everything up
nicely. THANKS!!
--
Daryl Lee
www.daryllee.com
The unexamined life is not worth living. -- Socrates
The unlived life is not worth examining. -- Unknown
Re: Conditionals, step one, Paul Smith, 2010/09/16
Re: Conditionals, step one, Jean-Rene David, 2010/09/17