www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/05/23/10:15:19.1

From: Manni Heumann <manni DOT heumann AT gmx DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Need a little help with make
Date: 23 May 2002 14:07:30 GMT
Lines: 55
Message-ID: <acit32$q0a1l$2@ID-54749.news.dfncis.de>
References: <acin20$q11rn$1 AT ID-54749 DOT news DOT dfncis DOT de> <acioo3$rhi$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE>
NNTP-Posting-Host: computer-name.uni-bielefeld.de (129.70.100.226)
Mime-Version: 1.0
X-Trace: fu-berlin.de 1022162850 27273269 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

Hans-Bernhard Broeker wrote:

> Manni Heumann <manni DOT heumann AT gmx DOT de> wrote:
>> I've got a tiny little makefile that does what it is supposed
>> to do: compile the object files if needed and then build a
>> binary. Now I wanted to store all the .o files into a
>> subdirectory. 
> 
> You can do that, but you may buy yourself more trouble than it's
> worth.  Currently, you're exploiting a lot of the built-in
> tricks make has been taught by its makers.  What you're trying
> to do renders many of those tricks invalid, and you'll have to
> reinvent them. 

Playing around with the new makefile I created from your and Eli's 
information, I got a pretty good picture of what you mean.
 
> At the minimum, you'ld have to put the name of that subdirectory
> in front of every single .o file name in your OBJECTS list. 
> That alone is cumbersome enough to make the whole plan
> questionable, I'd say. 

Well, it's not very elegant. But I guess I could live with that.

 
> Next, you'ld have to change your pattern rule to name the .o
> files' directory, too.  And that may well break it --- pattern
> rules are usually meant to match from the start of a relative
> pathname, not somewhere in the middle of it.

Again, I guess I did experience the troubles you predicted.

> An alternative method that might work: run make from inside the
> .o files' directory, using the makefile in the actual source
> directory, and then use VPATH to let it find the sources, i.e.:
> 
> ODIR = odir
> 
> all: program
> 
> program: all-objects
> 
> .PHONY: all-objects
> all-objects:
>      $(MAKE) -C $(ODIR) -f ../Makefile VPATH=.. $(OBJECTS)

Hmm. I still have to try this one. Sounds very interesting and I will 
give it a try. 

Thanks,

Manni

 

- Raw text -


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