delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/07/16/00:46:54

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Message-ID: <3F14D8B3.5020502@hsa.com.au>
Date: Wed, 16 Jul 2003 14:46:43 +1000
From: Andrew Jacka <andrew AT hsa DOT com DOT au>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3.1) Gecko/20030425
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: RE: Makefile *** missing separator

 >> I have a question about gnumake under cygwin...
 >> I am getting an error "*** missing separator" compliling using a
 >> home-baked makefile.
 >
 > I believe "separator" in makefiles equals the TAB character.
 >
 > a) Ensure that you type them at apropriate positions ($ info make)
 > b) Ensure that your editor *keeps* them where you typed them
 >   (i.e. do not use notepad - or similar tools)
 >
 >/Hannu E K Nevalainen, B.Sc. EE - Micro Computer Systems, 59~14'N, 
 >17~12'E
 > <=> degree

Hi,

Just to confirm...  This isn't anything to do with tab characters. 
That was the first thing I checked (mentioned in the original post).

I have done some more digging...   Here is the line where the missing 
separator message comes up.
----------------------------------------------------
$(LIB): $(LIB)($(OBJS)) $(OBJS)   <----- ERROR REFERS TO THIS LINE
	$(CC) $(CFLAGS) -o $@ $(LDLIBS) $^
----------------------------------------------------
It turns out that when the variable "LIB" is not defined, make is 
expanding it to be a single space character.   On all other platforms 
that I have used this setup on, an undefined variable comes out as an 
empty string, and doesn't cause a problem since this expands to an empty 
rule.   Whats more, the test "#ifdef..." comes back with TRUE in this 
case (should be FALSE).   If I define $(LIB) to be empty earlier (ie 
using the line
---------------
LIB :=
---------------
then it correctly expands the rule and #ifdef works properly.   This 
only breaks down when LIB hasn't been defined...

I mentioned in the original post that this exact setup works fine on 
Linux, FreeBSD, Solaris, SolarisX86 - Cygwin seems to be the only 
platform where this happens.   Is this a known bug in the Cygwin variant 
of Make?


Cheers,

Andrew Jacka



--
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