From: Hans-Bernhard Broeker Newsgroups: comp.os.msdos.djgpp Subject: Re: How Can Makefiles Handle Source File in Extraneous Directories? Date: 15 Aug 2003 11:11:44 GMT Organization: Aachen University of Technology (RWTH) Lines: 33 Message-ID: References: <978b35e2 DOT 0308130707 DOT 1f7d42bf AT posting DOT google DOT com> <978b35e2 DOT 0308140847 DOT 254068cf AT posting DOT google DOT com> <978b35e2 DOT 0308141414 DOT 1aa82234 AT posting DOT google DOT com> NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de X-Trace: nets3.rz.RWTH-Aachen.DE 1060945904 1317 137.226.32.75 (15 Aug 2003 11:11:44 GMT) X-Complaints-To: abuse AT rwth-aachen DOT de NNTP-Posting-Date: 15 Aug 2003 11:11:44 GMT Originator: broeker@ To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Geoff Robinson wrote: > other user-defined files. The user has a project directory and a > common directory they use. Compiling stuff from the project directory > no problem. But a situation may arise where files from both of the > user's directories need to be compiled. That's not much of a problem, as far as make is concerned, *if* you can do one of two things: 1) compile the files sitting in the "common" directory by running a recursive invocation of make over there, like this: $(MAKE) -C $(common_dir) 2) have all .o files, from both source file storage directories, end up in the directory you're running make in. In the first case, you can get away with a single rule that executes the recursive make for all .o files in the common directory, in the second you can use VPATH to find files in both source directories. Or you can give up the lazy approach and write explicit rules for every source file. In the end, makefiles alone may not be enough. There are cases where you really need more tools, up to and including ones that generate makefiles from outlines, or that generate makefile fragments on request. Or maybe make simply isn't up to the task you're trying to solve. Other tools, including Ant, may be worth trying. -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.