summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMasahiro Yamada2019-03-26 05:26:58 +0100
committerMasahiro Yamada2019-03-28 15:46:55 +0100
commit156e7cbb3ef50d6d58b7975d79802e4ffb024dc2 (patch)
treeef1b3074be5b09d0d294ef8190bf00ed39a818d9 /Makefile
parentkbuild: skip parsing pre sub-make code for recursion (diff)
downloadkernel-qcow2-linux-156e7cbb3ef50d6d58b7975d79802e4ffb024dc2.tar.gz
kernel-qcow2-linux-156e7cbb3ef50d6d58b7975d79802e4ffb024dc2.tar.xz
kernel-qcow2-linux-156e7cbb3ef50d6d58b7975d79802e4ffb024dc2.zip
kbuild: do not overwrite .gitignore in output directory
Commit 3a51ff344204 ("kbuild: gitignore output directory") seemed to bother people who version-control output directories. Andre Przywara says: "Unfortunately this breaks my setup, because I keep a totally separate git repository in my build directories to track (various versions of) .config. So .gitignore there is carefully crafted to ignore most build artefacts, but not .config, for instance." Link: https://lkml.org/lkml/2019/3/22/1819 Reported-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Tested-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile3
1 files changed, 2 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 3c788a65d652..2810425541f4 100644
--- a/Makefile
+++ b/Makefile
@@ -499,7 +499,8 @@ outputmakefile:
ifneq ($(KBUILD_SRC),)
$(Q)ln -fsn $(srctree) source
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile $(srctree)
- $(Q){ echo "# this is build directory, ignore it"; echo "*"; } > .gitignore
+ $(Q)test -e .gitignore || \
+ { echo "# this is build directory, ignore it"; echo "*"; } > .gitignore
endif
ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),)