Kbuild fix for clean and mrproper targets.
This commit fixes the target clean functionality.
Originally, the clean and mrproper targets search for the
Documentation and samples directories and their respective
Makefiles.
Our current directory structure is not including Documentation
directory yet. Also, there is not support for a global Makefiles
at samples directory.
This commit deletes references to Documentation directories for
clean and mrproper targets as well.
Also, This commit deletes the reference to sample directory for
clean target.
Finally, this commit temporary fixes the references to assembly
files .s extensions. This has been marked as a BUG until all .s
files can be renamed to .S files.
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: I4c95c2eed4b5756843ecb9021d03401289522586
diff --git a/Makefile b/Makefile
index e3962a0..147bb82 100644
--- a/Makefile
+++ b/Makefile
@@ -975,7 +975,7 @@
prepare3: include/config/kernel.release
ifneq ($(KBUILD_SRC),)
@$(kecho) ' Using $(srctree) as source for kernel'
- $(Q)if [ -f $(srctree)/.config -o -d $(srctree)/include/config ]; then \
+ $(Q)if [ -f $(srctree)/.config ]; then \
echo >&2 " $(srctree) is not clean, please run 'make mrproper'"; \
echo >&2 " in the '$(srctree)' directory.";\
/bin/false; \
@@ -1218,6 +1218,11 @@
# Directories & files removed with 'make clean'
CLEAN_DIRS += $(MODVERDIR)
+CLEAN_FILES += misc/generated/nodes/kernel_main.c \
+ misc/generated/nodes/microkernel_objects.h \
+ misc/generated/nodes/vxmicro.h \
+ misc/generated/nodes/prj.vpf
+
# Directories & files removed with 'make mrproper'
MRPROPER_DIRS += include/config usr/include include/generated \
arch/*/include/generated .tmp_objdiff
@@ -1231,7 +1236,7 @@
#
clean: rm-dirs := $(CLEAN_DIRS)
clean: rm-files := $(CLEAN_FILES)
-clean-dirs := $(addprefix _clean_, . $(vmlinux-alldirs) Documentation samples)
+clean-dirs := $(addprefix _clean_, . $(vmlinux-alldirs) )
PHONY += $(clean-dirs) clean archclean vmlinuxclean
$(clean-dirs):
@@ -1246,7 +1251,7 @@
#
mrproper: rm-dirs := $(wildcard $(MRPROPER_DIRS))
mrproper: rm-files := $(wildcard $(MRPROPER_FILES))
-mrproper-dirs := $(addprefix _mrproper_,Documentation/DocBook scripts)
+mrproper-dirs := $(addprefix _mrproper_,scripts)
PHONY += $(mrproper-dirs) mrproper archmrproper
$(mrproper-dirs):
@@ -1471,11 +1476,14 @@
scripts: ;
endif # KBUILD_EXTMOD
+#BUG [oas] regular expression is substituted by [oa] to ommit the removal
+# of .s files. This change can be undone once all .s files have been
+# renamed to .S files.
clean: $(clean-dirs)
$(call cmd,rmdirs)
$(call cmd,rmfiles)
@find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
- \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
+ \( -name '*.[oa]' -o -name '*.ko' -o -name '.*.cmd' \
-o -name '*.ko.*' \
-o -name '*.dwo' \
-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \