help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting list of source files from directory hierarchy


From: Paul Smith
Subject: Re: Getting list of source files from directory hierarchy
Date: Mon, 28 Sep 2009 17:22:46 -0400

On Mon, 2009-09-28 at 13:50 -0700, Michael Morrell wrote:
> I was wide open to ideas on ways people deal with not wanting to
> hardcode a list of source filenames in the Makefiles.  I thought this
> was common enough that perhaps there was a builtin make function to
> help out (I did look through the manual and didn't see anything, but I
> could have easily missed it).

Actually, this behavior is discouraged (at least by me).  In reality
there's NO completely reliable way to automatically determine what
source files you want to build: there could always be backup files or
test files or other temporary files that happen to match whatever
pattern you come up with.

In my book, a build system that is not completely reliable is very, very
bad.

Whenever I'm asked about this I _always_ say, just list the files you
want to build explicitly in your makefile, or somewhere.  It's not
onerous to keep this list up to date (how often are brand new files
added, anyway?) and it saves a lot of headache and hassle.


However, obviously YMMV.

Cheers!

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

[Prev in Thread] Current Thread [Next in Thread]