This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v3] don't keep a gdb-specific date
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 20 Jun 2013 18:57:42 +0100
- Subject: Re: [PATCH v3] don't keep a gdb-specific date
- References: <1371747149-9423-1-git-send-email-tromey at redhat dot com>
On 06/20/2013 05:52 PM, Tom Tromey wrote:
> diff --git a/gdb/Makefile.in b/gdb/Makefile.in
> index a6336a2..924bd78 100644
> --- a/gdb/Makefile.in
> +++ b/gdb/Makefile.in
> @@ -791,7 +791,7 @@ i386bsd-nat.h xml-support.h xml-tdesc.h alphabsd-tdep.h gdb_obstack.h \
> ia64-tdep.h ada-lang.h ada-varobj.h varobj.h frv-tdep.h nto-tdep.h serial.h \
> c-lang.h d-lang.h go-lang.h frame.h event-loop.h block.h cli/cli-setshow.h \
> cli/cli-decode.h cli/cli-cmds.h cli/cli-dump.h cli/cli-utils.h \
> -cli/cli-script.h macrotab.h symtab.h version.h \
> +cli/cli-script.h macrotab.h symtab.h common/version.h \
> gnulib/import/string.in.h gnulib/import/str-two-way.h \
> gnulib/import/stdint.in.h remote.h remote-notif.h gdb.h sparc-nat.h \
> gdbthread.h dwarf2-frame.h dwarf2-frame-tailcall.h nbsd-nat.h dcache.h \
> @@ -1420,13 +1420,16 @@ $(srcdir)/copying.c: @MAINTAINER_MODE_TRUE@ $(srcdir)/../COPYING3 $(srcdir)/copy
> < $(srcdir)/../COPYING3 > $(srcdir)/copying.tmp
> mv $(srcdir)/copying.tmp $(srcdir)/copying.c
>
> -version.c: Makefile version.in
> - rm -f version.c-tmp version.c
> +version.c: Makefile common/version.in $(srcdir)/../bfd/version.h
> + rm -f version.c-tmp version.c version.tmp
> + date=`sed -n -e 's/^.* BFD_VERSION_DATE \(.*\)$$/\1/p' $(srcdir)/../bfd/version.h`; \
> + sed -e "s/DATE/$$date/" < $(srcdir)/common/version.in > version.tmp
> echo '#include "version.h"' >> version.c-tmp
> - echo 'const char version[] = "'"`sed q ${srcdir}/version.in`"'";' >> version.c-tmp
> + echo 'const char version[] = "'"`sed q version.tmp`"'";' >> version.c-tmp
> echo 'const char host_name[] = "$(host_alias)";' >> version.c-tmp
> echo 'const char target_name[] = "$(target_alias)";' >> version.c-tmp
> mv version.c-tmp version.c
> + rm -f version.tmp
When I suggested common/, I was imagining version.c/version.o would
be moved to common's Makefile as well. Except that I forgot there's
no such Makefile... :-P :-)
> diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
> index e8470a8..c1f2279 100644
> --- a/gdb/gdbserver/Makefile.in
> +++ b/gdb/gdbserver/Makefile.in
> @@ -389,12 +389,15 @@ am--refresh:
>
> force:
>
> -version.c: Makefile $(srcdir)/../version.in
> - rm -f version.c-tmp version.c
> +version.c: Makefile $(srcdir)/../common/version.in $(srcdir)/../../bfd/version.h
> + rm -f version.c-tmp version.c version.tmp
> + date=`sed -n -e 's/^.* BFD_VERSION_DATE \(.*\)$$/\1/p' $(srcdir)/../../bfd/version.h`; \
> + sed -e "s/DATE/$$date/" < $(srcdir)/../common/version.in > version.tmp
> echo '#include "server.h"' >> version.c-tmp
Can this be just version.h, like GDB's ?
> - echo 'const char version[] = "'"`sed q ${srcdir}/../version.in`"'";' >> version.c-tmp
> + echo 'const char version[] = "'"`sed q version.tmp`"'";' >> version.c-tmp
> echo 'const char host_name[] = "$(host_alias)";' >> version.c-tmp
> mv version.c-tmp version.c
> + rm -f version.tmp
> version.o: version.c $(server_h)
Then we could move all this shell code to a script under
common/ that would be called by both gdb and gdbserver. Or
a Makefile fragment that's sourced by both Makefiles with
the version.c rule (is the version.o rule in gdbserver still
necessary?). Anyway, please don't feel compelled to do that.
It can always be done afterwards. This version is already
super fine with me.
--
Pedro Alves