1# 2# Copyright (c) 2013-2016, ARM Limited and Contributors. All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are met: 6# 7# Redistributions of source code must retain the above copyright notice, this 8# list of conditions and the following disclaimer. 9# 10# Redistributions in binary form must reproduce the above copyright notice, 11# this list of conditions and the following disclaimer in the documentation 12# and/or other materials provided with the distribution. 13# 14# Neither the name of ARM nor the names of its contributors may be used 15# to endorse or promote products derived from this software without specific 16# prior written permission. 17# 18# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28# POSSIBILITY OF SUCH DAMAGE. 29# 30 31# 32# Trusted Firmware Version 33# 34VERSION_MAJOR := 1 35VERSION_MINOR := 2 36 37# Default goal is build all images 38.DEFAULT_GOAL := all 39 40MAKE_HELPERS_DIRECTORY := make_helpers/ 41include ${MAKE_HELPERS_DIRECTORY}build_macros.mk 42 43################################################################################ 44# Default values for build configurations 45################################################################################ 46 47# Build verbosity 48V := 0 49# Debug build 50DEBUG := 0 51# Build platform 52DEFAULT_PLAT := fvp 53PLAT := ${DEFAULT_PLAT} 54# SPD choice 55SPD := none 56# Base commit to perform code check on 57BASE_COMMIT := origin/master 58# NS timer register save and restore 59NS_TIMER_SWITCH := 0 60# By default, BL1 acts as the reset handler, not BL31 61RESET_TO_BL31 := 0 62# Include FP registers in cpu context 63CTX_INCLUDE_FPREGS := 0 64# Determine the version of ARM GIC architecture to use for interrupt management 65# in EL3. The platform port can change this value if needed. 66ARM_GIC_ARCH := 2 67# Determine the version of ARM CCI product used in the platform. The platform 68# port can change this value if needed. 69ARM_CCI_PRODUCT_ID := 400 70# Flag used to indicate if ASM_ASSERTION should be enabled for the build. 71# This defaults to being present in DEBUG builds only. 72ASM_ASSERTION := ${DEBUG} 73# Build option to choose whether Trusted firmware uses Coherent memory or not. 74USE_COHERENT_MEM := 1 75# Flag used to choose the power state format viz Extended State-ID or the Original 76# format. 77PSCI_EXTENDED_STATE_ID := 0 78# Default FIP file name 79FIP_NAME := fip.bin 80# Default FWU_FIP file name 81FWU_FIP_NAME := fwu_fip.bin 82# By default, use the -pedantic option in the gcc command line 83DISABLE_PEDANTIC := 0 84# Flags to generate the Chain of Trust 85GENERATE_COT := 0 86CREATE_KEYS := 1 87SAVE_KEYS := 0 88# Flags to build TF with Trusted Boot support 89TRUSTED_BOARD_BOOT := 0 90# By default, consider that the platform's reset address is not programmable. 91# The platform Makefile is free to override this value. 92PROGRAMMABLE_RESET_ADDRESS := 0 93# Build flag to treat usage of deprecated platform and framework APIs as error. 94ERROR_DEPRECATED := 0 95# By default, consider that the platform may release several CPUs out of reset. 96# The platform Makefile is free to override this value. 97COLD_BOOT_SINGLE_CPU := 0 98# Flag to introduce an infinite loop in BL1 just before it exits into the next 99# image. This is meant to help debugging the post-BL2 phase. 100SPIN_ON_BL1_EXIT := 0 101# Build PL011 UART driver in minimal generic UART mode 102PL011_GENERIC_UART := 0 103 104 105################################################################################ 106# Checkpatch script options 107################################################################################ 108 109CHECK_IGNORE := --ignore COMPLEX_MACRO \ 110 --ignore GERRIT_CHANGE_ID \ 111 --ignore GIT_COMMIT_ID 112CHECKPATCH_ARGS := --no-tree --no-signoff ${CHECK_IGNORE} 113CHECKCODE_ARGS := --no-patch --no-tree --no-signoff ${CHECK_IGNORE} 114# Do not check the coding style on C library files 115INCLUDE_DIRS_TO_CHECK := $(sort $(filter-out include/stdlib, $(wildcard include/*))) 116LIB_DIRS_TO_CHECK := $(sort $(filter-out lib/stdlib, $(wildcard lib/*))) 117ROOT_DIRS_TO_CHECK := $(sort $(filter-out lib include, $(wildcard *)))) 118CHECK_PATHS := ${ROOT_DIRS_TO_CHECK} ${INCLUDE_DIRS_TO_CHECK} ${LIB_DIRS_TO_CHECK} 119 120 121################################################################################ 122# Process build options 123################################################################################ 124 125# Verbose flag 126ifeq (${V},0) 127 Q=@ 128 CHECKCODE_ARGS += --no-summary --terse 129else 130 Q= 131endif 132export Q 133 134# Process Debug flag 135$(eval $(call add_define,DEBUG)) 136ifneq (${DEBUG}, 0) 137 BUILD_TYPE := debug 138 CFLAGS += -g 139 ASFLAGS += -g -Wa,--gdwarf-2 140 # Use LOG_LEVEL_INFO by default for debug builds 141 LOG_LEVEL := 40 142else 143 BUILD_TYPE := release 144 $(eval $(call add_define,NDEBUG)) 145 # Use LOG_LEVEL_NOTICE by default for release builds 146 LOG_LEVEL := 20 147endif 148 149# Default build string (git branch and commit) 150ifeq (${BUILD_STRING},) 151 BUILD_STRING := $(shell git log -n 1 --pretty=format:"%h") 152endif 153VERSION_STRING := v${VERSION_MAJOR}.${VERSION_MINOR}(${BUILD_TYPE}):${BUILD_STRING} 154 155# The cert_create tool cannot generate certificates individually, so we use the 156# target 'certificates' to create them all 157ifneq (${GENERATE_COT},0) 158 FIP_DEPS += certificates 159 FWU_FIP_DEPS += fwu_certificates 160endif 161 162 163################################################################################ 164# Toolchain 165################################################################################ 166 167CC := ${CROSS_COMPILE}gcc 168CPP := ${CROSS_COMPILE}cpp 169AS := ${CROSS_COMPILE}gcc 170AR := ${CROSS_COMPILE}ar 171LD := ${CROSS_COMPILE}ld 172OC := ${CROSS_COMPILE}objcopy 173OD := ${CROSS_COMPILE}objdump 174NM := ${CROSS_COMPILE}nm 175PP := ${CROSS_COMPILE}gcc -E 176 177ASFLAGS += -nostdinc -ffreestanding -Wa,--fatal-warnings \ 178 -Werror -Wmissing-include-dirs \ 179 -mgeneral-regs-only -D__ASSEMBLY__ \ 180 ${DEFINES} ${INCLUDES} 181CFLAGS += -nostdinc -ffreestanding -Wall \ 182 -Werror -Wmissing-include-dirs \ 183 -mgeneral-regs-only -mstrict-align \ 184 -std=c99 -c -Os \ 185 ${DEFINES} ${INCLUDES} 186CFLAGS += -ffunction-sections -fdata-sections 187 188LDFLAGS += --fatal-warnings -O1 189LDFLAGS += --gc-sections 190 191 192################################################################################ 193# Common sources and include directories 194################################################################################ 195 196BL_COMMON_SOURCES += common/bl_common.c \ 197 common/tf_printf.c \ 198 common/aarch64/debug.S \ 199 lib/aarch64/cache_helpers.S \ 200 lib/aarch64/misc_helpers.S \ 201 lib/aarch64/xlat_helpers.c \ 202 lib/stdlib/abort.c \ 203 lib/stdlib/assert.c \ 204 lib/stdlib/exit.c \ 205 lib/stdlib/mem.c \ 206 lib/stdlib/printf.c \ 207 lib/stdlib/putchar.c \ 208 lib/stdlib/puts.c \ 209 lib/stdlib/sscanf.c \ 210 lib/stdlib/strchr.c \ 211 lib/stdlib/strcmp.c \ 212 lib/stdlib/strlen.c \ 213 lib/stdlib/strncmp.c \ 214 lib/stdlib/subr_prf.c \ 215 plat/common/aarch64/platform_helpers.S 216 217INCLUDES += -Iinclude/bl1 \ 218 -Iinclude/bl31 \ 219 -Iinclude/bl31/services \ 220 -Iinclude/common \ 221 -Iinclude/drivers \ 222 -Iinclude/drivers/arm \ 223 -Iinclude/drivers/auth \ 224 -Iinclude/drivers/io \ 225 -Iinclude/drivers/ti/uart \ 226 -Iinclude/lib \ 227 -Iinclude/lib/aarch64 \ 228 -Iinclude/lib/cpus/aarch64 \ 229 -Iinclude/plat/common \ 230 -Iinclude/stdlib \ 231 -Iinclude/stdlib/sys \ 232 ${PLAT_INCLUDES} \ 233 ${SPD_INCLUDES} 234 235 236################################################################################ 237# Generic definitions 238################################################################################ 239 240include ${MAKE_HELPERS_DIRECTORY}plat_helpers.mk 241 242BUILD_BASE := ./build 243BUILD_PLAT := ${BUILD_BASE}/${PLAT}/${BUILD_TYPE} 244 245SPDS := $(sort $(filter-out none, $(patsubst services/spd/%,%,$(wildcard services/spd/*)))) 246 247# Platforms providing their own TBB makefile may override this value 248INCLUDE_TBBR_MK := 1 249 250 251################################################################################ 252# Include SPD Makefile if one has been specified 253################################################################################ 254 255ifneq (${SPD},none) 256ifdef EL3_PAYLOAD_BASE 257 $(warning "SPD and EL3_PAYLOAD_BASE are incompatible build options.") 258 $(warning "The SPD and its BL32 companion will be present but ignored.") 259endif 260 # We expect to locate an spd.mk under the specified SPD directory 261 SPD_MAKE := $(wildcard services/spd/${SPD}/${SPD}.mk) 262 263 ifeq (${SPD_MAKE},) 264 $(error Error: No services/spd/${SPD}/${SPD}.mk located) 265 endif 266 $(info Including ${SPD_MAKE}) 267 include ${SPD_MAKE} 268 269 # If there's BL32 companion for the chosen SPD, we expect that the SPD's 270 # Makefile would set NEED_BL32 to "yes". In this case, the build system 271 # supports two mutually exclusive options: 272 # * BL32 is built from source: then BL32_SOURCES must contain the list 273 # of source files to build BL32 274 # * BL32 is a prebuilt binary: then BL32 must point to the image file 275 # that will be included in the FIP 276 # If both BL32_SOURCES and BL32 are defined, the binary takes precedence 277 # over the sources. 278endif 279 280 281################################################################################ 282# Include the platform specific Makefile after the SPD Makefile (the platform 283# makefile may use all previous definitions in this file) 284################################################################################ 285 286include ${PLAT_MAKEFILE_FULL} 287 288# If the platform has not defined ENABLE_PLAT_COMPAT, then enable it by default 289ifndef ENABLE_PLAT_COMPAT 290ENABLE_PLAT_COMPAT := 1 291endif 292 293# Include the platform compatibility helpers for PSCI 294ifneq (${ENABLE_PLAT_COMPAT}, 0) 295include plat/compat/plat_compat.mk 296endif 297 298# Include the CPU specific operations makefile, which provides default 299# values for all CPU errata workarounds and CPU specific optimisations. 300# This can be overridden by the platform. 301include lib/cpus/cpu-ops.mk 302 303 304################################################################################ 305# Check incompatible options 306################################################################################ 307 308ifdef EL3_PAYLOAD_BASE 309 ifdef BL33_BASE 310 $(warning "BL33_BASE and EL3_PAYLOAD_BASE are incompatible \ 311 build options. EL3_PAYLOAD_BASE has priority.") 312 endif 313endif 314 315ifeq (${NEED_BL33},yes) 316 ifdef EL3_PAYLOAD_BASE 317 $(warning "BL33 image is not needed when option \ 318 BL33_PAYLOAD_BASE is used and won't be added to the FIP file.") 319 endif 320 ifdef BL33_BASE 321 $(warning "BL33 image is not needed when option BL33_BASE is \ 322 used and won't be added to the FIP file.") 323 endif 324endif 325 326 327################################################################################ 328# Process platform overrideable behaviour 329################################################################################ 330 331# Check if -pedantic option should be used 332ifeq (${DISABLE_PEDANTIC},0) 333 CFLAGS += -pedantic 334endif 335 336# Using the ARM Trusted Firmware BL2 implies that a BL33 image also needs to be 337# supplied for the FIP and Certificate generation tools. This flag can be 338# overridden by the platform. 339ifdef BL2_SOURCES 340 ifdef EL3_PAYLOAD_BASE 341 # If booting an EL3 payload there is no need for a BL33 image 342 # in the FIP file. 343 NEED_BL33 := no 344 else 345 ifdef BL33_BASE 346 # If booting a BL33 preloaded image there is no need of 347 # another one in the FIP file. 348 NEED_BL33 := no 349 else 350 NEED_BL33 ?= yes 351 endif 352 endif 353endif 354 355# Process TBB related flags 356ifneq (${GENERATE_COT},0) 357 # Common cert_create options 358 ifneq (${CREATE_KEYS},0) 359 $(eval CRT_ARGS += -n) 360 $(eval FWU_CRT_ARGS += -n) 361 ifneq (${SAVE_KEYS},0) 362 $(eval CRT_ARGS += -k) 363 $(eval FWU_CRT_ARGS += -k) 364 endif 365 endif 366 # Include TBBR makefile (unless the platform indicates otherwise) 367 ifeq (${INCLUDE_TBBR_MK},1) 368 include make_helpers/tbbr/tbbr_tools.mk 369 endif 370endif 371 372 373################################################################################ 374# Auxiliary tools (fip_create, cert_create, etc) 375################################################################################ 376 377# Variables for use with Certificate Generation Tool 378CRTTOOLPATH ?= tools/cert_create 379CRTTOOL ?= ${CRTTOOLPATH}/cert_create 380 381# Variables for use with Firmware Image Package 382FIPTOOLPATH ?= tools/fip_create 383FIPTOOL ?= ${FIPTOOLPATH}/fip_create 384 385 386################################################################################ 387# Build options checks 388################################################################################ 389 390$(eval $(call assert_boolean,DEBUG)) 391$(eval $(call assert_boolean,NS_TIMER_SWITCH)) 392$(eval $(call assert_boolean,RESET_TO_BL31)) 393$(eval $(call assert_boolean,CTX_INCLUDE_FPREGS)) 394$(eval $(call assert_boolean,ASM_ASSERTION)) 395$(eval $(call assert_boolean,USE_COHERENT_MEM)) 396$(eval $(call assert_boolean,DISABLE_PEDANTIC)) 397$(eval $(call assert_boolean,GENERATE_COT)) 398$(eval $(call assert_boolean,CREATE_KEYS)) 399$(eval $(call assert_boolean,SAVE_KEYS)) 400$(eval $(call assert_boolean,TRUSTED_BOARD_BOOT)) 401$(eval $(call assert_boolean,PROGRAMMABLE_RESET_ADDRESS)) 402$(eval $(call assert_boolean,COLD_BOOT_SINGLE_CPU)) 403$(eval $(call assert_boolean,PSCI_EXTENDED_STATE_ID)) 404$(eval $(call assert_boolean,ERROR_DEPRECATED)) 405$(eval $(call assert_boolean,ENABLE_PLAT_COMPAT)) 406$(eval $(call assert_boolean,SPIN_ON_BL1_EXIT)) 407$(eval $(call assert_boolean,PL011_GENERIC_UART)) 408 409 410################################################################################ 411# Add definitions to the cpp preprocessor based on the current build options. 412# This is done after including the platform specific makefile to allow the 413# platform to overwrite the default options 414################################################################################ 415 416$(eval $(call add_define,PLAT_${PLAT})) 417$(eval $(call add_define,NS_TIMER_SWITCH)) 418$(eval $(call add_define,RESET_TO_BL31)) 419$(eval $(call add_define,CTX_INCLUDE_FPREGS)) 420$(eval $(call add_define,ARM_GIC_ARCH)) 421$(eval $(call add_define,ARM_CCI_PRODUCT_ID)) 422$(eval $(call add_define,ASM_ASSERTION)) 423$(eval $(call add_define,LOG_LEVEL)) 424$(eval $(call add_define,USE_COHERENT_MEM)) 425$(eval $(call add_define,TRUSTED_BOARD_BOOT)) 426$(eval $(call add_define,PROGRAMMABLE_RESET_ADDRESS)) 427$(eval $(call add_define,COLD_BOOT_SINGLE_CPU)) 428$(eval $(call add_define,PSCI_EXTENDED_STATE_ID)) 429$(eval $(call add_define,ERROR_DEPRECATED)) 430$(eval $(call add_define,ENABLE_PLAT_COMPAT)) 431$(eval $(call add_define,SPIN_ON_BL1_EXIT)) 432$(eval $(call add_define,PL011_GENERIC_UART)) 433# Define the EL3_PAYLOAD_BASE flag only if it is provided. 434ifdef EL3_PAYLOAD_BASE 435 $(eval $(call add_define,EL3_PAYLOAD_BASE)) 436else 437 # Define the BL33_BASE flag only if it is provided and EL3_PAYLOAD_BASE 438 # is not defined, as it has priority. 439 ifdef BL33_BASE 440 $(eval $(call add_define,BL33_BASE)) 441 endif 442endif 443 444 445################################################################################ 446# Include BL specific makefiles 447################################################################################ 448 449ifdef BL1_SOURCES 450NEED_BL1 := yes 451include bl1/bl1.mk 452endif 453 454ifdef BL2_SOURCES 455NEED_BL2 := yes 456include bl2/bl2.mk 457endif 458 459ifdef BL2U_SOURCES 460NEED_BL2U := yes 461include bl2u/bl2u.mk 462endif 463 464ifdef BL31_SOURCES 465# When booting an EL3 payload, there is no need to compile the BL31 image nor 466# put it in the FIP. 467ifndef EL3_PAYLOAD_BASE 468NEED_BL31 := yes 469include bl31/bl31.mk 470endif 471endif 472 473 474################################################################################ 475# Build targets 476################################################################################ 477 478.PHONY: all msg_start clean realclean distclean cscope locate-checkpatch checkcodebase checkpatch fiptool fip fwu_fip certtool 479.SUFFIXES: 480 481all: msg_start 482 483msg_start: 484 @echo "Building ${PLAT}" 485 486# Check if deprecated declarations should be treated as error or not. 487ifeq (${ERROR_DEPRECATED},0) 488 CFLAGS += -Wno-error=deprecated-declarations 489endif 490 491# Expand build macros for the different images 492ifeq (${NEED_BL1},yes) 493$(eval $(call MAKE_BL,1)) 494endif 495 496ifeq (${NEED_BL2},yes) 497$(if ${BL2}, $(eval $(call MAKE_TOOL_ARGS,2,${BL2},tb-fw)),\ 498 $(eval $(call MAKE_BL,2,tb-fw))) 499endif 500 501ifeq (${NEED_BL31},yes) 502BL31_SOURCES += ${SPD_SOURCES} 503$(if ${BL31}, $(eval $(call MAKE_TOOL_ARGS,31,${BL31},soc-fw)),\ 504 $(eval $(call MAKE_BL,31,soc-fw))) 505endif 506 507# If a BL32 image is needed but neither BL32 nor BL32_SOURCES is defined, the 508# build system will call FIP_ADD_IMG to print a warning message and abort the 509# process. Note that the dependency on BL32 applies to the FIP only. 510ifeq (${NEED_BL32},yes) 511$(if ${BL32}, $(eval $(call MAKE_TOOL_ARGS,32,${BL32},tos-fw)),\ 512 $(if ${BL32_SOURCES}, $(eval $(call MAKE_BL,32,tos-fw)),\ 513 $(eval $(call FIP_ADD_IMG,BL32,--tos-fw)))) 514endif 515 516# Add the BL33 image if required by the platform 517ifeq (${NEED_BL33},yes) 518$(eval $(call FIP_ADD_IMG,BL33,--nt-fw)) 519endif 520 521ifeq (${NEED_BL2U},yes) 522BL2U_PATH := $(if ${BL2U},${BL2U},$(call IMG_BIN,2u)) 523$(if ${BL2U}, ,$(eval $(call MAKE_BL,2u))) 524$(eval $(call FWU_FIP_ADD_PAYLOAD,${BL2U_PATH},--ap-fwu-cfg)) 525endif 526 527locate-checkpatch: 528ifndef CHECKPATCH 529 $(error "Please set CHECKPATCH to point to the Linux checkpatch.pl file, eg: CHECKPATCH=../linux/script/checkpatch.pl") 530else 531ifeq (,$(wildcard ${CHECKPATCH})) 532 $(error "The file CHECKPATCH points to cannot be found, use eg: CHECKPATCH=../linux/script/checkpatch.pl") 533endif 534endif 535 536clean: 537 @echo " CLEAN" 538 ${Q}rm -rf ${BUILD_PLAT} 539 ${Q}${MAKE} --no-print-directory -C ${FIPTOOLPATH} clean 540 ${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${CRTTOOLPATH} clean 541 542realclean distclean: 543 @echo " REALCLEAN" 544 ${Q}rm -rf ${BUILD_BASE} 545 ${Q}rm -f ${CURDIR}/cscope.* 546 ${Q}${MAKE} --no-print-directory -C ${FIPTOOLPATH} clean 547 ${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${CRTTOOLPATH} clean 548 549checkcodebase: locate-checkpatch 550 @echo " CHECKING STYLE" 551 @if test -d .git ; then \ 552 git ls-files | grep -v stdlib | while read GIT_FILE ; do ${CHECKPATCH} ${CHECKCODE_ARGS} -f $$GIT_FILE ; done ; \ 553 else \ 554 find . -type f -not -iwholename "*.git*" -not -iwholename "*build*" -not -iwholename "*stdlib*" -exec ${CHECKPATCH} ${CHECKCODE_ARGS} -f {} \; ; \ 555 fi 556 557checkpatch: locate-checkpatch 558 @echo " CHECKING STYLE" 559 ${Q}git log -p ${BASE_COMMIT}..HEAD -- ${CHECK_PATHS} | ${CHECKPATCH} ${CHECKPATCH_ARGS} - || true 560 561certtool: ${CRTTOOL} 562 563.PHONY: ${CRTTOOL} 564${CRTTOOL}: 565 ${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${CRTTOOLPATH} 566 @echo 567 @echo "Built $@ successfully" 568 @echo 569 570ifneq (${GENERATE_COT},0) 571certificates: ${CRT_DEPS} ${CRTTOOL} 572 ${Q}${CRTTOOL} ${CRT_ARGS} 573 @echo 574 @echo "Built $@ successfully" 575 @echo "Certificates can be found in ${BUILD_PLAT}" 576 @echo 577endif 578 579${BUILD_PLAT}/${FIP_NAME}: ${FIP_DEPS} ${FIPTOOL} 580 ${Q}${FIPTOOL} --dump ${FIP_ARGS} $@ 581 @echo 582 @echo "Built $@ successfully" 583 @echo 584 585ifneq (${GENERATE_COT},0) 586fwu_certificates: ${FWU_CRT_DEPS} ${CRTTOOL} 587 ${Q}${CRTTOOL} ${FWU_CRT_ARGS} 588 @echo 589 @echo "Built $@ successfully" 590 @echo "FWU certificates can be found in ${BUILD_PLAT}" 591 @echo 592endif 593 594${BUILD_PLAT}/${FWU_FIP_NAME}: ${FWU_FIP_DEPS} ${FIPTOOL} 595 ${Q}${FIPTOOL} --dump ${FWU_FIP_ARGS} $@ 596 @echo 597 @echo "Built $@ successfully" 598 @echo 599 600fiptool: ${FIPTOOL} 601fip: ${BUILD_PLAT}/${FIP_NAME} 602fwu_fip: ${BUILD_PLAT}/${FWU_FIP_NAME} 603 604.PHONY: ${FIPTOOL} 605${FIPTOOL}: 606 ${Q}${MAKE} --no-print-directory -C ${FIPTOOLPATH} 607 608cscope: 609 @echo " CSCOPE" 610 ${Q}find ${CURDIR} -name "*.[chsS]" > cscope.files 611 ${Q}cscope -b -q -k 612 613help: 614 @echo "usage: ${MAKE} PLAT=<${PLATFORM_LIST}> [OPTIONS] [TARGET]" 615 @echo "" 616 @echo "PLAT is used to specify which platform you wish to build." 617 @echo "If no platform is specified, PLAT defaults to: ${DEFAULT_PLAT}" 618 @echo "" 619 @echo "Please refer to the User Guide for a list of all supported options." 620 @echo "Note that the build system doesn't track dependencies for build " 621 @echo "options. Therefore, if any of the build options are changed " 622 @echo "from a previous build, a clean build must be performed." 623 @echo "" 624 @echo "Supported Targets:" 625 @echo " all Build all individual bootloader binaries" 626 @echo " bl1 Build the BL1 binary" 627 @echo " bl2 Build the BL2 binary" 628 @echo " bl2u Build the BL2U binary" 629 @echo " bl31 Build the BL31 binary" 630 @echo " bl32 Build the BL32 binary" 631 @echo " certificates Build the certificates (requires 'GENERATE_COT=1')" 632 @echo " fip Build the Firmware Image Package (FIP)" 633 @echo " fwu_fip Build the FWU Firmware Image Package (FIP)" 634 @echo " checkcodebase Check the coding style of the entire source tree" 635 @echo " checkpatch Check the coding style on changes in the current" 636 @echo " branch against BASE_COMMIT (default origin/master)" 637 @echo " clean Clean the build for the selected platform" 638 @echo " cscope Generate cscope index" 639 @echo " distclean Remove all build artifacts for all platforms" 640 @echo " certtool Build the Certificate generation tool" 641 @echo " fiptool Build the Firmware Image Package(FIP) creation tool" 642 @echo "" 643 @echo "Note: most build targets require PLAT to be set to a specific platform." 644 @echo "" 645 @echo "example: build all targets for the FVP platform:" 646 @echo " CROSS_COMPILE=aarch64-none-elf- make PLAT=fvp all" 647