www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/03/26/09:58:54

Date: Tue, 26 Mar 1996 22:48:48 +0800 (GMT+0800)
From: "Orlando A. Andico" <orly AT psylocke DOT eee DOT upd DOT edu DOT ph>
To: j DOT aldrich6 AT genie DOT com
cc: djgpp AT delorie DOT com
Subject: Re: XMODEM File: MAKE.OUT
In-Reply-To: <199603260651.AA138613107@relay1.geis.com>
Message-ID: <Pine.LNX.3.91.960326224450.135B-100000@psylocke.eee.upd.edu.ph>
MIME-Version: 1.0

On Tue, 26 Mar 1996 j DOT aldrich6 AT genie DOT com wrote:

> I feel very stupid, but I have been having this problem with a makefile
> I am trying to write that makes absolutely no sense whatsoever.
> 
> Whenever I run make on the makefile, it gives the following error,
> no matter what arguments I pass:
> 
> makefile:10: *** missing separator.  Stop.
<snip>

<snip>
> CC      = gcc
> C_FLAGS = -Wall -g -O
> 
> TARGETS := $(wildcard lab*. proj*. lab*.exe proj*.exe)
> 
> .PHONY: all
> all: $(TARGETS) ;
> 
> $(TARGETS): %.c pr_echo.o
>         $(CC) $(C_FLAGS) -o $(*).exe $< pr_echo.o -lpc
>         @-del $(*).o
> 
> pr_echo.o: pr_echo.c
>         $(CC) $(C_FLAGS) -c pr_echo.c
<snip>

Welcome to the Feels-Stupid Club, of which I am an avid member of long 
standing  =)

The thing is, Make wants you to use TABS to separate commands (thus the 
missing separator thing). For example, look at the line beginning with 
`pr_echo.o:' -- the next line 

$(CC) $(C_FLAGS) -c pr_echo.c

MUST BEGIN WITH A TAB!!!


I used to use QEdit for this purpose, but the version I had automagically 
replaced tabs with spaces, so after I edited a Makefile, it would 
suddenly stop working (the tab disappeared...) a real annoyance that got 
me flamed 'cause I lambasted peoples' beloved QEdit

Simple solution: use DOS EDIT to edit your Makefile, it handles tabs 
correctly (and dumbly). Or set up your editor to insert tab characters. 
Since I rarely modify Makefiles, I use DOS EDIT.

Cheers,

                                      -------------------------------
                                                   Orlando A. Andico
                                       oandico AT balrog DOT eee DOT upd DOT edu DOT ph
                                      -------------------------------

- Raw text -


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