[Scummvm-devel] Small source restructuring
Marcus Comstedt
marcus at mc.pp.se
Mon Feb 13 09:36:06 CET 2006
David Given <dg at cowlark.com> writes:
> If you'e a HAVE_CONFIG_H person then it'll rebuild in.c whenever config.h
> changes, of course.
That's exactly what I want to get away from. I don't want every file
and its brother depending on "config.h" so that 2000 files get rebuild
when a single config changes that only a few files care about anyway...
I'd much prefer simply having the build tool inserting the -Dwhatever
that is needed for each file, and not have any generated source files
at all.
That your tool can keep track of the fact that a file needs to be
rebuilt when the CFLAGS change is indeed useful to get to that point,
but there are several steps missing:
1) Some mechanism is needed to determine whether HAVE_BLAHA_H should
be set or not for the target at hand
2) Another mechanism needs to figure out what macros each file depends
on
3) The information from 1) and 2) need to be combined in such a way
that -DHAVE_BLAHA_H is included in CFLAGS when building foo.c iff
the target has the feature "BLAHA_H" _and_ foo.c depends on
HAVA_BLAHA_H.
In particular 3) would have to be built into the system somehow.
The other two could reasonably be implemented by stand-alone tools.
> If you want a look, there's a very simple application that uses it available
> here:
>
> http://tack.sourceforge.net/
>
> You want LLgen, not the complete compiler suite. However, there's no
> documentation as yet. (It's not really released.)
Ok, thanks. Or maybe "tack" (thanks in Swedish) would be more
appropriate. :-)
I suppose any further discussion should be held in private mail as
we have got rather OT for the ScummVM list now...
// Marcus
More information about the Scummvm-devel
mailing list