|
From: <sv...@va...> - 2009-06-23 02:07:57
|
Author: njn Date: 2009-06-23 03:00:41 +0100 (Tue, 23 Jun 2009) New Revision: 10361 Log: Make it generate vex_svnversion.h correctly from a clean check-out. Modified: branches/BUILD_TWEAKS/Makefile.vex.am Modified: branches/BUILD_TWEAKS/Makefile.vex.am =================================================================== --- branches/BUILD_TWEAKS/Makefile.vex.am 2009-06-22 18:06:29 UTC (rev 10360) +++ branches/BUILD_TWEAKS/Makefile.vex.am 2009-06-23 02:00:41 UTC (rev 10361) @@ -63,25 +63,24 @@ # vex_svnversion.h #---------------------------------------------------------------------------- -# The contents ov vex_svnversion.h depends on the Vex revision number. The +# The contents of vex_svnversion.h depends on the Vex revision number. The # ideal way to deal with it would be if SVN had post-update hooks: we'd # generate/regenerate it every time we did "svn co"/"svn up", and otherwise # never delete it or regenerate it. # # But SVN lacks post-update hooks. So instead we generate it when building -# if it's not present, or if 'make version' is run. (Thus it can get +# (it's in BUILT_SOURCES) if it's not present (we test for that in the +# generation rule), or if 'make version' is run. (Thus it can get # out-of-date when developing; the 'make version' target lets that be -# remedied manually.) Otherwise, we never delete it or regenerate -# it. Furthermore, at 'make dist' time, we regenerate it, and copy it into -# the dist tarball, thus ensuring the distributed version is up-to-date. -# Note that if a user manually deletes it and rebuilds, or does 'make dist' -# from a distributed version, it will be regenerated incorrectly, containing -# the string "exported" instead of the SVN revision number. +# remedied manually.) Otherwise, we never delete it or regenerate it (in +# particular, it is not present in CLEANFILES). Furthermore, at 'make dist' +# time, we regenerate it, and copy it into the dist tarball, thus ensuring +# the distributed version is up-to-date. Note that if a user manually +# deletes it and rebuilds, or does 'make dist' from a distributed version, +# it will be regenerated incorrectly, containing the string "exported" +# instead of the SVN revision number. -# Note that we don't list it in BUILT_SOURCES, because then it would be -# regenerated post-distribution by 'make'. Nor do we list it in CLEANFILES, -# because then it would be deleted post-distribution by 'make clean' and -# thus regenerated by 'make'. +BUILT_SOURCES += priv/main/vex_svnversion.h # Generate it at build time if not present. Nb: generating a file and # putting it in $(srcdir) rather than $(builddir) seems like bad form. But @@ -91,7 +90,7 @@ if [ ! -f priv/main/vex_svnversion.h ] ; then \ mv $(top_srcdir)/vex_svnversion.h $(srcdir)/priv/main/; \ else \ - rm -f vex_svnversion.h; \ + rm -f $(top_srcdir)/vex_svnversion.h; \ fi # Regenerate it and copy it into the dist tarball at 'make dist' time. |