Mail Archives: djgpp/1996/03/26/09:58:54
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 -