delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/05/24/08:45:03

From: Manni Heumann <manni DOT heumann AT gmx DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Need a little help with make
Date: 24 May 2002 12:32:26 GMT
Lines: 44
Message-ID: <aclbsq$q8i23$1@ID-54749.news.dfncis.de>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1020523172135 DOT 1980A-100000 AT is> <acj04h$q4192$1 AT ID-54749 DOT news DOT dfncis DOT de> <2110-Fri24May2002141807+0300-eliz AT is DOT elta DOT co DOT il>
NNTP-Posting-Host: computer-name.uni-bielefeld.de (129.70.100.226)
Mime-Version: 1.0
X-Trace: fu-berlin.de 1022243546 27543619 129.70.100.226 (16 1428 [54749])
User-Agent: Xnews/5.04.25
X-Face: "c)Go+A65AgR*9'!B)BMLM$kYg6HDG!_g'DAsj*ALo%=kp{X&abs&t\G0F~*r?VRj#|4=6)M.RJPnD]Ql:B<-7A^EAYFpDpZRMoJy?80^3B3b AT DXb%MTyOD.*4wu&Xt6o*+6`r5E
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Eli Zaretskii wrote:

...
> Try using GPATH instead of VPATH.  

Thank you, Eli. 
I tried GPATH: This will build the *.o files (whether they are up to 
date or not), but it will never link them (no such file...).
VPATH will only build them when needed, but it won't link.
I even tried both VPATH _and_ GPATH, but I had no luck.



> If that doesn't help either, try using a simpler Makefile:
> 
> TARGET = rs.exe
> CC = gpp
> OBJECTS = objs/main.o objs/cstring.o objs/config.o objs/data.o
> 
> $(TARGET) : $(OBJECTS)
>      $(CC) $(OBJECTS) $(LDFLAGS) -o $(TARGET)
> 
> objs/%.o : %.cpp
>      $(CC) $< $(WARNINGS) $(CXXFLAGS) -c -o objs/$@

OK, now we're getting somewhere. I had tried something similar, but 
wasn't smart enough to change the rule 
%.o : %.cpp to 
objs/%.o : %.cpp

I had to change -o objs/$@ to the old -o $@ in the last line because 
the assembler tried to create, e.g., objs/objs/main.o 
But now it is finally working! It might not be the most elegant 
solution under the sun. But my project isn't that big, so I guess it 
is worth the effort.

Again: Thank you!

Regards,

Manni

 

- Raw text -


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