Re: why make cleans for header changes


Subject: Re: why make cleans for header changes
From: Justin Bradford (justin@ukans.edu)
Date: Wed Mar 08 2000 - 22:02:07 CST


On Thu, 9 Mar 2000, Aaron Lehmann wrote:
> P.S. Why does Abi's build system require make cleans? Autoconf seems to
> work fine when header files are changed. Does autoconf work on all of the
> [non-MacOS] platforms you are targeting? I really don't like autoconf but
> it really beats making clean every time you want to make a small change to
> a header.

It's not necessary to make clean for all header changes, but if an object
definition or struct is changed, then the old compiled code is going to
have the wrong offset. For example:

 class foo {
  int size;
 };

is changed to:

 class foo {
  int score;
  int size;
 };

then the old code:

 fooInstance.size;

will really return score.

The code has to be recompiled to get the offsets right again, and the
easiest way to do that is to force a full rebuild.

There are other ways, though. We could make sure all of the makefiles have
the headers they use (including headers embedded in those headers, etc).
as dependencies. ie:

foo.cpp: foo.h bar.h xp_bar.h xp_foo.h xap_bar.h util.h ...

This would cause foo.cpp to be recompiled if the headers changed, so you
would never need to do a make clean. It would always update what you
needed.

That, however, would be a massively huge nightmare to try to maintain
(unless it was automated) and it's just easier to make clean.

Nice development environments figure out header dependencies for you,
automatically.

Justin



This archive was generated by hypermail 2b25 : Wed Mar 08 2000 - 22:02:29 CST