>>> "Joel" == Joel E Denny <[EMAIL PROTECTED]> writes:

 > Sorry, I was agreeing with you by explaining what I thought to be the 
 > point of your suggestion.  That is, although the ChangeLog Id is only used 
 > in one file (getargs.c) right now, it might be used in others in the 
 > future.  If and when that happens, your approach will improve 
 > re-compilation time.  Did I get it?

If you wish :)  I was also considering the time of recompilation of
the file itself.  Maybe I'm biased: I'm using this approach in a C++
project where there's a huge different in compilation time needed to
compile the file that needs this Id as compared to compiling just this
sole variable definition.  Maybe that's overkill for Bison, in which
case your approach is simpler.


 > I was going to name them "changelog-id.h", "changelog-id.c", "const char 

I meant changelog-id.  Anyway, I personally use revision.c ;)


 >> case "$(VERSION)" in
 >> *+*) sed -n 's/^\$$\(Id.*\)\$$$$/const char *revision = "\1";/p' \
 >> $(top_srcdir)/ChangeLog
 >> ;;
 >> esac >$@

 > This doesn't handle the case of no `+'.  This works for me:

 > changelog-id.c: $(top_srcdir)/configure $(top_srcdir)/ChangeLog
 >         case "$(VERSION)" in \
 >           *+*) sed -n \
 >             's/^\$$\(Id.*\)\$$$$/const char *changelog_id = "\1\\n";/p' \
 >             $(top_srcdir)/ChangeLog \
 >             ;; \
 >           *) echo 'const char *changelog_id = "";' \
 >             ;; \
 >         esac >$@

Thanks.



Reply via email to