* post.in (depend-postrecurse): Use it.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14289
dc483132-0cff-0310-8789-
dd5450dbe970
+2002-03-26 Ken Raeburn <raeburn@mit.edu>
+
+ * move-if-changed: New script.
+ * post.in (depend-postrecurse): Use it.
+
2002-01-08 Ken Raeburn <raeburn@mit.edu>
* shlib.conf: For Linux, always add "-lc" at the end of the link
--- /dev/null
+#!/bin/sh
+# Move file 1 to file 2 if they don't already match.
+# Good for "make depend" for example, where it'd be nice to keep the
+# old datestamp.
+if [ $# != 2 ]; then
+ echo 2>&1 usage: $0 newfile oldfilename
+ exit 1
+fi
+#
+if [ ! -r "$2" ]; then
+ exec mv -f "$1" "$2"
+fi
+if cmp "$1" "$2" >/dev/null; then
+ echo "$2 is unchanged"
+ exec rm -f "$1"
+fi
+exec mv -f "$1" "$2"
sed -e '/^# +++ Dependency line eater +++/,$$d' \
< $(srcdir)/Makefile.in | cat - .depend \
> $(srcdir)/Makefile.in.new; \
- $(MV) $(srcdir)/Makefile.in $(srcdir)/Makefile.in.old; \
- $(MV) $(srcdir)/Makefile.in.new $(srcdir)/Makefile.in; \
+ $(SRCTOP)/config/move-if-changed $(srcdir)/Makefile.in.new $(srcdir)/Makefile.in ; \
else :; fi
depend:: depend-prerecurse depend-recurse depend-postrecurse