blob: 03d809d104341f0ca22f6bce29d9dcd99d38142c [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 Diaz1451f612018-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} \
15 -Iinclude/drivers \
16 -Iinclude/drivers/arm \
17 -Iinclude/lib \
18 -Iinclude/lib/${ARCH} \
19 -Iinclude/lib/stdlib \
20 -Iinclude/lib/stdlib/sys \
Antonio Nino Diaz43ef3932018-07-03 14:39:47 +010021 -Iinclude/lib/sprt \
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020022 -Iinclude/lib/utils \
23 -Iinclude/lib/xlat_tables \
24 -Iinclude/runtime_services \
25 -Iinclude/runtime_services/secure_el0_payloads \
26 -Ispm/cactus \
27 -Ispm/common \
Antonio Nino Diaz43ef3932018-07-03 14:39:47 +010028 ${SPRT_LIB_INCLUDES}
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020029
30CACTUS_SOURCES := \
31 $(addprefix spm/cactus/, \
32 aarch64/cactus_entrypoint.S \
33 cactus_main.c \
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020034 cactus_tests_memory_attributes.c \
35 cactus_tests_misc.c \
36 cactus_tests_system_setup.c \
37 ) \
38 $(addprefix spm/common/, \
39 aarch64/sp_arch_helpers.S \
40 sp_helpers.c \
41 ) \
42
43STDLIB_SOURCES := $(addprefix lib/stdlib/, \
44 assert.c \
45 mem.c \
46 putchar.c \
47 printf.c \
48 rand.c \
49 strlen.c \
50 subr_prf.c \
51)
52
53# TODO: Remove dependency on TFTF files.
54CACTUS_SOURCES += \
55 tftf/framework/debug.c \
56 tftf/framework/${ARCH}/asm_debug.S
57
58CACTUS_SOURCES += drivers/arm/pl011/${ARCH}/pl011_console.S \
59 lib/${ARCH}/cache_helpers.S \
60 lib/${ARCH}/misc_helpers.S \
Sandrine Bailleux750b7cc2018-11-08 14:10:18 +010061 lib/locks/${ARCH}/spinlock.S \
62 lib/utils/mp_printf.c \
Antonio Nino Diaz43ef3932018-07-03 14:39:47 +010063 ${STDLIB_SOURCES} \
64 ${SPRT_LIB_SOURCES}
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020065
66CACTUS_LINKERFILE := spm/cactus/cactus.ld.S
67
68CACTUS_DEFINES :=
69
70$(eval $(call add_define,CACTUS_DEFINES,DEBUG))
71$(eval $(call add_define,CACTUS_DEFINES,ENABLE_ASSERTIONS))
72$(eval $(call add_define,CACTUS_DEFINES,LOG_LEVEL))
73$(eval $(call add_define,CACTUS_DEFINES,PLAT_${PLAT}))
74ifeq (${ARCH},aarch32)
75 $(eval $(call add_define,CACTUS_DEFINES,AARCH32))
76else
77 $(eval $(call add_define,CACTUS_DEFINES,AARCH64))
78endif
79
Antonio Nino Diaz1451f612018-11-30 10:51:26 +000080$(CACTUS_DTB) : $(BUILD_PLAT)/cactus $(BUILD_PLAT)/cactus/cactus.elf
81$(CACTUS_DTB) : spm/cactus/cactus.dts
82 @echo " DTBGEN spm/cactus/cactus.dts"
83 ${Q}tools/generate_dtb/generate_dtb.sh \
84 cactus spm/cactus/cactus.dts $(BUILD_PLAT)
85 @echo
86 @echo "Built $@ successfully"
87 @echo
88
89cactus: $(CACTUS_DTB) $(AUTOGEN_DIR)/tests_list.h