also on systems with makedepend that does not report its version, or that
its version does not contain "gcc" or "clang".
Some versions of makedepends just overwrite Makefile. Preserve the
timestamp of the previous Makefile, and copy it back if it is unchanged.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1370)
fi
if [ "$MAKEDEPEND" = "" ]; then MAKEDEPEND=makedepend; fi
-cp Makefile Makefile.save
+# Preserve Makefile timestamp by moving instead of copying (cp -p is GNU only)
+mv Makefile Makefile.save
+cp Makefile.save Makefile
# fake the presence of Kerberos
touch $TOP/krb5.h
if ${MAKEDEPEND} --version 2>&1 | grep "clang" > /dev/null ||
${PERL} $TOP/util/clean-depend.pl < Makefile > Makefile.new
RC=$?
fi
-if ! cmp -s Makefile Makefile.new; then
+if ! cmp -s Makefile.save Makefile.new; then
mv Makefile.new Makefile
else
+ mv Makefile.save Makefile
rm -f Makefile.new
fi
# unfake the presence of Kerberos