Skip to content

Commit 3a51ff3

Browse files
Vladimir Kondratievmasahir0y
authored andcommitted
kbuild: gitignore output directory
When compiling into output directory using O=, many files created under KBUILD_OUTPUT that git considers as new ones; git clients, ex. "git gui" lists it, and it clutters file list making it difficult to see what was really changed Generate .gitignore in output directory that ignores all its content Signed-off-by: Vladimir Kondratiev <vladimir.kondratiev@linux.intel.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
1 parent 4f1c100 commit 3a51ff3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,10 +483,13 @@ PHONY += outputmakefile
483483
# outputmakefile generates a Makefile in the output directory, if using a
484484
# separate output directory. This allows convenient use of make in the
485485
# output directory.
486+
# At the same time when output Makefile generated, generate .gitignore to
487+
# ignore whole output directory
486488
outputmakefile:
487489
ifneq ($(KBUILD_SRC),)
488490
$(Q)ln -fsn $(srctree) source
489491
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile $(srctree)
492+
$(Q){ echo "# this is build directory, ignore it"; echo "*"; } > .gitignore
490493
endif
491494

492495
ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),)

0 commit comments

Comments
 (0)