Re: [Vala] Rules for updating generated C files



Hi Rob,

On Tue, 2010-06-08 at 13:36 -0700, Robert Powell wrote:
On Tue, Jun 8, 2010 at 1:23 PM, Jan Hudec <bulb ucw cz> wrote:

On Thu, Jun 03, 2010 at 14:13:01 -0700, Robert Powell wrote:
If a member variable is added to BaseClass, BaseClass.vapi will change.
 The
C file that is generated from Derived.vala will be identical, but it
needs
to be recompiled because the base class has changed.  valac will not
regenerate Derived.c because it hasn't changed.

The Makefile in your example is hopelessly broken. Derived.c has not
changed,
but it certainly includes BaseClass.h which must have had. The makefile
fails
to see that Derived.o depends on BaseClass.h and the fix should be to make
the makefile directly aware of the fact.


You snipped the important bit "For this simple system, it would be easy
enough to update the makefile to watch for this dependency."  It was meant
to illuminate the fact that when systems get larger, trying to maintain
dependencies becomes terribly complicated.  I suggested a solution for the
problem.  Does anyone have any better suggestions (other than use
automake--automake is not an option for our projects here) for dealing with
larger systems?

You could use a similar approach and use gcc -M or makedepend to
generate Makefile rules describing header file dependencies. The
Makefiles would certainly get a bit more complicated but it should be
possible and not require manual dependency maintenance. If that's
possible, I'd prefer to keep the simple update logic we currently have
in valac.

Jürg




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]