www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/03/26/15:02:33

From: Jason Green <news AT jgreen4 DOT fsnet DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Trying to figure out makefiles
Date: Mon, 26 Mar 2001 20:51:29 +0100
Lines: 37
Message-ID: <0r5vbt0elvarhhoq5it2dk6n2esi5ufr1i@4ax.com>
References: <0apv6.10280$P4 DOT 869113 AT newsread1 DOT prod DOT itd DOT earthlink DOT net> <9003-Sun25Mar2001201444+0200-eliz AT is DOT elta DOT co DOT il> <32rv6.10684$P4 DOT 890158 AT newsread1 DOT prod DOT itd DOT earthlink DOT net> <99nb94$j9k$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE>
NNTP-Posting-Host: modem-29.sulfur.dialup.pol.co.uk
Mime-Version: 1.0
X-Trace: news6.svr.pol.co.uk 985636249 19065 62.136.15.29 (26 Mar 2001 19:50:49 GMT)
NNTP-Posting-Date: 26 Mar 2001 19:50:49 GMT
X-Complaints-To: abuse AT theplanet DOT net
X-Newsreader: Forte Agent 1.7/32.534
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de> wrote:

> Brian Christiansen <brianc23454 AT earthlink DOT net> wrote:

> > I tried the following, and got the following results:
> 
> > C:\djgpp\bin\projects>make -f proj13.mak proj13.exe
> > proj13.mak:5: *** missing separator.  Stop.
> 
> This message means that your claim there really are <Tab>s in your
> makefile, almost certainly is wrong. Look at line 5 of proj13.mak.

More likely, the makefile was exactly as he said, and with tabbed
indents.  The missing colon on line 5 would cause that error.

This is probably the makefile Brian is attempting to write:

proj13.exe: video.o testmain13.o
	gcc -o proj13.exe video.o testmain13.o
video.o: video.cpp
	gcc -c video.cpp
testmain13.o: testmain13.cpp
	gcc -c testmain13.cpp

but at Eli has pointed out, the last 4 lines are redundant because make
already knows how to compile source files to objects.

Of course, make can do more than this, and I can't help but point out too
that Brian probably wants to turn warnings on since this so easy to do in
a makefile.  Here's a slightly more advanced version (but not more
advanced than a beginner could cope with after browsing the info pages, I
think):

CFLAGS = -Wall

proj13.exe: video.o testmain13.o
	gcc -o $@ $^

- Raw text -


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