xref: /optee_os/core/sub.mk (revision c96d7091b566e1c37410bfddb5b3c5280ddcc13a)
1subdirs-y += kernel
2subdirs-y += mm
3subdirs-y += crypto
4subdirs-y += tee
5subdirs-y += drivers
6
7ifeq ($(CFG_WITH_USER_TA),y)
8gensrcs-y += ta_pub_key
9produce-ta_pub_key = ta_pub_key.c
10depends-ta_pub_key = $(TA_SIGN_KEY) scripts/pem_to_pub_c.py
11recipe-ta_pub_key = scripts/pem_to_pub_c.py --prefix ta_pub_key \
12		--key $(TA_SIGN_KEY) --out $(sub-dir-out)/ta_pub_key.c
13cleanfiles += $(sub-dir-out)/ta_pub_key.c
14
15gensrcs-y += ldelf
16produce-ldelf = ldelf_hex.c
17depends-ldelf = scripts/gen_ldelf_hex.py $(out-dir)/ldelf/ldelf.elf
18recipe-ldelf = scripts/gen_ldelf_hex.py --input $(out-dir)/ldelf/ldelf.elf \
19			--output $(sub-dir-out)/ldelf_hex.c
20cleanfiles += $(sub-dir-out)/ldelf_hex.c
21endif
22
23ifeq ($(CFG_WITH_USER_TA)-$(CFG_EARLY_TA),y-y)
24define process_early_ta
25early-ta-$1-uuid := $(firstword $(subst ., ,$(notdir $1)))
26gensrcs-y += early-ta-$1
27produce-early-ta-$1 = early_ta_$$(early-ta-$1-uuid).c
28depends-early-ta-$1 = $1 scripts/ta_bin_to_c.py
29recipe-early-ta-$1 = scripts/ta_bin_to_c.py --compress --ta $1 \
30		--out $(sub-dir-out)/early_ta_$$(early-ta-$1-uuid).c
31cleanfiles += $(sub-dir-out)/early_ta_$$(early-ta-$1-uuid).c
32endef
33$(foreach f, $(EARLY_TA_PATHS), $(eval $(call process_early_ta,$(f))))
34$(foreach f, $(CFG_IN_TREE_EARLY_TAS), $(eval $(call \
35	process_early_ta,$(out-dir)/ta/$(f).stripped.elf)))
36endif
37
38ifeq ($(CFG_EMBED_DTB),y)
39core-embed-fdt-dts = $(arch-dir)/dts/$(CFG_EMBED_DTB_SOURCE_FILE)
40core-embed-fdt-dtb = $(out-dir)/$(arch-dir)/dts/$(CFG_EMBED_DTB_SOURCE_FILE:.dts=.dtb)
41core-embed-fdt-c = $(out-dir)/$(arch-dir)/dts/$(CFG_EMBED_DTB_SOURCE_FILE:.dts=.c)
42gensrcs-y += embedded_secure_dtb
43cleanfiles += $(core-embed-fdt-c)
44produce-embedded_secure_dtb = arch/$(ARCH)/dts/$(CFG_EMBED_DTB_SOURCE_FILE:.dts=.c)
45depends-embedded_secure_dtb = $(core-embed-fdt-dtb) scripts/bin_to_c.py
46recipe-embedded_secure_dtb = scripts/bin_to_c.py \
47				--bin $(core-embed-fdt-dtb) \
48				--vname embedded_secure_dtb \
49				--out $(core-embed-fdt-c)
50$(eval $(call gen-dtb-file,$(core-embed-fdt-dts),$(core-embed-fdt-dtb)))
51endif
52