Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] sim: common: simplify version script
@ 2021-01-17 11:19 Mike Frysinger via Gdb-patches
  2021-01-18  9:57 ` Andrew Burgess
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Frysinger via Gdb-patches @ 2021-01-17 11:19 UTC (permalink / raw)
  To: gdb-patches

We don't the host & target aliases, so don't bother emitting them.
---
 sim/common/Make-common.in    |  4 ++--
 sim/common/create-version.sh | 17 ++++++-----------
 2 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 6e7193044305..7de7dabe646f 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -291,8 +291,8 @@ 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 $@
 
 #
 # 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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-01-20  5:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-17 11:19 [PATCH] sim: common: simplify version script Mike Frysinger via Gdb-patches
2021-01-18  9:57 ` Andrew Burgess
2021-01-18 17:27   ` [PATCH/committed v2] " Mike Frysinger via Gdb-patches
2021-01-19  9:29     ` Sebastian Huber
2021-01-19 15:55       ` Mike Frysinger via Gdb-patches
2021-01-20  5:22         ` Sebastian Huber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox