Keith Owens <[EMAIL PROTECTED]>:
> The easiest option is to build an equivalent CML2 forest, containing
> links to its files then run CML2 under that forest.  Also define
> tmp_config_copyout-2 and tmp_config_copyback-2 routines to copy .config
> and other files to and from the forest.

Frankly, Keith, reading your description makes my head hurt.  I'd
rather not get involved in the details of how your makefiles manage
your shadow trees.  So instead let me explain CML2's interface to the
existing makefiles in enough detail that you can harness it yourself.

The compiler's interface is very simple.  It takes a top-level rulesfile
named on the commandline as input, and by default generates the compiled
rulebase to `rules.out' in the current directory (you can change the 
output location with the -o option).

The makefile production that handles this is:

# In some transitional Debian versions, the python2.0 binary is named python2
PYTHON2 = $(shell if [ -x "$$(which python2 2> /dev/null)" ]; then echo python2;else 
echo python; fi)

rules.out: $(shell find . -name "*cml")
        $(PYTHON2) -O scripts/cmlcompile.py rules.cml 

With this production you can just use rules.out as a requirement for the 
production that can run the configurator an the right thing will happen
automatically.

The configurator invocation is a bit trickier, basically because once its
output (config.out) is generated, there's a second translation step required
to turn it into CML1-compatible .config and autoconf.h

The production for make config is representative.  I'll add explanatory 
comments here.

config: symlinks rules.out
        # Use .config as a starting configuration if there is no config.out
        @-if [ -f .config -a ! -f config.out ]; then cp .config config.out; echo 
"Using .config"; fi
        # If even .config doesn't exist, use arch/$(ARCH)/defconfig
        @-if [ ! -f config.out ]; then cp arch/$(ARCH)/defconfig config.out; echo 
"Using defconfig"; fi
        # Read in base config using -i.  Use `rules.out' in the current 
        # directory as the rulebase.  Emit resylts to the default location,
        # config.out in the current directory.  (The other configurator
        # productions differ only in this line.)
        $(CONFIGURE) -D$(ARCHSYMBOL) -B $(KERNELRELEASE) -i config.out $(CONFIGOPTS) 
rules.out
        # Translate config.out into the requisite CML1 formats.
        $(PYTHON2) -O scripts/configtrans.py -h include/linux/autoconf.h -s .config 
config.out

I hope that's clear.
-- 
                <a href="http://www.tuxedo.org/~esr/";>Eric S. Raymond</a>

"The state calls its own violence `law', but that of the individual `crime'"
        -- Max Stirner

_______________________________________________
kbuild-devel mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/kbuild-devel

Reply via email to