Article View: comp.unix.programmer
Article #3726Re: Makefile with a function in dependency side
From: Paul D. Smith
Date: Wed, 25 Sep 2002 01:02
Date: Wed, 25 Sep 2002 01:02
37 lines
3325 bytes
3325 bytes
%% throopw@sheol.org (Wayne Throop) writes: wt> But problem (or at least I expect it's a problem; "if I'm wrong wt> please correct" (la-la-la)): if what you $(eval) is a set of wt> dependencies, and you eval it as part of an action, it won't wt> affect the dependency graph currently being walked. Right. Nothing about the fundamental algorithms make uses to determine "out of dateness" has been touched, so of course the problem with defining new target/prereqisite relationships inside a command script is that make works from the bottom up: by the time the command script for a given target is invoked make has already examined all the prerequisites of that target (and their prerequisites etc.) and has decided to rebuild the target. There's little use in defining _more_ prerequisites for that target (chain) within the command script, as they cannot impact the build/no-build decision already made and indeed they won't be checked themselves. Hmm, it might be interesting to provide a way of adding to the list of default goals make will try--that way you could at least add to the targets that will be built. Hm... Anyway, that's why I say it's somewhat bizarre to contemplate defining new targets from within a command script. wt> If there were an $(eval-targets ...) with some suitable semantics wt> about skipping subsequent lines in the current action based on wt> timestamps, one could graft stuff onto the dependency graph on the wt> fly, and do things like ensure that generated .h files are wt> generated just in time, by calculating new dependencies based on wt> intermediate results. Whoa. Now you're talking about a whole new beast :). -- ------------------------------------------------------------------------------- Paul D. Smith <psmith@gnu.org> 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
Technical Details
Message-ID:
<p5znu6990u.fsf@lemming.engeast.baynetworks.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!torn!qcarhaaa.nortelnetworks.com!bcarh189.ca.nortel.com!bcarh8ab.ca.nortel.com!not-for-mailReferences:
<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> <1032901857@sheol.org>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: fc89c,b1afc18c7dca1ca8 X-Google-Attributes: gidfc89c,public X-Google-Thread: 1025b4,b1afc18c7dca1ca8 X-Google-Attributes: gid1025b4,public X-Google-ArrivalTime: 2002-09-24 18:13:35 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!torn!qcarhaaa.nortelnetworks.com!bcarh189.ca.nortel.com!bcarh8ab.ca.nortel.com!not-for-mail From: "Paul D. Smith" <psmith@gnu.org> Newsgroups: comp.unix.programmer,gnu.utils.help,gnu.misc.discuss Subject: Re: Makefile with a function in dependency side Date: 24 Sep 2002 21:02:09 -0400 Organization: GNU's Not Unix! Lines: 37 Message-ID: <p5znu6990u.fsf@lemming.engeast.baynetworks.com> 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> <1032901857@sheol.org> Reply-To: psmith@gnu.org NNTP-Posting-Host: lemming.engeast.baynetworks.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2