Re: [Tack-devel] Prime Mover commands
Moved to https://github.com/davidgiven/ack
Brought to you by:
dtrg
From: tim k. <gt...@di...> - 2006-07-31 11:49:45
|
At 7:15 AM -0400 7/31/06, David Given wrote: >It's difficult to tell what's going on without seeing your code, but >have you defined ROOTDIR as local? Local variables in Lua are >fundamentally different things to global variables --- local variables >are lexically scoped, and included scripts execute in a different scope >and so won't see locals defined in the caller. I see the problem now. I had included the file that concatenates ROOTDIR before I had defined ROOTDIR. I was thinking the included pmfile (and its local variables) wouldn't be evaluated until the target it contains is built. >> local d = ROOTDIR.."lib/libsa/" > >Because ROOTDIR here is used in a Lua expression, it'll get evaluated >when the script is read, and so ROOTDIR must be defined before this line >is seen. OTOH, if you were to say "%ROOTDIR%lib/libsa/" instead, then >the %...% reference will only get expanded at the very last stage of >execution, and will be looked up in the call stack of the rules >currently being processed. So using the %..% notation it is possible to temporarily repoint global variables, and the actual value isn't used until the script actually executes, correct? >Sorry, pm doesn't necessarily have this information. However, if you >were to put: > >print(somerule.VARIABLENAME) >os.exit() Ok, I'm a little slow on the uptake. What should I use for "somerule?" When explaining stuff to me, it is advisable to speak slowly and explictly; otherwise I am likely to interpret what you say literally :-) >Put: > >pm.intermediatecache = "path" > >...in your pmfile. (The ACK config.pm does this.) Thanks! >[...] >> 4) Can I get some bare-bones description on differences between cfiles, >> cprograms, clibraries, and other possible options? > >cfile compiles a single .c file into a single .o file. clibrary builds >an ar archive out of its inputs. cprogram links all of its inputs >together into an executable. Thanks again! Can I specify a single cfile as a target, if it is only included in a larger group or cprogram? Or do I need to have it as a separate object? >If you look in the pm Subversion repository, I've just checked in a >bunch of test files in test-pmfiles and test-source --- you may find >these useful to look at. Excellent! I will do this. Is pm a top-level cvs module? thanks again! tim Gregory T. (tim) Kelly Owner Dialectronics.com P.O. Box 606 Newberry, SC 29108 "Anything war can do, peace can do better." -- Bishop Desmond Tutu |