Subject: Re: Dynamically created kernel .c files
To: None <david@l8s.co.uk>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: tech-toolchain
Date: 06/02/2007 21:48:11
david@l8s.co.uk wrote:

> > > I've been wondering if there is an easy way to dynamically create
> > > .c files for the kernel build?
> > > 
> > > In particular compat/svr4/svr4_stream.c can be created from
> > > compat/svr4_32/svr4_32_stream.c with a 'simple' sed command, and it
> > > seems rather a shame to have to keep two 2000 line files in sync.
> > > 
> > > The makefile rule would be easy, but where would it be added ?
> > 
> > I think it looks better to have a script like sys/kern/makesyscalls.sh
> > and sys/kern/Makefile then "update a base file and regen others"
> > rather than creating them dynamically on each kernel build.
> 
> Why, I'd rather go the other way....

To avoid complicated Makefiles?

If generated files always have the same contents
unless base files are updated, it should be generated
before commit (as pcidevs, syscalls.master etc).

If generated files depend on each config setting (like assym.h),
it's fine to generate them on each build.

Any other reason to do it dynamically on each kernel build?
---
Izumi Tsutsui