Make File Syntax Error

Posted by Mercury359 on Tue 15 Apr 2003 12:34 PM — 2 posts, 11,690 views.

#0
the cygwin shell is as follows:

Mercury@mercury /cygdrive/c/bc/src
$ make
MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
Error makefile 36: Command syntax error
Error makefile 37: Command syntax error
*** 2 errors during make ***


lines 36 & 37 -

31 ack: $(O_FILES)
32 rm -f ack.exe
33 $(CC) $(L_FLAGS) -o ack $(O_FILES)
34
35 .c.o: ack.h
36 $(CC) -c $(C_FLAGS) -Dunix -DNOCRYPT $<
37
38 clean:
39 rm -f $(O_FILES) ack.exe ../area/core
40 make
41

(41 is the EOF)

any help would be appreciated, again... syntax error in "Makefile" when trying to compile via CygWin under Windows 2k Adv Server
USA #1
Makefiles have a very picky syntax. One thing you'll want to check is the spacing before line 36. Makefiles need a TAB, not spaces from the begining of the line to the start of the command. For example:

.c.o: mud.h
$(CC) -c $(C_FLAGS) $<

Ensure that space is an actual TAB and not just 8 spaces.

Also check that there isn't a "floating" space at the end of line 36 and you have a clean line break. Finally, check to make sure you have a CC=gcc line at the top of your file.