Commit 5b281f91 authored by Kai Germaschewski's avatar Kai Germaschewski

kbuild: Regenerate include/linux/version.h only if necessary

Before overwriting version.h, check if it actually changed - otherwise
we will unnecessarily rebuild a lot of files, as e.g. module.h depends
on version.h, and many files include module.h
parent b3434820
...@@ -11,4 +11,14 @@ SUBLEVEL=$5 ...@@ -11,4 +11,14 @@ SUBLEVEL=$5
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))' echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'
) > .tmpversion ) > .tmpversion
mv -f .tmpversion $TARGET # Only replace the real version.h if the new one is different
\ No newline at end of file # in order to preserve the timestamp and avoid unnecessary
# recompilations.
if [ -r $TARGET ] && \
cmp -s $TARGET .tmpversion; then
echo $TARGET is unchanged;
rm -f .tmpversion
else
mv -f .tmpversion $TARGET
fi
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment