[prev] [thread] [next] [lurker] [Date index for 2006/11/20]
Peter da Silva wrote: >>THE DIFFERENCE BETWEEN #1 & #2 IS THE ORDER OF STATEMENTS. Not funny. Make is >>"designed" to make order of statements "unimportant" most of the time. Unless >>you spawn processes depending on values of variables. Or use := instead of =. Or >>mess with order of pattern-matching rules. Or... The problem is that I tried >>quite some permutations, and all I get is #1 or #2. > > > Once you start getting into := versus = you've left "make as a description of > dependancies" behind, and into "make as an oddball scripting language". Which > may be what you need to do but I'd step back and try something else first. I only have 1 screen of make code calling about 2000 lines of Python code. The problem is that the screen of make code is written to integrate my stuff into a make "system" of several thousands lines. It's not that "make as a description of dependencies" works. Figuring out the "best suitable" % pattern rule rivals C++ overload resolution in it's pointless obscurity. And where would you list "special targets" such as .PHONY (forget to add an "abstract" target to it's "dependency" list and you're screwed to the wall) and .PRECIOUS (forget to add a generated file and make enters an infinite loop generating and deleting the file)? > > If you have dependency rules that modify the Makefile, which it sounds like > you do, you definitely need to avoid doing anything else complex in the > Makefile itself, because self-modifying code is evil at the best of times, > and re-executing itself with the modified Makefile is probably the sanest > thing it can do. Oh no! The rules don't *modify* the makefiles. They just generate a shitload of *.d files which are then included and -included in different places. I was shocked to find a publication in Dr. Dobb's describing an equivalent kludge - I didn't think this kind of shit could be a "best industry practice" (tm). *Of course* self-modifying code is evil. So *why the fuck* does make treat dependencies as *code*, not *data*?? I'm sure it works fine with a 2-file program and a single build mode though. > > My messages to the wankers: > > 1. "just because it's called makedeps doesn't mean it's sane to put it in > a Make rule and call 'make deps' to run it". > > 2. "it's about ten zillion times harder to use Make as a scripting language > than to run a script to handle an edge case, so leave all that fancy stuff > in gmake alone, 'kay". > Are you saying one shouldn't use fine features such as Lazy Evaluation of Variables, Looping Facilities such as $(foreach), Powerful Ways of Manipulating Text (I'm quoting `info make' - that's it's title to functions such as $(firstword)), and the Advanced Macro Definitions (reverse = $2 $1)? I can't imagine a reason for such hostility. -- The fastest way to be done with dinner is to NOT clean the kitchen. If you don't, a mess builds up. To make dinner you have to work through the dirty pans, cutting off the dried on spaghetti, and melting the hardened peanut butter. But eventually you will eat dinner. And STILL the fastest way to be done with dinner is to NOT clean the kitchen.There's stuff above here
Generated at 16:01 on 20 Nov 2006 by mariachi 0.52