1# SPDX-License-Identifier: GPL-2.0
2# ==========================================================================
3# Cleaning up
4# ==========================================================================
5
6clean::
7
8include $(BASEDIR)/scripts/Kbuild.include
9
10include Makefile
11
12# Figure out what we need to clean from the various variables
13# ==========================================================================
14subdir-all := $(subdir-y) $(subdir-n) $(subdir-) \
15              $(filter %/, $(obj-y) $(obj-n) $(obj-))
16
17DEPS_RM = $(DEPS) $(DEPS_INCLUDE)
18.PHONY: clean
19clean:: $(addprefix _clean_, $(subdir-all))
20	rm -f *.o .*.o.tmp *~ core $(DEPS_RM)
21
22# Descending
23# ---------------------------------------------------------------------------
24
25_clean_%/: FORCE
26	$(MAKE) $(clean) $*
27
28# Force execution of pattern rules (for which PHONY cannot be directly used).
29.PHONY: FORCE
30FORCE:
31