www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/26/19:35:01

Sender: nate AT cartsys DOT com
Message-ID: <360D76A3.DECC943B@cartsys.com>
Date: Sat, 26 Sep 1998 16:20:03 -0700
From: Nate Eldredge <nate AT cartsys DOT com>
MIME-Version: 1.0
To: Sahab Yazdani <sahaby AT geocities DOT com>
CC: djgpp AT delorie DOT com
Subject: Re: MAKEFILE Problems
References: <360D7788 DOT 118F3D41 AT geocities DOT com>

Sahab Yazdani wrote:
> 
> I'm having enourmous amounts of problems trying to compile my programs
> using the MAKE command of DJGPP!  My makefile looks something like this:
> 
> Now I'm rather new to the field of MAKE so I just want to make sure that
> this is the right method of doing it:
> 
> // (Not part of code) Will attempt to compile gamelib.a from object.o
> (if object.o is new)
> 
> gamelib.a : object.o
>         ar rcs gamelib.a object.o
> 
> // (Not part of code) if object.o is old it will re-compile!
> 
> object.o : object.cc
>         gcc -g -c object.cc -o object.o

That looks good, though there are better ways.  For example, you could
use a pattern rule for the compilation of .o from .cc.  See the Make
docs.
 
> Now after typing MAKE at the command prompt I get the message:
> 
> makefile:2: *** missing separator.  Stop.
> 
> Can anybody help me get my makefile working properly

See FAQ section 22.16.

> PS.  Does the name of the file have to be:  MAKEFILE?

I think it can also be GNUMakefile.  Those are the only names Make will
find by default.  Otherwise, you will have to pass it the makefile name
with the `-f' option:

make -f ThisIsMyMakefileWhichHasAVeryLongAndSillyName

-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


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