delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/07/19/00:30:19

X-Spam-Check-By: sourceware.org
Message-ID: <469EE8D8.2050500@gmail.com>
Date: Thu, 19 Jul 2007 12:30:16 +0800
From: Carlo Florendo <subscribermail AT gmail DOT com>
User-Agent: Thunderbird 1.5.0.12 (Windows/20070509)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: [SOLVED] Re: cygwin's [g]make 3.81 seems not to understand conditionals
References: <469EE285 DOT 2010603 AT gmail DOT com> <469EE5B0 DOT 3010507 AT acm DOT org> <469EE6C1 DOT 4010600 AT gmail DOT com>
In-Reply-To: <469EE6C1.4010600@gmail.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Carlo Florendo wrote:
> David Rothenberger wrote:
>> On 7/18/2007 9:03 PM, Carlo Florendo wrote:
>>> I've got (and attached) this simple Makefile that checks the build 
>>> platform of a machine.
>>>
>>> Here's the cut-and-pasted content of the Makefile:
>>>
>>> PLATFORM=$(shell uname -s | cut -f 1 -d " " | cut -f 1 -d "_");
>>
>> Try removing the trailing semicolon. It is not removed by make, so 
>> PLATFORM ends up being "CYGWIN;".
> 
> Bingo.  That did it!
> 
> So does that mean that make 3.80 was wrong then?

Please ignore this, sorry.  Both have the correct behaviour.

When expanded under Linux, the make statements become

ifeq ("Linux;", "CYGWIN)
     echo cygwin;
else
     echo linux;
endif

it will "correctly" output "linux"  but it got to the else conditional only 
because "Linux;" != "CYGWIN.

The trailing semi-colon confused me.  I was treating the Makefile as a bash 
script.


Thanks, David!

Best Regards,

Carlo

-- 
Carlo Florendo
Softare Engineer/Network Co-Administrator
Astra Philippines Inc.
UP-Ayala Technopark, Diliman 1101, Quezon City
Philippines
http://www.astra.ph

--
The Astra Group of Companies
5-3-11 Sekido, Tama City
Tokyo 206-0011, Japan
http://www.astra.co.jp

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019