Index: Makefile.in =================================================================== --- Makefile.in (revision 27107) +++ Makefile.in (working copy) @@ -159,6 +159,18 @@ cp $(srcdir)/lex.c $@ && echo $@ copied.; \ fi +$(srcdir)/revision.h: + @exit > $@ + +$(REVISION_H): $(srcdir)/version.h $(srcdir)/ChangeLog revision.h.tmp $(REVISION_FORCE) + @if [ -f $(srcdir)/revision.h ] && \ + { [ ! -s revision.h.tmp ] || cmp $(srcdir)/revision.h revision.h.tmp >/dev/null; }; then \ + $(RM) revision.h.tmp; \ + else \ + mv -f revision.h.tmp $(srcdir)/revision.h; \ + fi + @exit > $@ + .y.c: $(YACC) $< sed '/^#/s|y\.tab\.c|$@|' y.tab.c > $@ Index: common.mk =================================================================== --- common.mk (revision 27107) +++ common.mk (working copy) @@ -482,24 +482,9 @@ dist: $(PROGRAM) $(RUNRUBY) $(srcdir)/distruby.rb -$(srcdir)/revision.h: - @exit > $@ - -$(REVISION_H): $(srcdir)/version.h $(srcdir)/ChangeLog revision.h.tmp $(REVISION_FORCE) - @if [ -f $(srcdir)/revision.h ] && \ - { [ ! -s revision.h.tmp ] || cmp $(srcdir)/revision.h revision.h.tmp >/dev/null; }; then \ - $(RM) revision.h.tmp; \ - else \ - mv -f revision.h.tmp $(srcdir)/revision.h; \ - fi - @exit > $@ - revision.h.tmp: $(REVISION_FORCE) @set LC_MESSAGES=C - -@{ cd "$(srcdir)" && $(SET_LC_MESSAGES) $(VCS) info | \ - sed -n \ - -e '/^URL:/{' -e '/\/trunk$$/d' -e 's!.*/\([^/][^/]*\)$$!#define RUBY_BRANCH_NAME "\1"!p' -e '}' \ - -e "s/.*Rev:/#define RUBY_REVISION/p"; } > "$@" + -@cd "$(srcdir)" && $(SET_LC_MESSAGES) $(VCS) info | sed -n -f "$(srcdir)/revision.sed" > "$@" -IF-NO-STRING-LITERAL-CONCATENATION-:: @{ \ echo '#include "$@"'; \ Index: revision.sed =================================================================== --- revision.sed (revision 0) +++ revision.sed (revision 0) @@ -0,0 +1,5 @@ +/^URL:/{ +:/trunk$:d +s:.*/\([^/]\+\)$:#define RUBY_BRANCH_NAME "\1":p +} +s/.*Rev:/#define RUBY_REVISION/p