Makefile *** missing separator

Andrew Jacka andrew@hsa.com.au
Wed Jul 16 05:43:00 GMT 2003


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



More information about the Cygwin mailing list