🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3725

Re: Makefile with a function in dependency side

#3725
From: Wayne Throop
Date: Tue, 24 Sep 2002 21:10
30 lines
2966 bytes
: "Paul D. Smith" <psmith@gnu.org>
: you might be interested in the new $(eval ...) 
: function available in 3.80  [...]
: The function expands its arguments and reads the results as makefile
: commands.  It, itself, expands to the empty string.  Combined with the
: ability to use define/endef to create variable values containing
: newlines this is a powerful feature.  This capability should obsolete
: a very large percentage of the reasons for using auto-re-exec. 

Very cool!  And yep, many of the reasons I see for doing re-exec
disappear very neatly.   And being able to do it in a target can make
it possible to read expensive macro settings or wildcard expansions
only when a target that requires them is going to be built.  Lots
of peeking at the command line args goes away and becomes much
cleaner.

But problem (or at least I expect it's a problem; "if I'm wrong please
correct" (la-la-la)): if what you $(eval) is a set of dependencies, and
you eval it as part of an action, it won't affect the dependency graph
currently being walked.  If there were an $(eval-targets ...) with some
suitable semantics about skipping subsequent lines in the current action
based on timestamps, one could graft stuff onto the dependency graph on
the fly, and do things like ensure that generated .h files are generated
just in time, by calculating new dependencies based on intermediate results. 

That'd sure clean up lots of places where gratuitous submakes are done...
and help make it parallel-safe to boot.


Wayne Throop   throopw@sheol.org   http://sheol.org/throopw
Technical Details
Message-ID: <1032901857@sheol.org>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!news-x2.support.nl!skynet.be!skynet.be!sn-xit-03!sn-xit-06!sn-post-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
References: <bcf444eb.0209230934.19aac7fb@posting.google.com> <p53cs0bni0.fsf@lemming.engeast.baynetworks.com> <bcf444eb.0209240410.51b4c2a@posting.google.com> <p5u1kfsdpc.fsf@lemming.engeast.baynetworks.com> <1032893040@sheol.org> <p5y99rqgpc.fsf@lemming.engeast.baynetworks.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 109f73,b1afc18c7dca1ca8
X-Google-Attributes: gid109f73,public
X-Google-Thread: 1025b4,b1afc18c7dca1ca8
X-Google-Attributes: gid1025b4,public
X-Google-Thread: fc89c,b1afc18c7dca1ca8
X-Google-Attributes: gidfc89c,public
X-Google-ArrivalTime: 2002-09-24 15:04:25 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!news-x2.support.nl!skynet.be!skynet.be!sn-xit-03!sn-xit-06!sn-post-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
From: throopw@sheol.org (Wayne Throop)
Newsgroups: comp.unix.programmer,gnu.utils.help,gnu.misc.discuss
Subject: Re: Makefile with a function in dependency side
Date: Tue, 24 Sep 2002 21:10:57 GMT
Organization: sheol
Message-ID: <1032901857@sheol.org>
Distribution: world
References: <bcf444eb.0209230934.19aac7fb@posting.google.com>
    <p53cs0bni0.fsf@lemming.engeast.baynetworks.com>
    <bcf444eb.0209240410.51b4c2a@posting.google.com>
    <p5u1kfsdpc.fsf@lemming.engeast.baynetworks.com> <1032893040@sheol.org>
    <p5y99rqgpc.fsf@lemming.engeast.baynetworks.com>
Cache-Post-Path: sj-nntpcache-3!unknown@tent.cisco.com
X-Cache: nntpcache 2.4.0b2 (see http://www.nntpcache.org/)
X-Complaints-To: abuse@supernews.com
Lines: 30