[Gambas-user] trunk_version.h

Tobias Boege tobs at taboege.de
Sun Feb 20 17:02:38 CET 2022


On Sun, 20 Feb 2022, Bruce Steers wrote:
> I have been searching (I'm sure i found it once) for the routine that
> creates/updates the trunk_version.h file in /main
> 
> The reason is i often do not use the ./reconf-all or ./configure commands
> when compiling and just run make / make install as it's quicker and the
> type of update did not require the full reconf.
> 
> But now i have noticed just running make install does not update
> trunk_version.h so gbx3 -V shows the wrong thing.
> 
> So i want to move/copy the routine that creates trunk_version.h to the make
> install if i can.
> 

The source code is in main/Makefile.in and from there the configure process
writes it into the Makefile. As you can see, it is part of BUILT_SOURCES and
therefore a (.PHONY) prerequisite of the "all" target. That means that the
file should *always* be regenerated when you run "make".

The header is updated whenever the current git HEAD changes and this causes
gbx.c and gbc.c to need recompilation because they include the header and,
in turn, make install will do this recompilation if it needs to happen.
This makes the trunk_version.h updates as consistent as it gets, but of
course you have to run "make" under main/. Without attempting to recompile
the compiler/interpreter, the version tag displayed in the IDE cannot change.

When working on a non-main component of Gambas (e.g. under comp/), one can
easily forget to recompile and reinstall main/, but that's where the version
is stored.

Best,
Tobias

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk


More information about the User mailing list