blob: d86720e61d1b42f46e18df93b8b7c0cab1f478a5 [file] [log] [blame]
Juan Castillo73c99d42015-08-18 14:23:04 +01001#
Chris Kay82274932023-01-16 16:53:45 +00002# Copyright (c) 2015-2023, Arm Limited and Contributors. All rights reserved.
Juan Castillo73c99d42015-08-18 14:23:04 +01003#
dp-arm82cb2c12017-05-03 09:38:09 +01004# SPDX-License-Identifier: BSD-3-Clause
Juan Castillo73c99d42015-08-18 14:23:04 +01005#
6
Evan Lloyd1670d9d2015-12-02 18:41:22 +00007# Report an error if the eval make function is not available.
8$(eval eval_available := T)
9ifneq (${eval_available},T)
10 $(error This makefile only works with a Make program that supports $$(eval))
11endif
12
Evan Lloyd231c1472015-12-02 18:17:37 +000013# Some utility macros for manipulating awkward (whitespace) characters.
14blank :=
15space :=${blank} ${blank}
16
17# A user defined function to recursively search for a filename below a directory
18# $1 is the directory root of the recursive search (blank for current directory).
19# $2 is the file name to search for.
20define rwildcard
21$(strip $(foreach d,$(wildcard ${1}*),$(call rwildcard,${d}/,${2}) $(filter $(subst *,%,%${2}),${d})))
22endef
23
Yatharth Kochar5ba8f662015-10-02 13:58:52 +010024# This table is used in converting lower case to upper case.
25uppercase_table:=a,A b,B c,C d,D e,E f,F g,G h,H i,I j,J k,K l,L m,M n,N o,O p,P q,Q r,R s,S t,T u,U v,V w,W x,X y,Y z,Z
26
27# Internal macro used for converting lower case to upper case.
28# $(1) = upper case table
29# $(2) = String to convert
30define uppercase_internal
31$(if $(1),$$(subst $(firstword $(1)),$(call uppercase_internal,$(wordlist 2,$(words $(1)),$(1)),$(2))),$(2))
32endef
33
34# A macro for converting a string to upper case
35# $(1) = String to convert
36define uppercase
37$(eval uppercase_result:=$(call uppercase_internal,$(uppercase_table),$(1)))$(uppercase_result)
38endef
39
Juan Castillo73c99d42015-08-18 14:23:04 +010040# Convenience function for adding build definitions
41# $(eval $(call add_define,FOO)) will have:
42# -DFOO if $(FOO) is empty; -DFOO=$(FOO) otherwise
43define add_define
44 DEFINES += -D$(1)$(if $(value $(1)),=$(value $(1)),)
45endef
46
Leonardo Sandoval327131c2020-09-10 12:18:27 -050047
48# Convenience function for addding multiple build definitions
49# $(eval $(call add_defines,FOO BOO))
50define add_defines
51 $(foreach def,$1,$(eval $(call add_define,$(def))))
52endef
53
Soren Brinkmann8eadeb42016-06-09 13:36:27 -070054# Convenience function for adding build definitions
55# $(eval $(call add_define_val,FOO,BAR)) will have:
56# -DFOO=BAR
57define add_define_val
58 DEFINES += -D$(1)=$(2)
59endef
60
Juan Castillo73c99d42015-08-18 14:23:04 +010061# Convenience function for verifying option has a boolean value
62# $(eval $(call assert_boolean,FOO)) will assert FOO is 0 or 1
63define assert_boolean
Masahiro Yamadabe4cd402017-05-23 23:45:01 +090064 $(if $(filter-out 0 1,$($1)),$(error $1 must be boolean))
Juan Castillo73c99d42015-08-18 14:23:04 +010065endef
66
Leonardo Sandoval327131c2020-09-10 12:18:27 -050067# Convenience function for verifying options have boolean values
68# $(eval $(call assert_booleans,FOO BOO)) will assert FOO and BOO for 0 or 1 values
69define assert_booleans
70 $(foreach bool,$1,$(eval $(call assert_boolean,$(bool))))
71endef
72
Jeenu Viswambharanc877b412017-01-16 16:52:35 +0000730-9 := 0 1 2 3 4 5 6 7 8 9
74
75# Function to verify that a given option $(1) contains a numeric value
76define assert_numeric
77$(if $($(1)),,$(error $(1) must not be empty))
78$(eval __numeric := $($(1)))
79$(foreach d,$(0-9),$(eval __numeric := $(subst $(d),,$(__numeric))))
80$(if $(__numeric),$(error $(1) must be numeric))
81endef
82
Leonardo Sandoval327131c2020-09-10 12:18:27 -050083# Convenience function for verifying options have numeric values
84# $(eval $(call assert_numerics,FOO BOO)) will assert FOO and BOO contain numeric values
85define assert_numerics
86 $(foreach num,$1,$(eval $(call assert_numeric,$(num))))
87endef
88
Vijayenthiran Subramaniam8c7b9442020-02-08 21:27:30 +053089# CREATE_SEQ is a recursive function to create sequence of numbers from 1 to
90# $(2) and assign the sequence to $(1)
91define CREATE_SEQ
92$(if $(word $(2), $($(1))),\
93 $(eval $(1) += $(words $($(1))))\
94 $(eval $(1) := $(filter-out 0,$($(1)))),\
95 $(eval $(1) += $(words $($(1))))\
96 $(call CREATE_SEQ,$(1),$(2))\
97)
98endef
99
Juan Castillo73c99d42015-08-18 14:23:04 +0100100# IMG_MAPFILE defines the output file describing the memory map corresponding
101# to a BL stage
Zelalem Aweke434d0492021-07-11 17:25:48 -0500102# $(1) = BL stage
Juan Castillo73c99d42015-08-18 14:23:04 +0100103define IMG_MAPFILE
Zelalem Aweke434d0492021-07-11 17:25:48 -0500104 ${BUILD_DIR}/$(1).map
Juan Castillo73c99d42015-08-18 14:23:04 +0100105endef
106
107# IMG_ELF defines the elf file corresponding to a BL stage
Zelalem Aweke434d0492021-07-11 17:25:48 -0500108# $(1) = BL stage
Juan Castillo73c99d42015-08-18 14:23:04 +0100109define IMG_ELF
Zelalem Aweke434d0492021-07-11 17:25:48 -0500110 ${BUILD_DIR}/$(1).elf
Juan Castillo73c99d42015-08-18 14:23:04 +0100111endef
112
113# IMG_DUMP defines the symbols dump file corresponding to a BL stage
Zelalem Aweke434d0492021-07-11 17:25:48 -0500114# $(1) = BL stage
Juan Castillo73c99d42015-08-18 14:23:04 +0100115define IMG_DUMP
Zelalem Aweke434d0492021-07-11 17:25:48 -0500116 ${BUILD_DIR}/$(1).dump
Juan Castillo73c99d42015-08-18 14:23:04 +0100117endef
118
119# IMG_BIN defines the default image file corresponding to a BL stage
Zelalem Aweke434d0492021-07-11 17:25:48 -0500120# $(1) = BL stage
Juan Castillo73c99d42015-08-18 14:23:04 +0100121define IMG_BIN
Zelalem Aweke434d0492021-07-11 17:25:48 -0500122 ${BUILD_PLAT}/$(1).bin
Juan Castillo73c99d42015-08-18 14:23:04 +0100123endef
124
Sumit Gargc6ba9b42019-11-14 16:33:45 +0530125# IMG_ENC_BIN defines the default encrypted image file corresponding to a
126# BL stage
Zelalem Aweke434d0492021-07-11 17:25:48 -0500127# $(1) = BL stage
Sumit Gargc6ba9b42019-11-14 16:33:45 +0530128define IMG_ENC_BIN
Zelalem Aweke434d0492021-07-11 17:25:48 -0500129 ${BUILD_PLAT}/$(1)_enc.bin
Sumit Gargc6ba9b42019-11-14 16:33:45 +0530130endef
131
132# ENCRYPT_FW invokes enctool to encrypt firmware binary
133# $(1) = input firmware binary
134# $(2) = output encrypted firmware binary
135define ENCRYPT_FW
136$(2): $(1) enctool
137 $$(ECHO) " ENC $$<"
138 $$(Q)$$(ENCTOOL) $$(ENC_ARGS) -i $$< -o $$@
139endef
140
Masahiro Yamada10cea932018-01-26 11:42:01 +0900141# TOOL_ADD_PAYLOAD appends the command line arguments required by fiptool to
142# package a new payload and/or by cert_create to generate certificate.
143# Optionally, it adds the dependency on this payload
Juan Castillo73c99d42015-08-18 14:23:04 +0100144# $(1) = payload filename (i.e. bl31.bin)
Masahiro Yamada1e0c0782017-12-23 23:56:18 +0900145# $(2) = command line option for the specified payload (i.e. --soc-fw)
Masahiro Yamada36af3452018-01-26 11:42:01 +0900146# $(3) = tool target dependency (optional) (ex. build/fvp/release/bl31.bin)
Masahiro Yamada1dc07142018-01-26 11:42:01 +0900147# $(4) = FIP prefix (optional) (if FWU_, target is fwu_fip instead of fip)
Sumit Gargc6ba9b42019-11-14 16:33:45 +0530148# $(5) = encrypted payload (optional) (ex. build/fvp/release/bl31_enc.bin)
Masahiro Yamada10cea932018-01-26 11:42:01 +0900149define TOOL_ADD_PAYLOAD
Sumit Gargc6ba9b42019-11-14 16:33:45 +0530150ifneq ($(5),)
151 $(4)FIP_ARGS += $(2) $(5)
152 $(if $(3),$(4)CRT_DEPS += $(1))
153else
Masahiro Yamada945b3162018-01-26 11:42:01 +0900154 $(4)FIP_ARGS += $(2) $(1)
Sumit Gargc6ba9b42019-11-14 16:33:45 +0530155 $(if $(3),$(4)CRT_DEPS += $(3))
156endif
Masahiro Yamada945b3162018-01-26 11:42:01 +0900157 $(if $(3),$(4)FIP_DEPS += $(3))
Masahiro Yamadaf30ee0b2018-01-26 11:42:01 +0900158 $(4)CRT_ARGS += $(2) $(1)
Juan Castillo73c99d42015-08-18 14:23:04 +0100159endef
160
Masahiro Yamada2da522b2018-02-01 16:31:09 +0900161# TOOL_ADD_IMG_PAYLOAD works like TOOL_ADD_PAYLOAD, but applies image filters
162# before passing them to host tools if BL*_PRE_TOOL_FILTER is defined.
163# $(1) = image_type (scp_bl2, bl33, etc.)
164# $(2) = payload filepath (ex. build/fvp/release/bl31.bin)
165# $(3) = command line option for the specified payload (ex. --soc-fw)
166# $(4) = tool target dependency (optional) (ex. build/fvp/release/bl31.bin)
167# $(5) = FIP prefix (optional) (if FWU_, target is fwu_fip instead of fip)
Sumit Gargc6ba9b42019-11-14 16:33:45 +0530168# $(6) = encrypted payload (optional) (ex. build/fvp/release/bl31_enc.bin)
Masahiro Yamada2da522b2018-02-01 16:31:09 +0900169
170define TOOL_ADD_IMG_PAYLOAD
171
172$(eval PRE_TOOL_FILTER := $($(call uppercase,$(1))_PRE_TOOL_FILTER))
173
174ifneq ($(PRE_TOOL_FILTER),)
175
176$(eval PROCESSED_PATH := $(BUILD_PLAT)/$(1).bin$($(PRE_TOOL_FILTER)_SUFFIX))
177
178$(call $(PRE_TOOL_FILTER)_RULE,$(PROCESSED_PATH),$(2))
179
180$(PROCESSED_PATH): $(4)
181
Sumit Gargc6ba9b42019-11-14 16:33:45 +0530182$(call TOOL_ADD_PAYLOAD,$(PROCESSED_PATH),$(3),$(PROCESSED_PATH),$(5),$(6))
Masahiro Yamada2da522b2018-02-01 16:31:09 +0900183
184else
Sumit Gargc6ba9b42019-11-14 16:33:45 +0530185$(call TOOL_ADD_PAYLOAD,$(2),$(3),$(4),$(5),$(6))
Masahiro Yamada2da522b2018-02-01 16:31:09 +0900186endif
187endef
188
Yatharth Kochar01912622015-10-12 12:33:47 +0100189# CERT_ADD_CMD_OPT adds a new command line option to the cert_create invocation
Juan Castillo73c99d42015-08-18 14:23:04 +0100190# $(1) = parameter filename
191# $(2) = cert_create command line option for the specified parameter
Masahiro Yamada91704d92018-01-26 11:42:01 +0900192# $(3) = FIP prefix (optional) (if FWU_, target is fwu_fip instead of fip)
Juan Castillo73c99d42015-08-18 14:23:04 +0100193define CERT_ADD_CMD_OPT
Masahiro Yamada91704d92018-01-26 11:42:01 +0900194 $(3)CRT_ARGS += $(2) $(1)
Juan Castillo73c99d42015-08-18 14:23:04 +0100195endef
196
Masahiro Yamadac939d132018-01-26 11:42:01 +0900197# TOOL_ADD_IMG allows the platform to specify an external image to be packed
198# in the FIP and/or for which certificate is generated. It also adds a
199# dependency on the image file, aborting the build if the file does not exist.
Masahiro Yamada33950dd2018-01-26 11:42:01 +0900200# $(1) = image_type (scp_bl2, bl33, etc.)
Masahiro Yamada1e0c0782017-12-23 23:56:18 +0900201# $(2) = command line option for fiptool (--scp-fw, --nt-fw, etc)
Masahiro Yamada1dc07142018-01-26 11:42:01 +0900202# $(3) = FIP prefix (optional) (if FWU_, target is fwu_fip instead of fip)
Sumit Gargc6ba9b42019-11-14 16:33:45 +0530203# $(4) = Image encryption flag (optional) (0, 1)
Juan Castillo73c99d42015-08-18 14:23:04 +0100204# Example:
Masahiro Yamada33950dd2018-01-26 11:42:01 +0900205# $(eval $(call TOOL_ADD_IMG,bl33,--nt-fw))
Masahiro Yamadac939d132018-01-26 11:42:01 +0900206define TOOL_ADD_IMG
Masahiro Yamada33950dd2018-01-26 11:42:01 +0900207 # Build option to specify the image filename (SCP_BL2, BL33, etc)
208 # This is the uppercase form of the first parameter
209 $(eval _V := $(call uppercase,$(1)))
210
Pali Rohár4727fd12020-11-24 16:53:04 +0100211 # $(check_$(1)_cmd) variable is executed in the check_$(1) target and also
212 # is put into the ${CHECK_$(3)FIP_CMD} variable which is executed by the
213 # target ${BUILD_PLAT}/${$(3)FIP_NAME}.
214 $(eval check_$(1)_cmd := \
215 $(if $(value $(_V)),,$$$$(error "Platform '${PLAT}' requires $(_V). Please set $(_V) to point to the right file")) \
216 $(if $(wildcard $(value $(_V))),,$$$$(error '$(_V)=$(value $(_V))' was specified, but '$(value $(_V))' does not exist)) \
217 )
218
Masahiro Yamada945b3162018-01-26 11:42:01 +0900219 $(3)CRT_DEPS += check_$(1)
Pali Rohár4727fd12020-11-24 16:53:04 +0100220 CHECK_$(3)FIP_CMD += $$(check_$(1)_cmd)
Sumit Gargc6ba9b42019-11-14 16:33:45 +0530221ifeq ($(4),1)
222 $(eval ENC_BIN := ${BUILD_PLAT}/$(1)_enc.bin)
223 $(call ENCRYPT_FW,$(value $(_V)),$(ENC_BIN))
224 $(call TOOL_ADD_IMG_PAYLOAD,$(1),$(value $(_V)),$(2),$(ENC_BIN),$(3), \
225 $(ENC_BIN))
226else
Pali Rohár4727fd12020-11-24 16:53:04 +0100227 $(call TOOL_ADD_IMG_PAYLOAD,$(1),$(value $(_V)),$(2),$(if $(wildcard $(value $(_V))),$(value $(_V)),FORCE),$(3))
Sumit Gargc6ba9b42019-11-14 16:33:45 +0530228endif
Yatharth Kochar01912622015-10-12 12:33:47 +0100229
Masahiro Yamada87ebd202017-12-24 13:08:00 +0900230.PHONY: check_$(1)
Yatharth Kochar01912622015-10-12 12:33:47 +0100231check_$(1):
Pali Rohár4727fd12020-11-24 16:53:04 +0100232 $(check_$(1)_cmd)
Yatharth Kochar01912622015-10-12 12:33:47 +0100233endef
Juan Castillo73c99d42015-08-18 14:23:04 +0100234
Juan Pablo Condecf2dd172022-10-25 19:41:02 -0400235# SELECT_OPENSSL_API_VERSION selects the OpenSSL API version to be used to
236# build the host tools by checking the version of OpenSSL located under
237# the path defined by the OPENSSL_DIR variable. It receives no parameters.
238define SELECT_OPENSSL_API_VERSION
239 # Set default value for USING_OPENSSL3 macro to 0
240 $(eval USING_OPENSSL3 = 0)
241 # Obtain the OpenSSL version for the build located under OPENSSL_DIR
242 $(eval OPENSSL_INFO := $(shell LD_LIBRARY_PATH=${OPENSSL_DIR}:${OPENSSL_DIR}/lib ${OPENSSL_BIN_PATH}/openssl version))
243 $(eval OPENSSL_CURRENT_VER = $(word 2, ${OPENSSL_INFO}))
244 $(eval OPENSSL_CURRENT_VER_MAJOR = $(firstword $(subst ., ,$(OPENSSL_CURRENT_VER))))
245 # If OpenSSL version is 3.x, then set USING_OPENSSL3 flag to 1
246 $(if $(filter 3,$(OPENSSL_CURRENT_VER_MAJOR)), $(eval USING_OPENSSL3 = 1))
247endef
248
Juan Castillo73c99d42015-08-18 14:23:04 +0100249################################################################################
Masahiro Yamada14db8902018-01-26 11:42:01 +0900250# Generic image processing filters
251################################################################################
252
253# GZIP
254define GZIP_RULE
255$(1): $(2)
Andre Przywaraee1ba6d2018-09-27 10:56:05 +0100256 $(ECHO) " GZIP $$@"
Masahiro Yamada14db8902018-01-26 11:42:01 +0900257 $(Q)gzip -n -f -9 $$< --stdout > $$@
258endef
259
260GZIP_SUFFIX := .gz
261
262################################################################################
Juan Castillo73c99d42015-08-18 14:23:04 +0100263# Auxiliary macros to build TF images from sources
264################################################################################
265
Masahiro Yamada1d274ab2016-12-22 15:23:05 +0900266MAKE_DEP = -Wp,-MD,$(DEP) -MT $$@ -MP
Juan Castillo73c99d42015-08-18 14:23:04 +0100267
Roberto Vargas5fee0282018-05-08 10:27:10 +0100268
269# MAKE_C_LIB builds a C source file and generates the dependency file
270# $(1) = output directory
271# $(2) = source file (%.c)
272# $(3) = library name
273define MAKE_C_LIB
274$(eval OBJ := $(1)/$(patsubst %.c,%.o,$(notdir $(2))))
275$(eval DEP := $(patsubst %.o,%.d,$(OBJ)))
276
277$(OBJ): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | lib$(3)_dirs
Andre Przywaraee1ba6d2018-09-27 10:56:05 +0100278 $$(ECHO) " CC $$<"
Roberto Vargas5fee0282018-05-08 10:27:10 +0100279 $$(Q)$$(CC) $$(TF_CFLAGS) $$(CFLAGS) $(MAKE_DEP) -c $$< -o $$@
280
281-include $(DEP)
282
283endef
284
Antonio Nino Diaz70b0f272019-02-08 13:20:37 +0000285# MAKE_S_LIB builds an assembly source file and generates the dependency file
286# $(1) = output directory
287# $(2) = source file (%.S)
288# $(3) = library name
289define MAKE_S_LIB
290$(eval OBJ := $(1)/$(patsubst %.S,%.o,$(notdir $(2))))
291$(eval DEP := $(patsubst %.o,%.d,$(OBJ)))
292
293$(OBJ): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | lib$(3)_dirs
294 $$(ECHO) " AS $$<"
295 $$(Q)$$(AS) $$(ASFLAGS) $(MAKE_DEP) -c $$< -o $$@
296
297-include $(DEP)
298
299endef
300
Roberto Vargas5fee0282018-05-08 10:27:10 +0100301
Juan Castillo73c99d42015-08-18 14:23:04 +0100302# MAKE_C builds a C source file and generates the dependency file
303# $(1) = output directory
304# $(2) = source file (%.c)
Zelalem Aweke434d0492021-07-11 17:25:48 -0500305# $(3) = BL stage
Juan Castillo73c99d42015-08-18 14:23:04 +0100306define MAKE_C
307
308$(eval OBJ := $(1)/$(patsubst %.c,%.o,$(notdir $(2))))
Masahiro Yamada710ea1d2016-12-22 14:02:27 +0900309$(eval DEP := $(patsubst %.o,%.d,$(OBJ)))
Zelalem Aweke434d0492021-07-11 17:25:48 -0500310$(eval BL_CPPFLAGS := $($(call uppercase,$(3))_CPPFLAGS) -DIMAGE_$(call uppercase,$(3)))
311$(eval BL_CFLAGS := $($(call uppercase,$(3))_CFLAGS))
Juan Castillo73c99d42015-08-18 14:23:04 +0100312
Zelalem Aweke434d0492021-07-11 17:25:48 -0500313$(OBJ): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | $(3)_dirs
Andre Przywaraee1ba6d2018-09-27 10:56:05 +0100314 $$(ECHO) " CC $$<"
Masahiro Yamada848a7e82020-03-25 16:55:28 +0900315 $$(Q)$$(CC) $$(LTO_CFLAGS) $$(TF_CFLAGS) $$(CFLAGS) $(BL_CPPFLAGS) $(BL_CFLAGS) $(MAKE_DEP) -c $$< -o $$@
Juan Castillo73c99d42015-08-18 14:23:04 +0100316
Masahiro Yamada710ea1d2016-12-22 14:02:27 +0900317-include $(DEP)
Juan Castillo73c99d42015-08-18 14:23:04 +0100318
319endef
320
321
322# MAKE_S builds an assembly source file and generates the dependency file
323# $(1) = output directory
324# $(2) = assembly file (%.S)
Zelalem Aweke434d0492021-07-11 17:25:48 -0500325# $(3) = BL stage
Juan Castillo73c99d42015-08-18 14:23:04 +0100326define MAKE_S
327
328$(eval OBJ := $(1)/$(patsubst %.S,%.o,$(notdir $(2))))
Masahiro Yamada710ea1d2016-12-22 14:02:27 +0900329$(eval DEP := $(patsubst %.o,%.d,$(OBJ)))
Zelalem Aweke434d0492021-07-11 17:25:48 -0500330$(eval BL_CPPFLAGS := $($(call uppercase,$(3))_CPPFLAGS) -DIMAGE_$(call uppercase,$(3)))
331$(eval BL_ASFLAGS := $($(call uppercase,$(3))_ASFLAGS))
Juan Castillo73c99d42015-08-18 14:23:04 +0100332
Zelalem Aweke434d0492021-07-11 17:25:48 -0500333$(OBJ): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | $(3)_dirs
Andre Przywaraee1ba6d2018-09-27 10:56:05 +0100334 $$(ECHO) " AS $$<"
Masahiro Yamada848a7e82020-03-25 16:55:28 +0900335 $$(Q)$$(AS) $$(ASFLAGS) $(BL_CPPFLAGS) $(BL_ASFLAGS) $(MAKE_DEP) -c $$< -o $$@
Juan Castillo73c99d42015-08-18 14:23:04 +0100336
Masahiro Yamada710ea1d2016-12-22 14:02:27 +0900337-include $(DEP)
Juan Castillo73c99d42015-08-18 14:23:04 +0100338
339endef
340
341
342# MAKE_LD generate the linker script using the C preprocessor
343# $(1) = output linker script
344# $(2) = input template
Zelalem Aweke434d0492021-07-11 17:25:48 -0500345# $(3) = BL stage
Juan Castillo73c99d42015-08-18 14:23:04 +0100346define MAKE_LD
347
Masahiro Yamada710ea1d2016-12-22 14:02:27 +0900348$(eval DEP := $(1).d)
Zelalem Aweke434d0492021-07-11 17:25:48 -0500349$(eval BL_CPPFLAGS := $($(call uppercase,$(3))_CPPFLAGS) -DIMAGE_$(call uppercase,$(3)))
Juan Castillo73c99d42015-08-18 14:23:04 +0100350
Zelalem Aweke434d0492021-07-11 17:25:48 -0500351$(1): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | $(3)_dirs
Andre Przywaraee1ba6d2018-09-27 10:56:05 +0100352 $$(ECHO) " PP $$<"
Masahiro Yamada848a7e82020-03-25 16:55:28 +0900353 $$(Q)$$(CPP) $$(CPPFLAGS) $(BL_CPPFLAGS) $(TF_CFLAGS_$(ARCH)) -P -x assembler-with-cpp -D__LINKER__ $(MAKE_DEP) -o $$@ $$<
Juan Castillo73c99d42015-08-18 14:23:04 +0100354
Masahiro Yamada710ea1d2016-12-22 14:02:27 +0900355-include $(DEP)
Juan Castillo73c99d42015-08-18 14:23:04 +0100356
357endef
358
Antonio Nino Diaz70b0f272019-02-08 13:20:37 +0000359# MAKE_LIB_OBJS builds both C and assembly source files
Roberto Vargas5fee0282018-05-08 10:27:10 +0100360# $(1) = output directory
361# $(2) = list of source files
362# $(3) = name of the library
363define MAKE_LIB_OBJS
364 $(eval C_OBJS := $(filter %.c,$(2)))
365 $(eval REMAIN := $(filter-out %.c,$(2)))
366 $(eval $(foreach obj,$(C_OBJS),$(call MAKE_C_LIB,$(1),$(obj),$(3))))
367
Antonio Nino Diaz70b0f272019-02-08 13:20:37 +0000368 $(eval S_OBJS := $(filter %.S,$(REMAIN)))
369 $(eval REMAIN := $(filter-out %.S,$(REMAIN)))
370 $(eval $(foreach obj,$(S_OBJS),$(call MAKE_S_LIB,$(1),$(obj),$(3))))
371
Roberto Vargas5fee0282018-05-08 10:27:10 +0100372 $(and $(REMAIN),$(error Unexpected source files present: $(REMAIN)))
373endef
374
Juan Castillo73c99d42015-08-18 14:23:04 +0100375
376# MAKE_OBJS builds both C and assembly source files
377# $(1) = output directory
378# $(2) = list of source files (both C and assembly)
Zelalem Aweke434d0492021-07-11 17:25:48 -0500379# $(3) = BL stage
Juan Castillo73c99d42015-08-18 14:23:04 +0100380define MAKE_OBJS
381 $(eval C_OBJS := $(filter %.c,$(2)))
382 $(eval REMAIN := $(filter-out %.c,$(2)))
383 $(eval $(foreach obj,$(C_OBJS),$(call MAKE_C,$(1),$(obj),$(3))))
384
385 $(eval S_OBJS := $(filter %.S,$(REMAIN)))
386 $(eval REMAIN := $(filter-out %.S,$(REMAIN)))
387 $(eval $(foreach obj,$(S_OBJS),$(call MAKE_S,$(1),$(obj),$(3))))
388
389 $(and $(REMAIN),$(error Unexpected source files present: $(REMAIN)))
390endef
391
392
393# NOTE: The line continuation '\' is required in the next define otherwise we
394# end up with a line-feed characer at the end of the last c filename.
Evan Lloyde7f54db2015-12-02 18:56:06 +0000395# Also bear this issue in mind if extending the list of supported filetypes.
Juan Castillo73c99d42015-08-18 14:23:04 +0100396define SOURCES_TO_OBJS
397 $(notdir $(patsubst %.c,%.o,$(filter %.c,$(1)))) \
398 $(notdir $(patsubst %.S,%.o,$(filter %.S,$(1))))
399endef
400
Patrick Georgi2f5d4a42016-01-28 14:46:18 +0100401# Allow overriding the timestamp, for example for reproducible builds, or to
402# synchronize timestamps across multiple projects.
403# This must be set to a C string (including quotes where applicable).
404BUILD_MESSAGE_TIMESTAMP ?= __TIME__", "__DATE__
Juan Castillo73c99d42015-08-18 14:23:04 +0100405
Roberto Vargas5fee0282018-05-08 10:27:10 +0100406.PHONY: libraries
407
Roberto Vargas5accce52018-05-22 16:05:42 +0100408# MAKE_LIB_DIRS macro defines the target for the directory where
Roberto Vargas5fee0282018-05-08 10:27:10 +0100409# libraries are created
Roberto Vargas5accce52018-05-22 16:05:42 +0100410define MAKE_LIB_DIRS
Roberto Vargas5fee0282018-05-08 10:27:10 +0100411 $(eval LIB_DIR := ${BUILD_PLAT}/lib)
Roberto Vargas5accce52018-05-22 16:05:42 +0100412 $(eval ROMLIB_DIR := ${BUILD_PLAT}/romlib)
413 $(eval LIBWRAPPER_DIR := ${BUILD_PLAT}/libwrapper)
414 $(eval $(call MAKE_PREREQ_DIR,${LIB_DIR},${BUILD_PLAT}))
415 $(eval $(call MAKE_PREREQ_DIR,${ROMLIB_DIR},${BUILD_PLAT}))
416 $(eval $(call MAKE_PREREQ_DIR,${LIBWRAPPER_DIR},${BUILD_PLAT}))
Roberto Vargas5fee0282018-05-08 10:27:10 +0100417endef
418
419# MAKE_LIB macro defines the targets and options to build each BL image.
420# Arguments:
421# $(1) = Library name
422define MAKE_LIB
423 $(eval BUILD_DIR := ${BUILD_PLAT}/lib$(1))
424 $(eval LIB_DIR := ${BUILD_PLAT}/lib)
Roberto Vargas5accce52018-05-22 16:05:42 +0100425 $(eval ROMLIB_DIR := ${BUILD_PLAT}/romlib)
Roberto Vargas5fee0282018-05-08 10:27:10 +0100426 $(eval SOURCES := $(LIB$(call uppercase,$(1))_SRCS))
427 $(eval OBJS := $(addprefix $(BUILD_DIR)/,$(call SOURCES_TO_OBJS,$(SOURCES))))
428
429$(eval $(call MAKE_PREREQ_DIR,${BUILD_DIR},${BUILD_PLAT}))
430$(eval $(call MAKE_LIB_OBJS,$(BUILD_DIR),$(SOURCES),$(1)))
431
432.PHONY : lib${1}_dirs
Roberto Vargas5accce52018-05-22 16:05:42 +0100433lib${1}_dirs: | ${BUILD_DIR} ${LIB_DIR} ${ROMLIB_DIR} ${LIBWRAPPER_DIR}
Roberto Vargas5fee0282018-05-08 10:27:10 +0100434libraries: ${LIB_DIR}/lib$(1).a
Varun Wadekarc2ad38c2019-01-11 14:47:48 -0800435ifneq ($(findstring armlink,$(notdir $(LD))),)
436LDPATHS = --userlibpath=${LIB_DIR}
437LDLIBS += --library=$(1)
438else
Roberto Vargas5fee0282018-05-08 10:27:10 +0100439LDPATHS = -L${LIB_DIR}
440LDLIBS += -l$(1)
Varun Wadekarc2ad38c2019-01-11 14:47:48 -0800441endif
Roberto Vargas5fee0282018-05-08 10:27:10 +0100442
Roberto Vargas5accce52018-05-22 16:05:42 +0100443ifeq ($(USE_ROMLIB),1)
Sathees Balya6baf85b2018-10-18 19:14:21 +0100444LIBWRAPPER = -lwrappers
Roberto Vargas5accce52018-05-22 16:05:42 +0100445endif
446
Roberto Vargas5fee0282018-05-08 10:27:10 +0100447all: ${LIB_DIR}/lib$(1).a
448
449${LIB_DIR}/lib$(1).a: $(OBJS)
Andre Przywaraee1ba6d2018-09-27 10:56:05 +0100450 $$(ECHO) " AR $$@"
Roberto Vargas5fee0282018-05-08 10:27:10 +0100451 $$(Q)$$(AR) cr $$@ $$?
452endef
453
Chris Kay82274932023-01-16 16:53:45 +0000454# Generate the path to one or more preprocessed linker scripts given the paths
455# of their sources.
456#
457# Arguments:
458# $(1) = path to one or more linker script sources
459define linker_script_path
460 $(patsubst %.S,$(BUILD_DIR)/%,$(1))
461endef
462
Juan Castillo73c99d42015-08-18 14:23:04 +0100463# MAKE_BL macro defines the targets and options to build each BL image.
464# Arguments:
Zelalem Aweke434d0492021-07-11 17:25:48 -0500465# $(1) = BL stage
Juan Castillo8f0617e2016-01-05 11:55:36 +0000466# $(2) = FIP command line option (if empty, image will not be included in the FIP)
Masahiro Yamada1dc07142018-01-26 11:42:01 +0900467# $(3) = FIP prefix (optional) (if FWU_, target is fwu_fip instead of fip)
Sumit Gargc6ba9b42019-11-14 16:33:45 +0530468# $(4) = BL encryption flag (optional) (0, 1)
Juan Castillo73c99d42015-08-18 14:23:04 +0100469define MAKE_BL
Zelalem Aweke434d0492021-07-11 17:25:48 -0500470 $(eval BUILD_DIR := ${BUILD_PLAT}/$(1))
471 $(eval BL_SOURCES := $($(call uppercase,$(1))_SOURCES))
Yatharth Kochar5ba8f662015-10-02 13:58:52 +0100472 $(eval SOURCES := $(BL_SOURCES) $(BL_COMMON_SOURCES) $(PLAT_BL_COMMON_SOURCES))
Juan Castillo73c99d42015-08-18 14:23:04 +0100473 $(eval OBJS := $(addprefix $(BUILD_DIR)/,$(call SOURCES_TO_OBJS,$(SOURCES))))
Juan Castillo73c99d42015-08-18 14:23:04 +0100474 $(eval MAPFILE := $(call IMG_MAPFILE,$(1)))
475 $(eval ELF := $(call IMG_ELF,$(1)))
476 $(eval DUMP := $(call IMG_DUMP,$(1)))
477 $(eval BIN := $(call IMG_BIN,$(1)))
Sumit Gargc6ba9b42019-11-14 16:33:45 +0530478 $(eval ENC_BIN := $(call IMG_ENC_BIN,$(1)))
Zelalem Aweke434d0492021-07-11 17:25:48 -0500479 $(eval BL_LIBS := $($(call uppercase,$(1))_LIBS))
Chris Kay82274932023-01-16 16:53:45 +0000480
481 $(eval DEFAULT_LINKER_SCRIPT_SOURCE := $($(call uppercase,$(1))_DEFAULT_LINKER_SCRIPT_SOURCE))
482 $(eval DEFAULT_LINKER_SCRIPT := $(call linker_script_path,$(DEFAULT_LINKER_SCRIPT_SOURCE)))
483
Evan Lloyd51b27702015-12-03 12:19:30 +0000484 # We use sort only to get a list of unique object directory names.
485 # ordering is not relevant but sort removes duplicates.
Chris Kay82274932023-01-16 16:53:45 +0000486 $(eval TEMP_OBJ_DIRS := $(sort $(dir ${OBJS} ${DEFAULT_LINKER_SCRIPT})))
Evan Lloyd51b27702015-12-03 12:19:30 +0000487 # The $(dir ) function leaves a trailing / on the directory names
Masahiro Yamadad014ea62017-01-19 19:31:00 +0900488 # Rip off the / to match directory names with make rule targets.
489 $(eval OBJ_DIRS := $(patsubst %/,%,$(TEMP_OBJ_DIRS)))
Juan Castillo73c99d42015-08-18 14:23:04 +0100490
Evan Lloyd51b27702015-12-03 12:19:30 +0000491# Create generators for object directory structure
Juan Castillo73c99d42015-08-18 14:23:04 +0100492
Masahiro Yamada8012cc52017-11-04 03:12:28 +0900493$(eval $(call MAKE_PREREQ_DIR,${BUILD_DIR},${BUILD_PLAT}))
Evan Lloyd6ba7d272017-04-07 16:58:57 +0100494
Chris Kay82274932023-01-16 16:53:45 +0000495$(eval $(foreach objd,${OBJ_DIRS},
496 $(call MAKE_PREREQ_DIR,${objd},${BUILD_DIR})))
Juan Castillo73c99d42015-08-18 14:23:04 +0100497
Zelalem Aweke434d0492021-07-11 17:25:48 -0500498.PHONY : ${1}_dirs
Evan Lloyd51b27702015-12-03 12:19:30 +0000499
500# We use order-only prerequisites to ensure that directories are created,
501# but do not cause re-builds every time a file is written.
Zelalem Aweke434d0492021-07-11 17:25:48 -0500502${1}_dirs: | ${OBJ_DIRS}
Evan Lloyd51b27702015-12-03 12:19:30 +0000503
504$(eval $(call MAKE_OBJS,$(BUILD_DIR),$(SOURCES),$(1)))
Chris Kay82274932023-01-16 16:53:45 +0000505$(eval $(call MAKE_LD,$(DEFAULT_LINKER_SCRIPT),$(DEFAULT_LINKER_SCRIPT_SOURCE),$(1)))
Zelalem Aweke434d0492021-07-11 17:25:48 -0500506$(eval BL_LDFLAGS := $($(call uppercase,$(1))_LDFLAGS))
Evan Lloyd51b27702015-12-03 12:19:30 +0000507
Roberto Vargas5accce52018-05-22 16:05:42 +0100508ifeq ($(USE_ROMLIB),1)
509$(ELF): romlib.bin
510endif
511
Leon Chen8dccddc2022-03-23 18:51:48 +0800512# MODULE_OBJS can be assigned by vendors with different compiled
513# object file path, and prebuilt object file path.
514$(eval OBJS += $(MODULE_OBJS))
515
Chris Kay82274932023-01-16 16:53:45 +0000516$(ELF): $(OBJS) $(DEFAULT_LINKER_SCRIPT) | $(1)_dirs libraries $(BL_LIBS)
Andre Przywaraee1ba6d2018-09-27 10:56:05 +0100517 $$(ECHO) " LD $$@"
Evan Lloyd414ab852015-12-03 12:58:52 +0000518ifdef MAKE_BUILD_STRINGS
519 $(call MAKE_BUILD_STRINGS, $(BUILD_DIR)/build_message.o)
520else
Patrick Georgi2f5d4a42016-01-28 14:46:18 +0100521 @echo 'const char build_message[] = "Built : "$(BUILD_MESSAGE_TIMESTAMP); \
laurenw-armdddf4282022-07-12 10:12:05 -0500522 const char version_string[] = "${VERSION_STRING}"; \
523 const char version[] = "${VERSION}";' | \
Masahiro Yamadaf2e1d572016-12-22 12:39:55 +0900524 $$(CC) $$(TF_CFLAGS) $$(CFLAGS) -xc -c - -o $(BUILD_DIR)/build_message.o
Evan Lloyd414ab852015-12-03 12:58:52 +0000525endif
Varun Wadekarc2ad38c2019-01-11 14:47:48 -0800526ifneq ($(findstring armlink,$(notdir $(LD))),)
Zelalem Aweke434d0492021-07-11 17:25:48 -0500527 $$(Q)$$(LD) -o $$@ $$(TF_LDFLAGS) $$(LDFLAGS) $(BL_LDFLAGS) --entry=${1}_entrypoint \
Varun Wadekarc2ad38c2019-01-11 14:47:48 -0800528 --predefine="-D__LINKER__=$(__LINKER__)" \
529 --predefine="-DTF_CFLAGS=$(TF_CFLAGS)" \
Zelalem Aweke434d0492021-07-11 17:25:48 -0500530 --map --list="$(MAPFILE)" --scatter=${PLAT_DIR}/scat/${1}.scat \
Varun Wadekarc2ad38c2019-01-11 14:47:48 -0800531 $(LDPATHS) $(LIBWRAPPER) $(LDLIBS) $(BL_LIBS) \
532 $(BUILD_DIR)/build_message.o $(OBJS)
zelalem-awekeedbce9a2019-11-12 16:20:17 -0600533else ifneq ($(findstring gcc,$(notdir $(LD))),)
534 $$(Q)$$(LD) -o $$@ $$(TF_LDFLAGS) $$(LDFLAGS) -Wl,-Map=$(MAPFILE) \
Chris Kay82274932023-01-16 16:53:45 +0000535 $(EXTRA_LINKERFILE) -Wl,--script,$(DEFAULT_LINKER_SCRIPT) $(BUILD_DIR)/build_message.o \
zelalem-awekeedbce9a2019-11-12 16:20:17 -0600536 $(OBJS) $(LDPATHS) $(LIBWRAPPER) $(LDLIBS) $(BL_LIBS)
Varun Wadekarc2ad38c2019-01-11 14:47:48 -0800537else
Masahiro Yamadad986bae2020-01-17 13:44:20 +0900538 $$(Q)$$(LD) -o $$@ $$(TF_LDFLAGS) $$(LDFLAGS) $(BL_LDFLAGS) -Map=$(MAPFILE) \
Chris Kay82274932023-01-16 16:53:45 +0000539 --script $(DEFAULT_LINKER_SCRIPT) $(BUILD_DIR)/build_message.o \
Sathees Balya6baf85b2018-10-18 19:14:21 +0100540 $(OBJS) $(LDPATHS) $(LIBWRAPPER) $(LDLIBS) $(BL_LIBS)
Varun Wadekarc2ad38c2019-01-11 14:47:48 -0800541endif
Christoph Müllner9e4609f2019-04-24 09:45:30 +0200542ifeq ($(DISABLE_BIN_GENERATION),1)
543 @${ECHO_BLANK_LINE}
544 @echo "Built $$@ successfully"
545 @${ECHO_BLANK_LINE}
546endif
Juan Castillo73c99d42015-08-18 14:23:04 +0100547
548$(DUMP): $(ELF)
Andre Przywaraee1ba6d2018-09-27 10:56:05 +0100549 $${ECHO} " OD $$@"
Juan Castillo73c99d42015-08-18 14:23:04 +0100550 $${Q}$${OD} -dx $$< > $$@
551
552$(BIN): $(ELF)
Andre Przywaraee1ba6d2018-09-27 10:56:05 +0100553 $${ECHO} " BIN $$@"
Juan Castillo73c99d42015-08-18 14:23:04 +0100554 $$(Q)$$(OC) -O binary $$< $$@
Evan Lloyd052ab522017-04-11 16:52:00 +0100555 @${ECHO_BLANK_LINE}
Juan Castillo73c99d42015-08-18 14:23:04 +0100556 @echo "Built $$@ successfully"
Evan Lloyd052ab522017-04-11 16:52:00 +0100557 @${ECHO_BLANK_LINE}
Juan Castillo73c99d42015-08-18 14:23:04 +0100558
Zelalem Aweke434d0492021-07-11 17:25:48 -0500559.PHONY: $(1)
Christoph Müllner9e4609f2019-04-24 09:45:30 +0200560ifeq ($(DISABLE_BIN_GENERATION),1)
Zelalem Aweke434d0492021-07-11 17:25:48 -0500561$(1): $(ELF) $(DUMP)
Christoph Müllner9e4609f2019-04-24 09:45:30 +0200562else
Zelalem Aweke434d0492021-07-11 17:25:48 -0500563$(1): $(BIN) $(DUMP)
Christoph Müllner9e4609f2019-04-24 09:45:30 +0200564endif
Juan Castillo73c99d42015-08-18 14:23:04 +0100565
Zelalem Aweke434d0492021-07-11 17:25:48 -0500566all: $(1)
Juan Castillo73c99d42015-08-18 14:23:04 +0100567
Sumit Gargc6ba9b42019-11-14 16:33:45 +0530568ifeq ($(4),1)
569$(call ENCRYPT_FW,$(BIN),$(ENC_BIN))
Zelalem Aweke434d0492021-07-11 17:25:48 -0500570$(if $(2),$(call TOOL_ADD_IMG_PAYLOAD,$(1),$(BIN),--$(2),$(ENC_BIN),$(3), \
Sumit Gargc6ba9b42019-11-14 16:33:45 +0530571 $(ENC_BIN)))
572else
Zelalem Aweke434d0492021-07-11 17:25:48 -0500573$(if $(2),$(call TOOL_ADD_IMG_PAYLOAD,$(1),$(BIN),--$(2),$(BIN),$(3)))
Sumit Gargc6ba9b42019-11-14 16:33:45 +0530574endif
Juan Castillo73c99d42015-08-18 14:23:04 +0100575
576endef
577
Soby Mathew38c14d82017-12-14 17:44:56 +0000578# Convert device tree source file names to matching blobs
579# $(1) = input dts
Nishanth Menon03b397a2016-10-14 01:13:57 +0000580define SOURCES_TO_DTBS
581 $(notdir $(patsubst %.dts,%.dtb,$(filter %.dts,$(1))))
582endef
583
Soby Mathew38c14d82017-12-14 17:44:56 +0000584# MAKE_FDT_DIRS macro creates the prerequisite directories that host the
585# FDT binaries
586# $(1) = output directory
587# $(2) = input dts
588define MAKE_FDT_DIRS
589 $(eval DTBS := $(addprefix $(1)/,$(call SOURCES_TO_DTBS,$(2))))
Nishanth Menon03b397a2016-10-14 01:13:57 +0000590 $(eval TEMP_DTB_DIRS := $(sort $(dir ${DTBS})))
591 # The $(dir ) function leaves a trailing / on the directory names
592 # Rip off the / to match directory names with make rule targets.
593 $(eval DTB_DIRS := $(patsubst %/,%,$(TEMP_DTB_DIRS)))
594
595$(eval $(foreach objd,${DTB_DIRS},$(call MAKE_PREREQ_DIR,${objd},${BUILD_DIR})))
596
597fdt_dirs: ${DTB_DIRS}
Nishanth Menon03b397a2016-10-14 01:13:57 +0000598endef
599
Soby Mathew38c14d82017-12-14 17:44:56 +0000600# MAKE_DTB generate the Flattened device tree binary
Nishanth Menon03b397a2016-10-14 01:13:57 +0000601# $(1) = output directory
602# $(2) = input dts
603define MAKE_DTB
604
Yann Gautier077b3e92018-09-04 10:44:00 +0200605# List of DTB file(s) to generate, based on DTS file basename list
Soby Mathew38c14d82017-12-14 17:44:56 +0000606$(eval DOBJ := $(addprefix $(1)/,$(call SOURCES_TO_DTBS,$(2))))
Yann Gautier077b3e92018-09-04 10:44:00 +0200607# List of the pre-compiled DTS file(s)
Yann Gautier01d237c2018-06-18 16:00:23 +0200608$(eval DPRE := $(addprefix $(1)/,$(patsubst %.dts,%.pre.dts,$(notdir $(2)))))
Yann Gautier077b3e92018-09-04 10:44:00 +0200609# Dependencies of the pre-compiled DTS file(s) on its source and included files
610$(eval DTSDEP := $(patsubst %.dtb,%.o.d,$(DOBJ)))
611# Dependencies of the DT compilation on its pre-compiled DTS
612$(eval DTBDEP := $(patsubst %.dtb,%.d,$(DOBJ)))
Nishanth Menon03b397a2016-10-14 01:13:57 +0000613
Stephen Warren6bc1a302018-02-21 17:13:50 -0700614$(DOBJ): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | fdt_dirs
Andre Przywaraee1ba6d2018-09-27 10:56:05 +0100615 $${ECHO} " CPP $$<"
Yann Gautier077b3e92018-09-04 10:44:00 +0200616 $(eval DTBS := $(addprefix $(1)/,$(call SOURCES_TO_DTBS,$(2))))
Manish Pandey7e94a692019-01-21 14:50:10 +0000617 $$(Q)$$(PP) $$(DTC_CPPFLAGS) -MT $(DTBS) -MMD -MF $(DTSDEP) -o $(DPRE) $$<
Andre Przywaraee1ba6d2018-09-27 10:56:05 +0100618 $${ECHO} " DTC $$<"
Balint Dobszay2d51b552020-01-10 17:16:27 +0100619 $$(Q)$$(DTC) $$(DTC_FLAGS) -d $(DTBDEP) -o $$@ $(DPRE)
Nishanth Menon03b397a2016-10-14 01:13:57 +0000620
Yann Gautier077b3e92018-09-04 10:44:00 +0200621-include $(DTBDEP)
622-include $(DTSDEP)
Nishanth Menon03b397a2016-10-14 01:13:57 +0000623
624endef
625
626# MAKE_DTBS builds flattened device tree sources
627# $(1) = output directory
628# $(2) = list of flattened device tree source files
629define MAKE_DTBS
630 $(eval DOBJS := $(filter %.dts,$(2)))
631 $(eval REMAIN := $(filter-out %.dts,$(2)))
Soby Mathew38c14d82017-12-14 17:44:56 +0000632 $(and $(REMAIN),$(error FDT_SOURCES contain non-DTS files: $(REMAIN)))
Nishanth Menon03b397a2016-10-14 01:13:57 +0000633 $(eval $(foreach obj,$(DOBJS),$(call MAKE_DTB,$(1),$(obj))))
634
Soby Mathew38c14d82017-12-14 17:44:56 +0000635 $(eval $(call MAKE_FDT_DIRS,$(1),$(2)))
636
637dtbs: $(DTBS)
638all: dtbs
Nishanth Menon03b397a2016-10-14 01:13:57 +0000639endef