Commit f4ef1c53 authored by Orgad Shaneh's avatar Orgad Shaneh
Browse files

domd: Preserve Makefile time when it is unchanged



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: default avatarRich Salz <rsalz@openssl.org>
Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1370)
parent 7a9d7128
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -11,7 +11,9 @@ if [ "$1" = "-MD" ]; then
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 ||
@@ -32,9 +34,10 @@ else
    ${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