This goes towards making libgo more self-contained.
From-SVN: r218198
echo 'const theVersion = "'`$(GOC) --version | sed 1q`'"' >> version.go.tmp
echo 'const theGoarch = "'$(GOARCH)'"' >> version.go.tmp
echo 'const theGoos = "'$(GOOS)'"' >> version.go.tmp
- $(SHELL) $(srcdir)/../move-if-change version.go.tmp version.go
+ $(SHELL) $(srcdir)/mvifdiff.sh version.go.tmp version.go
$(STAMP) $@
go_sort_files = \
rm -f libcalls.go.tmp
files=`echo $^ | sed -e 's/libcalls-list//' -e 's|[^ ]*go/syscall/mksyscall.awk||'`; \
$(AWK) -f $(srcdir)/go/syscall/mksyscall.awk $${files} > libcalls.go.tmp
- $(SHELL) $(srcdir)/../move-if-change libcalls.go.tmp libcalls.go
+ $(SHELL) $(srcdir)/mvifdiff.sh libcalls.go.tmp libcalls.go
$(STAMP) $@
libcalls-list: s-libcalls-list; @true
s-libcalls-list: Makefile
rm -f libcalls-list.tmp
echo $(go_base_syscall_files) > libcalls-list.tmp
- $(SHELL) $(srcdir)/../move-if-change libcalls-list.tmp libcalls-list
+ $(SHELL) $(srcdir)/mvifdiff.sh libcalls-list.tmp libcalls-list
$(STAMP) $@
syscall_arch.go: s-syscall_arch; @true
echo "package syscall" > syscall_arch.go.tmp
echo 'const ARCH = "'$(GOARCH)'"' >> syscall_arch.go.tmp
echo 'const OS = "'$(GOOS)'"' >> syscall_arch.go.tmp
- $(SHELL) $(srcdir)/../move-if-change syscall_arch.go.tmp syscall_arch.go
+ $(SHELL) $(srcdir)/mvifdiff.sh syscall_arch.go.tmp syscall_arch.go
$(STAMP) $@
sysinfo.go: s-sysinfo; @true
s-sysinfo: $(srcdir)/mksysinfo.sh config.h
CC="$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OSCFLAGS)" $(SHELL) $(srcdir)/mksysinfo.sh
- $(SHELL) $(srcdir)/../move-if-change tmp-sysinfo.go sysinfo.go
+ $(SHELL) $(srcdir)/mvifdiff.sh tmp-sysinfo.go sysinfo.go
$(STAMP) $@
# The epoll struct has an embedded union and is packed on x86_64,
exit 1; ;; \
esac
echo '}' >> epoll.go.tmp
- $(SHELL) $(srcdir)/../move-if-change epoll.go.tmp epoll.go
+ $(SHELL) $(srcdir)/mvifdiff.sh epoll.go.tmp epoll.go
$(STAMP) $@
if LIBGO_IS_LINUX
echo 'const theVersion = "'`$(GOC) --version | sed 1q`'"' >> version.go.tmp
echo 'const theGoarch = "'$(GOARCH)'"' >> version.go.tmp
echo 'const theGoos = "'$(GOOS)'"' >> version.go.tmp
- $(SHELL) $(srcdir)/../move-if-change version.go.tmp version.go
+ $(SHELL) $(srcdir)/mvifdiff.sh version.go.tmp version.go
$(STAMP) $@
libcalls.go: s-libcalls; @true
rm -f libcalls.go.tmp
files=`echo $^ | sed -e 's/libcalls-list//' -e 's|[^ ]*go/syscall/mksyscall.awk||'`; \
$(AWK) -f $(srcdir)/go/syscall/mksyscall.awk $${files} > libcalls.go.tmp
- $(SHELL) $(srcdir)/../move-if-change libcalls.go.tmp libcalls.go
+ $(SHELL) $(srcdir)/mvifdiff.sh libcalls.go.tmp libcalls.go
$(STAMP) $@
libcalls-list: s-libcalls-list; @true
s-libcalls-list: Makefile
rm -f libcalls-list.tmp
echo $(go_base_syscall_files) > libcalls-list.tmp
- $(SHELL) $(srcdir)/../move-if-change libcalls-list.tmp libcalls-list
+ $(SHELL) $(srcdir)/mvifdiff.sh libcalls-list.tmp libcalls-list
$(STAMP) $@
syscall_arch.go: s-syscall_arch; @true
echo "package syscall" > syscall_arch.go.tmp
echo 'const ARCH = "'$(GOARCH)'"' >> syscall_arch.go.tmp
echo 'const OS = "'$(GOOS)'"' >> syscall_arch.go.tmp
- $(SHELL) $(srcdir)/../move-if-change syscall_arch.go.tmp syscall_arch.go
+ $(SHELL) $(srcdir)/mvifdiff.sh syscall_arch.go.tmp syscall_arch.go
$(STAMP) $@
sysinfo.go: s-sysinfo; @true
s-sysinfo: $(srcdir)/mksysinfo.sh config.h
CC="$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OSCFLAGS)" $(SHELL) $(srcdir)/mksysinfo.sh
- $(SHELL) $(srcdir)/../move-if-change tmp-sysinfo.go sysinfo.go
+ $(SHELL) $(srcdir)/mvifdiff.sh tmp-sysinfo.go sysinfo.go
$(STAMP) $@
# The epoll struct has an embedded union and is packed on x86_64,
exit 1; ;; \
esac
echo '}' >> epoll.go.tmp
- $(SHELL) $(srcdir)/../move-if-change epoll.go.tmp epoll.go
+ $(SHELL) $(srcdir)/mvifdiff.sh epoll.go.tmp epoll.go
$(STAMP) $@
@go_include@ bufio.lo.dep
--- /dev/null
+#!/bin/sh
+
+# Copyright 2014 The Go Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file.
+
+# The mvifdiff.sh script works like the mv(1) command, except
+# that it does not touch the destination file if its contents
+# are the same as the source file.
+
+if cmp -s "$1" "$2" ; then
+ rm "$1"
+else
+ mv "$1" "$2"
+fi