Re: [Tack-devel] Prime Mover commands
Moved to https://github.com/davidgiven/ack
Brought to you by:
dtrg
From: David G. <dg...@co...> - 2006-07-26 10:15:20
|
tim kelly wrote: (about pmfiles) I'm impressed, given that the whole system is completely undocumented... [...] > ROOTDIR =3D ROOTDIR or posix.getcwd().."/" [...] > cfile { > CBUILDFLAGS =3D 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. (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 =3D {PARENT, "-static", "-Winline", "-O3"}, This will cause the specified items to be apppended on to the list defined by the clause's callers. Example: memcopy =3D cprogram { CBUILDFLAGS =3D {PARENT, "-static", "-Winline", "-O3"}, ASBUILDFLAGS =3D {PARENT, "-mregnames"}, cfile (d.."main.c"), afile (d.."fourbytes.s"), afile (d.."sixteenbytes.s"), outputs =3D {"%U%/memcopy"}, install =3D { 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. [...] > I added the choice of compilers because I think it is important to be a= ble > 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. [...] > (Gee, any thoughts of a Makefile->pmfile converter?) *twitch* --=20 +- David Given --McQ-+ "You cannot truly appreciate _Atlas Shrugged_ | dg...@co... | until you have read it in the original Klingon." | (dg...@ta...) | --- Sea Wasp on r.a.sf.w +- www.cowlark.com --+ |