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-28 23:58:06
|
Hi David, At 5:36 AM -0400 7/26/06, David Given wrote: >[...] >> ROOTDIR = ROOTDIR or posix.getcwd().."/" >[...] >> cfile { >> CBUILDFLAGS = CBUILDFLAGS or "-static -Winline -O3", > >Right; there's a rather confusing issue here that I'm still trying to >come up with a clean way round it. Expressions such as 'a or b' are >evaluated when the pmfile is read. Variables in %...% statements are >looked up when the string is expanded. Your use of CBUILDFLAGS here will >work but will override any variables defined further up the call tree. That's ok, though, since I'm trying to leave an opening for specifying the flags on the command line using the -D flag from pm. If there are none specified, then use the ones listed as default. >(Variables, in CAPITAL LETTERS, are looked up via the call scope. >Properties, in lower case, are not.) There's an idiom you can use for >variable setting: > > CBUILDFLAGS = {PARENT, "-static", "-Winline", "-O3"}, > >This will cause the specified items to be apppended on to the list >defined by the clause's callers. I'm not sure exactly what the problem is, but this is not working for me: > ./pm -p -fpmfile.memcopy pm: creating new intermediate file cache in '.pm-cache/' cc "-g" "-static" "-Winline" "-O3" -MM -MG "~account/memcopy/main.c" > ".pm-cache/2-main.d" cc "-g" "-static" "-Winline" "-O3" -c -o ".pm-cache/1-main.o" "/home/lapd/dW/memcopy/main.c" cc "-g" "-static" "-Winline" "-O3" -MM -MG "~account/memcopy/fourbytes.s" > ".pm-cache/4-fourbytes.d" as -mregnames -o ".pm-cache/3-fourbytes.o" "~account/memcopy/fourbytes.s" cc "-g" "-static" "-Winline" "-O3" -MM -MG "~account/memcopy/sixteenbytes.s" > ".pm-cache/6-sixteenbytes.d" as -mregnames -o ".pm-cache/5-sixteenbytes.o" "~account/memcopy/sixteenbytes.s" ./.pm-exec-macppc: stdin:143: bad argument #1 to `?' (string expected, got table) stack traceback: [C]: ? stdin:143: in function `rendertable' (tail call): ? [C]: ? stdin:757: in function `__expand' stdin:1287: in function `__outputs' stdin:673: in function `__build' stdin:647: in function `__buildchildren' stdin:667: in function `__build' stdin:1546: in main chunk [C]: ? -- $Source: memcopy/pmfile,v $ -- $State: Exp $ include "c.pm" ROOTDIR = ROOTDIR or posix.getcwd().."/" local d = ROOTDIR OBJDIR = OBJDIR or d.."obj/" memcopy = cprogram { CBUILDFLAGS = {PARENT, "-static", "-Winline", "-O3"}, cfile { d.."main.c", }, afile { ASBUILDFLAGS = ASBUILDFLAGS or "-mregnames", d.."fourbytes.s", }, afile { ASBUILDFLAGS = ASBUILDFLAGS or "-mregnames", d.."sixteenbytes.s", }, outputs = {"%U%/memcopy"}, install = { pm.install("%OBJDIR%memcopy"), } } default = group { memcopy, } Working under the impression this was supposed to work and the problem is temporary or syntatic, can I do CBUILDFLAGS = CBUILDFLAGS or {PARENT, "-static", "-Winline", "-O3"} ? This actually builds, by the way, but does not seem to pick up the default. Additionally, can I specify from the command line a -DCBUILDFLAGS={PARENT, "-Winline", "-O3"} in case I want to override the defaults and not compile with static linking? >Example: > >memcopy = cprogram { > CBUILDFLAGS = {PARENT, "-static", "-Winline", "-O3"}, > ASBUILDFLAGS = {PARENT, "-mregnames"}, > > cfile (d.."main.c"), > afile (d.."fourbytes.s"), > afile (d.."sixteenbytes.s"), > > outputs = {"%U%/memcopy"}, > install = { > pm.install("%OBJDIR%memcopy"), > } >} > >The definitions of CBUILDFLAGS and ASBUILDFLAGS will be *appended* to >the defaults, and will apply to all clauses in the cprogram. Sure, the application of inheritence is logical and why I think pm is an easier tool to grasp than make. I think it will make it easier to build applications that build across OSes easier, instead of integrating against bsd.*.mk files and the like. It might require a bit more overhead in the form of the c.pm files and a possibly an included copy of pm, but I'm pretty frustrated with trying to track down integrated dependencies and I do _not_ find make's syntax to be particularly transparent. >[...] >> I added the choice of compilers because I think it is important to be able >> to have that choice. > >Yeah, the fact the pm only really likes gcc is an issue I need to deal >with --- the tricky part is the dependency generation, for which there >is no portable mechanism. I'm using gccisms. I may end up having to >write a dependency calculator in Lua and build it into c.pm. I think you should solve this. It is my suspicion that some (perhaps all) open source operating systems can't build on anything but the gcc toolchain, which I find to be...shortsighted. A build controller that can make it transparent to move to other compiler setups would be really cool and very likely embraced with enthusiasm. 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 |