[1403] in Kerberos_V5_Development

home help back first fref pref prev next nref lref last post

Re: ADDENDUM: Re: build system redesign ideas

daemon@ATHENA.MIT.EDU (Barry Jaspan)
Tue Jul 16 15:35:19 1996

Date: Tue, 16 Jul 96 15:34:54 -0400
From: "Barry Jaspan" <bjaspan@MIT.EDU>
To: tlyu@MIT.EDU
Cc: epeisach@MIT.EDU, tytso@MIT.EDU, eichin@MIT.EDU, qjb@netrail.net,
        tlyu@MIT.EDU, krbdev@MIT.EDU
In-Reply-To: <199607161704.NAA23694@dragons-lair.MIT.EDU> (message from Tom Yu
	on Tue, 16 Jul 1996 13:04:07 -0400)


       Ezra> I have not yet looked at what Jay is suggesting, but maybe
       Ezra> we can develop a set of rules that wconfig can deal with and
       Ezra> parse....

   From what I have seen, the OV "expand" hack is something like...

Tom is basically right about the syntax.  Here's a better example:

PROG	= foo
SRCS	= foo.c bar.c
OBJS	= foo.o bar.o
LIBS	= -lgssapi_krb5 -lkrb5 ...

expand Program

PROG = foo.rsa
LIBS	= -lgssapi_rsa -lrsaref ...

expand Program

This gives you targets for foo, foo.rsa, all:: foo foo.rsa, depend,
clean, etc.  Basically "expand Program" it is exactly like an imake
macro except it takes values from make variables instead of as lexical
arguments, and it doesn't use cpp.

   The problem with this is that the same variables have to be set
   multiple times if the macro gets expanded in different places with
   different "parameters".

That's true.  However, Tom did not mention that we also added a
command-like argument, -X, to gmake that recursively expands all the
"expand" macros all the way to constant strings and outputs the
Makefile.  For example, if you did gmake -X on the above example, you
could get something like

all:: foo

foo: foo.o bar.o
	gcc -o foo foo.o bar.o -lgssapi_krb5 -lkrb5

<similar for foo.rsa>

in other words, *all* variable references in the expanded macro are
expanded; thus, the Makefile can be parsed as a normal Makefile.

When I explained this to Tom and Ted, they still disliked the fact
that it was possible to set a variable multiple times in a Makefile,
and that the right thing would not happen once the Makefile was
expanded.  However, it turns out this isn't a problem.  If you use a
variable that you set multiple times outside of the expand keyword,
gmake breaks just like every other make will break.  Thus, any
gmakefile that works and it converted with gmake -X will work as a
standard Makefile (it may be necessary to strip out other gmake
commands like "export", or just not use them).

In summary, if you can parse a standard makefile into something that
Windows can understand, then you can parse a gmake+expand makefile
into something that Windows can understand.

Barry



home help back first fref pref prev next nref lref last post