blob: d964ab13aa538c7ff1f52503d6321a05ac10abd4 [file] [log] [blame]
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +02001#
2# Copyright (c) 2018, Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
Antonio Nino Diaz43ef3932018-07-03 14:39:47 +01007include lib/sprt/sprt_client.mk
8
Antonio Nino Diazb3bce6f2018-11-30 10:51:26 +00009CACTUS_DTB := $(BUILD_PLAT)/cactus.dtb
10
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020011CACTUS_INCLUDES := \
12 -Iinclude \
13 -Iinclude/common \
14 -Iinclude/common/${ARCH} \
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020015 -Iinclude/lib \
16 -Iinclude/lib/${ARCH} \
Antonio Nino Diaz43ef3932018-07-03 14:39:47 +010017 -Iinclude/lib/sprt \
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020018 -Iinclude/lib/utils \
19 -Iinclude/lib/xlat_tables \
20 -Iinclude/runtime_services \
21 -Iinclude/runtime_services/secure_el0_payloads \
22 -Ispm/cactus \
23 -Ispm/common \
Antonio Nino Diaz43ef3932018-07-03 14:39:47 +010024 ${SPRT_LIB_INCLUDES}
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020025
26CACTUS_SOURCES := \
27 $(addprefix spm/cactus/, \
28 aarch64/cactus_entrypoint.S \
29 cactus_main.c \
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020030 cactus_tests_memory_attributes.c \
31 cactus_tests_misc.c \
32 cactus_tests_system_setup.c \
33 ) \
34 $(addprefix spm/common/, \
35 aarch64/sp_arch_helpers.S \
36 sp_helpers.c \
37 ) \
38
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020039# TODO: Remove dependency on TFTF files.
40CACTUS_SOURCES += \
41 tftf/framework/debug.c \
42 tftf/framework/${ARCH}/asm_debug.S
43
44CACTUS_SOURCES += drivers/arm/pl011/${ARCH}/pl011_console.S \
45 lib/${ARCH}/cache_helpers.S \
46 lib/${ARCH}/misc_helpers.S \
Sandrine Bailleux90041122018-11-08 14:10:18 +010047 lib/locks/${ARCH}/spinlock.S \
48 lib/utils/mp_printf.c \
Antonio Nino Diaz43ef3932018-07-03 14:39:47 +010049 ${SPRT_LIB_SOURCES}
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020050
51CACTUS_LINKERFILE := spm/cactus/cactus.ld.S
52
53CACTUS_DEFINES :=
54
55$(eval $(call add_define,CACTUS_DEFINES,DEBUG))
56$(eval $(call add_define,CACTUS_DEFINES,ENABLE_ASSERTIONS))
57$(eval $(call add_define,CACTUS_DEFINES,LOG_LEVEL))
58$(eval $(call add_define,CACTUS_DEFINES,PLAT_${PLAT}))
59ifeq (${ARCH},aarch32)
60 $(eval $(call add_define,CACTUS_DEFINES,AARCH32))
61else
62 $(eval $(call add_define,CACTUS_DEFINES,AARCH64))
63endif
64
Antonio Nino Diazb3bce6f2018-11-30 10:51:26 +000065$(CACTUS_DTB) : $(BUILD_PLAT)/cactus $(BUILD_PLAT)/cactus/cactus.elf
66$(CACTUS_DTB) : spm/cactus/cactus.dts
67 @echo " DTBGEN spm/cactus/cactus.dts"
68 ${Q}tools/generate_dtb/generate_dtb.sh \
69 cactus spm/cactus/cactus.dts $(BUILD_PLAT)
70 @echo
71 @echo "Built $@ successfully"
72 @echo
73
74cactus: $(CACTUS_DTB) $(AUTOGEN_DIR)/tests_list.h