+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.
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
# 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}"