blob: 056b4a7af6ad540b4ccdf2a886e642f2028e2ce3 [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} \
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020015 -Iinclude/lib \
16 -Iinclude/lib/${ARCH} \
17 -Iinclude/lib/stdlib \
18 -Iinclude/lib/stdlib/sys \
Antonio Nino Diaz43ef3932018-07-03 14:39:47 +010019 -Iinclude/lib/sprt \
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020020 -Iinclude/lib/utils \
21 -Iinclude/lib/xlat_tables \
22 -Iinclude/runtime_services \
23 -Iinclude/runtime_services/secure_el0_payloads \
24 -Ispm/cactus \
25 -Ispm/common \
Antonio Nino Diaz43ef3932018-07-03 14:39:47 +010026 ${SPRT_LIB_INCLUDES}
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020027
28CACTUS_SOURCES := \
29 $(addprefix spm/cactus/, \
30 aarch64/cactus_entrypoint.S \
31 cactus_main.c \
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020032 cactus_tests_memory_attributes.c \
33 cactus_tests_misc.c \
34 cactus_tests_system_setup.c \
35 ) \
36 $(addprefix spm/common/, \
37 aarch64/sp_arch_helpers.S \
38 sp_helpers.c \
39 ) \
40
41STDLIB_SOURCES := $(addprefix lib/stdlib/, \
42 assert.c \
43 mem.c \
44 putchar.c \
45 printf.c \
46 rand.c \
47 strlen.c \
48 subr_prf.c \
49)
50
51# TODO: Remove dependency on TFTF files.
52CACTUS_SOURCES += \
53 tftf/framework/debug.c \
54 tftf/framework/${ARCH}/asm_debug.S
55
56CACTUS_SOURCES += drivers/arm/pl011/${ARCH}/pl011_console.S \
57 lib/${ARCH}/cache_helpers.S \
58 lib/${ARCH}/misc_helpers.S \
Sandrine Bailleux750b7cc2018-11-08 14:10:18 +010059 lib/locks/${ARCH}/spinlock.S \
60 lib/utils/mp_printf.c \
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