From: Manni Heumann 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: References: <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 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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