From: Mike Frysinger Date: Sun, 17 Jan 2021 11:16:38 +0000 (-0500) Subject: sim: common: simplify version script X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f89f33e57c69e830980fbed4420883f678d2f47c;p=binutils-gdb.git sim: common: simplify version script We don't use the host & target aliases, so don't bother emitting them. --- diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index beca012b601..8ab1c903fff 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,9 @@ +2021-01-18 Mike Frysinger + + * 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 * configure, configure.ac, Makefile.in: Delete. diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in index 6e719304430..8740a4a079e 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 5252c3b8bd8..7b35e87e215 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}"