Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mike Frysinger via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Subject: [PATCH/committed v2] sim: common: simplify version script
Date: Mon, 18 Jan 2021 12:27:37 -0500	[thread overview]
Message-ID: <20210118172737.2800-1-vapier@gentoo.org> (raw)
In-Reply-To: <20210118095726.GO265215@embecosm.com>

We don't use the host & target aliases, so don't bother emitting them.
---
 sim/common/ChangeLog         |  6 ++++++
 sim/common/Make-common.in    |  5 +++--
 sim/common/create-version.sh | 17 ++++++-----------
 3 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index beca012b601f..8ab1c903fff5 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,9 @@
+2021-01-18  Mike Frysinger  <vapier@gentoo.org>
+
+	* Make-common.in (version.c): Simplifiy args and call move-if-change.
+	* create-version.sh: Delete host & target alias logic.  Write to the
+	output directly.
+
 2021-01-18  Mike Frysinger  <vapier@gentoo.org>
 
 	* configure, configure.ac, Makefile.in: Delete.
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 6e7193044305..8740a4a079e7 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -291,8 +291,9 @@ stamp-tvals: gentmap
 	touch stamp-tvals
 
 version.c: Makefile $(srcroot)/gdb/version.in $(srcroot)/bfd/version.h $(srcroot)/sim/common/create-version.sh
-	$(SHELL) $(srcroot)/sim/common/create-version.sh $(srcroot)/gdb \
-	    $(host_alias) $(target_alias) version.c
+	$(SHELL) $(srcroot)/sim/common/create-version.sh $(srcroot)/gdb $@.tmp
+	$(SHELL) $(srcroot)/move-if-change $@.tmp $@
+	touch $@
 
 #
 # Rules for building sim-* components.  Triggered by listing the corresponding
diff --git a/sim/common/create-version.sh b/sim/common/create-version.sh
index 5252c3b8bd80..7b35e87e2150 100755
--- a/sim/common/create-version.sh
+++ b/sim/common/create-version.sh
@@ -23,16 +23,11 @@
 #        TARGET_ALIAS OUTPUT-FILE-NAME
 
 srcdir="$1"
-host_alias="$2"
-target_alias="$3"
-output="$4"
+output="$2"
 
-rm -f version.c-tmp $output version.tmp
 date=`sed -n -e 's/^.* BFD_VERSION_DATE \(.*\)$/\1/p' $srcdir/../bfd/version.h`
-sed -e "s/DATE/$date/" < $srcdir/version.in > version.tmp
-echo '#include "version.h"' >> 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 $output
-rm -f version.tmp
+ver=`sed -e "s/DATE/$date/;q" $srcdir/version.in`
+(
+echo '#include "version.h"'
+echo 'const char version[] = "'"${ver}"'";'
+) >"${output}"
-- 
2.28.0


  reply	other threads:[~2021-01-18 17:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-17 11:19 [PATCH] " Mike Frysinger via Gdb-patches
2021-01-18  9:57 ` Andrew Burgess
2021-01-18 17:27   ` Mike Frysinger via Gdb-patches [this message]
2021-01-19  9:29     ` [PATCH/committed v2] " Sebastian Huber
2021-01-19 15:55       ` Mike Frysinger via Gdb-patches
2021-01-20  5:22         ` Sebastian Huber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210118172737.2800-1-vapier@gentoo.org \
    --to=gdb-patches@sourceware.org \
    --cc=vapier@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox