Now that the version.h file was getting properly regenerated every time the svn

revision changed, every module that used the version was getting rebuilt after
every svn update.  This severly annoyed me pretty quickly, so I have improved
the situation.

Now, instead of generating version.h, main/version.c is generated.  version.c
includes the version information, as well as a couple of API calls for modules
to retrieve the version.  So now, only version.c will get rebuilt, and the main
asterisk binary relinked, which is must faster than rebuilding http.c, manager.c,
asterisk.c, relinking the asterisk binary, chan_sip.c, func_version.c, res_agi ...

The only minor change in behavior here is that the version information reported by
chan_sip, for example, is the version of the Asterisk core, and not necessarily the
Asterisk version that the chan_sip module came from.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@96717 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2008-01-05 22:09:06 +00:00
parent 3e28c57081
commit 54bc2c20b6
11 changed files with 108 additions and 52 deletions

View File

@@ -372,7 +372,7 @@ makeopts.embed_rules: menuselect.makeopts
@$(MAKE) $(PRINT_DIR) $(MOD_SUBDIRS_EMBED_LDFLAGS)
@$(MAKE) $(PRINT_DIR) $(MOD_SUBDIRS_EMBED_LIBS)
$(SUBDIRS): include/asterisk/version.h include/asterisk/build.h include/asterisk/buildopts.h defaults.h makeopts.embed_rules
$(SUBDIRS): main/version.c include/asterisk/build.h include/asterisk/buildopts.h defaults.h makeopts.embed_rules
ifeq ($(findstring $(OSARCH), mingw32 cygwin ),)
# Non-windows:
@@ -403,8 +403,8 @@ defaults.h: makeopts
@cmp -s $@.tmp $@ || mv $@.tmp $@
@rm -f $@.tmp
include/asterisk/version.h:
@build_tools/make_version_h > $@.tmp
main/version.c:
@build_tools/make_version_c > $@.tmp
@cmp -s $@.tmp $@ || mv $@.tmp $@
@rm -f $@.tmp
@@ -427,7 +427,7 @@ $(SUBDIRS_DIST_CLEAN):
clean: $(SUBDIRS_CLEAN)
rm -f defaults.h
rm -f include/asterisk/build.h
rm -f include/asterisk/version.h
rm -f main/version.c
@$(MAKE) -C menuselect clean
cp -f .cleancount .lastclean
@@ -695,7 +695,7 @@ spec:
rpm: __rpm
__rpm: include/asterisk/version.h include/asterisk/buildopts.h spec
__rpm: main/version.c include/asterisk/buildopts.h spec
rm -rf /tmp/asterisk ; \
mkdir -p /tmp/asterisk/redhat/RPMS/i386 ; \
$(MAKE) DESTDIR=/tmp/asterisk install ; \
@@ -820,4 +820,4 @@ pdf: asterisk.pdf
asterisk.pdf:
$(MAKE) -C doc/tex asterisk.pdf
.PHONY: menuselect main sounds clean dist-clean distclean all prereqs cleantest uninstall _uninstall uninstall-all pdf dont-optimize $(SUBDIRS_INSTALL) $(SUBDIRS_DIST_CLEAN) $(SUBDIRS_CLEAN) $(SUBDIRS_UNINSTALL) $(SUBDIRS) $(MOD_SUBDIRS_EMBED_LDSCRIPT) $(MOD_SUBDIRS_EMBED_LDFLAGS) $(MOD_SUBDIRS_EMBED_LIBS) include/asterisk/version.h
.PHONY: menuselect main sounds clean dist-clean distclean all prereqs cleantest uninstall _uninstall uninstall-all pdf dont-optimize $(SUBDIRS_INSTALL) $(SUBDIRS_DIST_CLEAN) $(SUBDIRS_CLEAN) $(SUBDIRS_UNINSTALL) $(SUBDIRS) $(MOD_SUBDIRS_EMBED_LDSCRIPT) $(MOD_SUBDIRS_EMBED_LDFLAGS) $(MOD_SUBDIRS_EMBED_LIBS) main/version.c