mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-01-13 20:52:08 +01:00
Our last sync with the kernel was 5.1. We are so out of sync now, that tracking the patches and backporting them one by one makes little sense and it's going to take ages. This is an attempt to sync up Makefiles to 6.1. Unfortunately due to sheer amount of patches this is not easy to review, but that's what we decided during a community call for the bump to 5.1, so we are following the same guidelines here. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>a #rebased on -next
73 lines
2.0 KiB
Makefile
73 lines
2.0 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
# ==========================================================================
|
|
# Cleaning up
|
|
# ==========================================================================
|
|
|
|
src := $(obj)
|
|
|
|
PHONY := __clean
|
|
__clean:
|
|
|
|
# include scripts/Kbuild.include
|
|
include scripts/Kbuild.uboot
|
|
include scripts/Makefile.compiler
|
|
|
|
# The filename Kbuild has precedence over Makefile
|
|
kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
|
|
include $(or $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Makefile)
|
|
|
|
|
|
# Figure out what we need to build from the various variables
|
|
# ==========================================================================
|
|
|
|
subdir-ymn := $(sort $(subdir-y) $(subdir-m) $(subdir-) \
|
|
$(patsubst %/,%, $(filter %/, $(obj-y) $(obj-m) $(obj-))))
|
|
|
|
# Add subdir path
|
|
|
|
subdir-ymn := $(addprefix $(obj)/,$(subdir-ymn))
|
|
|
|
# Temporal work-around for U-Boot
|
|
|
|
subdir-ymn := $(foreach f, $(subdir-ymn), \
|
|
$(if $(wildcard $(srctree)/$f/Makefile),$f))
|
|
|
|
# build a list of files to remove, usually relative to the current
|
|
# directory
|
|
|
|
__clean-files := \
|
|
$(clean-files) $(targets) $(hostprogs) $(userprogs) \
|
|
$(extra-y) $(extra-m) $(extra-) \
|
|
$(always-y) $(always-m) $(always-) \
|
|
$(hostprogs-always-y) $(hostprogs-always-m) $(hostprogs-always-) \
|
|
$(userprogs-always-y) $(userprogs-always-m) $(userprogs-always-)
|
|
|
|
__clean-files := $(filter-out $(no-clean-files), $(__clean-files))
|
|
|
|
__clean-files := $(wildcard $(addprefix $(obj)/, $(__clean-files)))
|
|
|
|
# ==========================================================================
|
|
|
|
quiet_cmd_clean = CLEAN $(obj)
|
|
cmd_clean = rm -rf $(__clean-files)
|
|
|
|
__clean: $(subdir-ymn)
|
|
ifneq ($(strip $(__clean-files)),)
|
|
$(call cmd,clean)
|
|
endif
|
|
@:
|
|
|
|
|
|
# ===========================================================================
|
|
# Generic stuff
|
|
# ===========================================================================
|
|
|
|
# Descending
|
|
# ---------------------------------------------------------------------------
|
|
|
|
PHONY += $(subdir-ymn)
|
|
$(subdir-ymn):
|
|
$(Q)$(MAKE) $(clean)=$@
|
|
|
|
.PHONY: $(PHONY)
|