Changeset 1324 for trunk


Ignore:
Timestamp:
Jan 23, 2011, 2:40:47 AM (10 years ago)
Author:
Peter Johansson
Message:

lift out revision number to a separate file 'lib/.revision' and then build subversion_info.cc based on this file and subversion_info.cc.in.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Makefile.am

    r1308 r1324  
    6060  html_utility.cc LineTypeParser.cc main_utility.cc Node.cc \
    6161  NodeCounter.cc OptionVersion.cc \
    62   rmdirhier.cc Stats.cc StatsCollection.cc subversion_info.cc SVN.cc \
     62  rmdirhier.cc Stats.cc StatsCollection.cc SVN.cc \
    6363  SVNblame.cc SVNdiff.cc SVNinfo.cc \
    6464  SVNlog.cc SVNproperty.cc TinyStats.cc \
    6565  Trac.cc utility.cc Vector.cc
    6666
     67nodist_libsvndigest_core_a_SOURCES = subversion_info.cc
    6768
    6869
     
    7374all-local:
    7475
     76EXTRA_DIST = subversion_info.cc.in .revision
     77CLEANFILES = subversion_info.cc
     78
    7579if HAVE_SVN_WC
    76 $(srcdir)/subversion_info.cc: subversion_info.cc.tmp
    77   @$(MOVE_IF_CHANGE) subversion_info.cc.tmp $@
    78 
    79 subversion_info.cc.tmp: FORCE
    80   @echo '// subversion_info.cc generated from subversion_info.cc.in.' > $@ ;\
    81   revision=$(SVN_REVISION);\
    82   $(SED) -e 's/sub_2_svn_revision/r'$$revision'/g' \
    83   $(srcdir)/subversion_info.cc.in >> $@ ;
    84 
     80$(srcdir)/.revision: FORCE
     81  @$(SVNVERSION) $(top_srcdir) > $@-t && $(MOVE_IF_CHANGE) $@-t $@
    8582else
    86 # this is needed in 'svn export' build
    87 $(srcdir)/subversion_info.cc:
    88   $(SED) -e 's/sub_2_svn_revision//g' \
    89   $(srcdir)/subversion_info.cc.in >> $@ ;
    90 
     83## this is needed in 'svn export' build
     84$(srcdir)/.revision:
     85  echo "" > $@
    9186endif
    9287
     88subversion_info.cc: $(srcdir)/subversion_info.cc.in $(srcdir)/.revision
     89  @rm -f $@-t $@ && \
     90  { revision=`cat $(srcdir)/.revision`; \
     91    echo '// DO NOT EDIT! GENERATED AUTOMATICALLY!' && \
     92    $(SED) -e 's/sub_2_svn_revision/r'$$revision'/g' \
     93    < $(srcdir)/subversion_info.cc.in; \
     94  } > $@-t && mv $@-t $@
     95
    9396FORCE:
Note: See TracChangeset for help on using the changeset viewer.