mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-27 23:35:10 +00:00
Makefile: Add all
target to MAKE_DTBS
This patch makes some minor changes to `MAKE_DTBS` make macro and adds `dtbs` target to the `all` make target. Change-Id: I1c5b4a603ada31d2dac2ed73da9ff707b410dd11 Signed-off-by: Soby Mathew <soby.mathew@arm.com>
This commit is contained in:
parent
566034fc27
commit
38c14d88df
2 changed files with 19 additions and 15 deletions
8
Makefile
8
Makefile
|
@ -125,7 +125,7 @@ OC := ${CROSS_COMPILE}objcopy
|
||||||
OD := ${CROSS_COMPILE}objdump
|
OD := ${CROSS_COMPILE}objdump
|
||||||
NM := ${CROSS_COMPILE}nm
|
NM := ${CROSS_COMPILE}nm
|
||||||
PP := ${CROSS_COMPILE}gcc -E
|
PP := ${CROSS_COMPILE}gcc -E
|
||||||
DTC ?= dtc
|
DTC := dtc
|
||||||
|
|
||||||
# Use ${LD}.bfd instead if it exists (as absolute path or together with $PATH).
|
# Use ${LD}.bfd instead if it exists (as absolute path or together with $PATH).
|
||||||
ifneq ($(strip $(wildcard ${LD}.bfd) \
|
ifneq ($(strip $(wildcard ${LD}.bfd) \
|
||||||
|
@ -638,9 +638,7 @@ endif
|
||||||
|
|
||||||
# Expand build macros for the different images
|
# Expand build macros for the different images
|
||||||
ifeq (${NEED_FDT},yes)
|
ifeq (${NEED_FDT},yes)
|
||||||
$(eval $(call MAKE_DTBS,$(BUILD_PLAT)/fdts,$(FDT_SOURCES)))
|
$(eval $(call MAKE_DTBS,$(BUILD_PLAT)/fdts,$(FDT_SOURCES)))
|
||||||
$(eval $(call MAKE_FDT))
|
|
||||||
dtbs: $(DTBS)
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
locate-checkpatch:
|
locate-checkpatch:
|
||||||
|
@ -777,7 +775,7 @@ help:
|
||||||
@echo " distclean Remove all build artifacts for all platforms"
|
@echo " distclean Remove all build artifacts for all platforms"
|
||||||
@echo " certtool Build the Certificate generation tool"
|
@echo " certtool Build the Certificate generation tool"
|
||||||
@echo " fiptool Build the Firmware Image Package (FIP) creation tool"
|
@echo " fiptool Build the Firmware Image Package (FIP) creation tool"
|
||||||
@echo " dtbs Build the Flattened device tree (if required for the platform)"
|
@echo " dtbs Build the Device Tree Blobs (if required for the platform)"
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "Note: most build targets require PLAT to be set to a specific platform."
|
@echo "Note: most build targets require PLAT to be set to a specific platform."
|
||||||
@echo ""
|
@echo ""
|
||||||
|
|
|
@ -344,15 +344,18 @@ $(if $(2),$(call TOOL_ADD_IMG_PAYLOAD,bl$(1),$(BIN),--$(2),$(BIN),$(3)))
|
||||||
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
# Convert device tree source file names to matching blobs
|
||||||
|
# $(1) = input dts
|
||||||
define SOURCES_TO_DTBS
|
define SOURCES_TO_DTBS
|
||||||
$(notdir $(patsubst %.dts,%.dtb,$(filter %.dts,$(1))))
|
$(notdir $(patsubst %.dts,%.dtb,$(filter %.dts,$(1))))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# MAKE_FDT macro defines the targets and options to build each FDT binary
|
# MAKE_FDT_DIRS macro creates the prerequisite directories that host the
|
||||||
# Arguments: (none)
|
# FDT binaries
|
||||||
define MAKE_FDT
|
# $(1) = output directory
|
||||||
$(eval DTB_BUILD_DIR := ${BUILD_PLAT}/fdts)
|
# $(2) = input dts
|
||||||
$(eval DTBS := $(addprefix $(DTB_BUILD_DIR)/,$(call SOURCES_TO_DTBS,$(FDT_SOURCES))))
|
define MAKE_FDT_DIRS
|
||||||
|
$(eval DTBS := $(addprefix $(1)/,$(call SOURCES_TO_DTBS,$(2))))
|
||||||
$(eval TEMP_DTB_DIRS := $(sort $(dir ${DTBS})))
|
$(eval TEMP_DTB_DIRS := $(sort $(dir ${DTBS})))
|
||||||
# The $(dir ) function leaves a trailing / on the directory names
|
# The $(dir ) function leaves a trailing / on the directory names
|
||||||
# Rip off the / to match directory names with make rule targets.
|
# Rip off the / to match directory names with make rule targets.
|
||||||
|
@ -361,15 +364,14 @@ define MAKE_FDT
|
||||||
$(eval $(foreach objd,${DTB_DIRS},$(call MAKE_PREREQ_DIR,${objd},${BUILD_DIR})))
|
$(eval $(foreach objd,${DTB_DIRS},$(call MAKE_PREREQ_DIR,${objd},${BUILD_DIR})))
|
||||||
|
|
||||||
fdt_dirs: ${DTB_DIRS}
|
fdt_dirs: ${DTB_DIRS}
|
||||||
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# MAKE_DTB generate the Flattened device tree binary (device tree binary)
|
# MAKE_DTB generate the Flattened device tree binary
|
||||||
# $(1) = output directory
|
# $(1) = output directory
|
||||||
# $(2) = input dts
|
# $(2) = input dts
|
||||||
define MAKE_DTB
|
define MAKE_DTB
|
||||||
|
|
||||||
$(eval DOBJ := $(1)/$(patsubst %.dts,%.dtb,$(notdir $(2))))
|
$(eval DOBJ := $(addprefix $(1)/,$(call SOURCES_TO_DTBS,$(2))))
|
||||||
$(eval DEP := $(patsubst %.dtb,%.d,$(DOBJ)))
|
$(eval DEP := $(patsubst %.dtb,%.d,$(DOBJ)))
|
||||||
|
|
||||||
$(DOBJ): $(2) $(MAKEFILE_LIST) | fdt_dirs
|
$(DOBJ): $(2) $(MAKEFILE_LIST) | fdt_dirs
|
||||||
|
@ -386,7 +388,11 @@ endef
|
||||||
define MAKE_DTBS
|
define MAKE_DTBS
|
||||||
$(eval DOBJS := $(filter %.dts,$(2)))
|
$(eval DOBJS := $(filter %.dts,$(2)))
|
||||||
$(eval REMAIN := $(filter-out %.dts,$(2)))
|
$(eval REMAIN := $(filter-out %.dts,$(2)))
|
||||||
|
$(and $(REMAIN),$(error FDT_SOURCES contain non-DTS files: $(REMAIN)))
|
||||||
$(eval $(foreach obj,$(DOBJS),$(call MAKE_DTB,$(1),$(obj))))
|
$(eval $(foreach obj,$(DOBJS),$(call MAKE_DTB,$(1),$(obj))))
|
||||||
|
|
||||||
$(and $(REMAIN),$(error Unexpected s present: $(REMAIN)))
|
$(eval $(call MAKE_FDT_DIRS,$(1),$(2)))
|
||||||
|
|
||||||
|
dtbs: $(DTBS)
|
||||||
|
all: dtbs
|
||||||
endef
|
endef
|
||||||
|
|
Loading…
Add table
Reference in a new issue