help-make
[Top][All Lists]
Advanced

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

Re: list of current sources in single-makefile project?


From: Paul D. Smith
Subject: Re: list of current sources in single-makefile project?
Date: Wed, 6 Nov 2002 20:29:01 -0500

%% gk <address@hidden> writes:

  g> I'm using 'ls' simply to get a pretty list in my 'SOURCE.mk'
  g> makefile: one file per line, instead of the single line output that
  g> $(wildcard ...)  generates. More readable.

Hm... you have a strange dichotomy between wanting make to be a "black
box" etc. on one hand, and wanting the makefiles to be "more readable"
on the other hand :).

  g> Can you say any more about why $(wildcard ...) is preferred?

More efficient.

  g> Since my rules execute in a shell anyway I don't see much overhead
  g> to using 'ls';

ls itself has a lot more overhead than wildcard, because not only is ls
a separate process but it does a lot more than just return the names of
files.  If you don't bother with the formatting you can do the whole
thing in one shell (plus a /bin/echo if it's not builtin to your shell)
if you use wildcard, rather than two shells, at least 6 echos, 2 ls's
and 2 xargs; that's 2 process invocations vs. 12 :).

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "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]