Skip to content
Snippets Groups Projects
Commit c024d49e authored by Detlev Casanova's avatar Detlev Casanova
Browse files

d/rules: Add platform target specifiers


Add support for multiple targets depending on the platform.
This is a preparation commit for supporting the Renesas R-Car platform
that uses bl31.srec and bl2.srec.

Also add a make_target variable that can be different than bl31 for some
platforms.

Signed-off-by: default avatarDetlev Casanova <detlev.casanova@collabora.com>
parent a42f6540
No related branches found
No related tags found
2 merge requests!20Forwardport v2024dev1 changes,!19Build ATF for some of the RCAR boards
......@@ -25,6 +25,9 @@ platforms_nodebug := sun50i_a64 imx8mq
imx8mn_subplatforms := imx8mn imx8mn_uart4
imx8mn_uart4_assigns := IMX_BOOT_UART_BASE=0x30a60000
rk3328_targets := bl31/bl31.elf
rk3399_targets := bl31/bl31.elf
# Always set CROSS_COMPILE, which also works for native builds.
# TARGET_BOARD only required for k3 platform, but safe to set as not used at all elsewhere.
define build_platform
......@@ -32,11 +35,14 @@ define build_platform
$(eval debug := $(2))
$(eval buildtype := $(3))
$(eval subplatforms := $(if $($(platform)_subplatforms), $($(platform)_subplatforms), $(platform)))
$(eval target := $(if $(filter rk3328 rk3399,$(platform)),bl31/bl31.elf,bl31.bin))
$(eval targets := $(if $($(platform)_targets), $($(platform)_targets), bl31.bin))
$(eval make_target := $(if $($(platform)_make_target), $($(platform)_make_target), bl31))
$(eval board := $(if $(filter k3,$(platform)),lite,))
$(foreach subplatform, $(subplatforms), \
CROSS_COMPILE=aarch64-linux-gnu- CFLAGS= LDFLAGS= dh_auto_build -- V=$(VERBOSE) DEBUG=$(debug) $($(subplatform)_assigns) PLAT=$(platform) TARGET_BOARD=$(board) bl31 ; \
install -m644 build/$(platform)/$(board)/$(buildtype)/$(target) -Dt build/renamed/$(subplatform) ; \
CROSS_COMPILE=aarch64-linux-gnu- CFLAGS= LDFLAGS= dh_auto_build -- V=$(VERBOSE) DEBUG=$(debug) $($(subplatform)_assigns) PLAT=$(platform) TARGET_BOARD=$(board) $(make_target) ; \
$(foreach target, $(targets), \
install -m644 build/$(platform)/$(board)/$(buildtype)/$(target) -Dt build/renamed/$(subplatform) ; \
) \
# For each subplatform, make is called using the same PLAT variable. If
# the build is not cleaned between each call, objects will remain the
# same, without rebuilding them.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment