aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorStefan Weil <weil@mail.berlios.de>2009-12-20 15:39:03 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2010-01-08 09:58:40 -0600
commit012f0879234b07ec6a35eb6ec3c9d19000643155 (patch)
tree4756f14a66ba411fd096b18f51c96048fddff77d /Makefile
parent076d247142c1ff1e4d618557fc0acc62f6eb2a7c (diff)
Makefile: Update unmodified config-devices.mak automatically
This makes rebuilds after source updates easier for most users (who don't edit config-devices.mak). Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 15 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 1f284aead4..20c4e56e21 100644
--- a/Makefile
+++ b/Makefile
@@ -42,12 +42,22 @@ config-all-devices.mak: $(SUBDIR_DEVICES_MAK)
%/config-devices.mak: default-configs/%.mak
$(call quiet-command,cat $< > $@.tmp, " GEN $@")
- @if test -f $@ ; then \
- echo "WARNING: $@ out of date." ;\
- echo "Run \"make defconfig\" to regenerate." ; \
- rm $@.tmp ; \
+ @if test -f $@; then \
+ if cmp -s $@.old $@ || cmp -s $@ $@.tmp; then \
+ mv $@.tmp $@; \
+ cp -p $@ $@.old; \
+ else \
+ if test -f $@.old; then \
+ echo "WARNING: $@ (user modified) out of date.";\
+ else \
+ echo "WARNING: $@ out of date.";\
+ fi; \
+ echo "Run \"make defconfig\" to regenerate."; \
+ rm $@.tmp; \
+ fi; \
else \
- mv $@.tmp $@ ; \
+ mv $@.tmp $@; \
+ cp -p $@ $@.old; \
fi
defconfig: