blob: 1ebc6927b7bbcbac747fcadd327146dc68190762 [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 \
Antonio Nino Diaz43ef3932018-07-03 14:39:47 +010061 ${STDLIB_SOURCES} \
62 ${SPRT_LIB_SOURCES}
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020063
64CACTUS_LINKERFILE := spm/cactus/cactus.ld.S
65
66CACTUS_DEFINES :=
67
68$(eval $(call add_define,CACTUS_DEFINES,DEBUG))
69$(eval $(call add_define,CACTUS_DEFINES,ENABLE_ASSERTIONS))
70$(eval $(call add_define,CACTUS_DEFINES,LOG_LEVEL))
71$(eval $(call add_define,CACTUS_DEFINES,PLAT_${PLAT}))
72ifeq (${ARCH},aarch32)
73 $(eval $(call add_define,CACTUS_DEFINES,AARCH32))
74else
75 $(eval $(call add_define,CACTUS_DEFINES,AARCH64))
76endif
77
Antonio Nino Diaz1451f612018-11-30 10:51:26 +000078$(CACTUS_DTB) : $(BUILD_PLAT)/cactus $(BUILD_PLAT)/cactus/cactus.elf
79$(CACTUS_DTB) : spm/cactus/cactus.dts
80 @echo " DTBGEN spm/cactus/cactus.dts"
81 ${Q}tools/generate_dtb/generate_dtb.sh \
82 cactus spm/cactus/cactus.dts $(BUILD_PLAT)
83 @echo
84 @echo "Built $@ successfully"
85 @echo
86
87cactus: $(CACTUS_DTB) $(AUTOGEN_DIR)/tests_list.h