Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 1 | # |
Dan Handley | e83b0ca | 2014-01-14 18:17:09 +0000 | [diff] [blame] | 2 | # Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved. |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 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 | # Decrease the verbosity of the make script |
| 32 | # can be made verbose by passing V=1 at the make command line |
| 33 | ifdef V |
James Morrissey | eaaeece | 2013-11-01 13:56:59 +0000 | [diff] [blame] | 34 | KBUILD_VERBOSE = ${V} |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 35 | else |
| 36 | KBUILD_VERBOSE = 0 |
| 37 | endif |
| 38 | |
Ian Spray | 36eaaf3 | 2014-01-30 17:25:28 +0000 | [diff] [blame] | 39 | CHECKPATCH_ARGS = --no-tree --no-signoff |
| 40 | CHECKCODE_ARGS = --no-patch --no-tree --no-signoff |
| 41 | |
James Morrissey | eaaeece | 2013-11-01 13:56:59 +0000 | [diff] [blame] | 42 | ifeq "${KBUILD_VERBOSE}" "0" |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 43 | Q=@ |
Ian Spray | 36eaaf3 | 2014-01-30 17:25:28 +0000 | [diff] [blame] | 44 | CHECKCODE_ARGS += --no-summary --terse |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 45 | else |
| 46 | Q= |
| 47 | endif |
| 48 | |
| 49 | DEBUG ?= 0 |
James Morrissey | eaaeece | 2013-11-01 13:56:59 +0000 | [diff] [blame] | 50 | |
| 51 | ifneq (${DEBUG}, 0) |
| 52 | BUILD_TYPE := debug |
| 53 | else |
| 54 | BUILD_TYPE := release |
| 55 | endif |
| 56 | |
Ryan Harkin | d7a6b0f | 2014-01-13 14:40:13 +0000 | [diff] [blame] | 57 | BL_COMMON_OBJS := misc_helpers.o \ |
| 58 | cache_helpers.o \ |
| 59 | tlb_helpers.o \ |
| 60 | std.o \ |
| 61 | bl_common.o \ |
| 62 | platform_helpers.o |
| 63 | |
Ryan Harkin | 25cff83 | 2014-01-13 12:37:03 +0000 | [diff] [blame] | 64 | ARCH ?= aarch64 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 65 | |
Ryan Harkin | 25cff83 | 2014-01-13 12:37:03 +0000 | [diff] [blame] | 66 | # By default, build all platforms available |
| 67 | PLAT ?= all |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 68 | |
Ryan Harkin | 25cff83 | 2014-01-13 12:37:03 +0000 | [diff] [blame] | 69 | BUILD_BASE := ./build |
| 70 | BUILD_PLAT := ${BUILD_BASE}/${PLAT}/${BUILD_TYPE} |
| 71 | BUILD_BL1 := ${BUILD_PLAT}/bl1 |
| 72 | BUILD_BL2 := ${BUILD_PLAT}/bl2 |
| 73 | BUILD_BL31 := ${BUILD_PLAT}/bl31 |
| 74 | BUILD_DIRS := ${BUILD_BL1} ${BUILD_BL2} ${BUILD_BL31} |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 75 | |
Ryan Harkin | 25cff83 | 2014-01-13 12:37:03 +0000 | [diff] [blame] | 76 | PLATFORMS := $(shell ls -I common plat/) |
Ryan Harkin | 72ee331 | 2014-01-15 16:55:07 +0000 | [diff] [blame] | 77 | HELP_PLATFORMS := $(shell echo ${PLATFORMS} | sed 's/ /|/g') |
| 78 | |
Ryan Harkin | 25cff83 | 2014-01-13 12:37:03 +0000 | [diff] [blame] | 79 | ifeq (${PLAT},) |
| 80 | $(error "Error: Unknown platform. Please use PLAT=<platform name> to specify the platform.") |
| 81 | endif |
| 82 | ifeq ($(findstring ${PLAT},${PLATFORMS} all),) |
| 83 | $(error "Error: Invalid platform. The following platforms are available: ${PLATFORMS}") |
| 84 | endif |
| 85 | |
| 86 | ifeq (${PLAT},all) |
| 87 | all: ${PLATFORMS} |
| 88 | else |
| 89 | all: msg_start bl1 bl2 bl31 |
| 90 | endif |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 91 | |
Ryan Harkin | 25cff83 | 2014-01-13 12:37:03 +0000 | [diff] [blame] | 92 | msg_start: |
| 93 | @echo "Building ${PLAT}" |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 94 | |
Ryan Harkin | 25cff83 | 2014-01-13 12:37:03 +0000 | [diff] [blame] | 95 | ${PLATFORMS}: |
| 96 | ${MAKE} PLAT=$@ all |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 97 | |
Ryan Harkin | 25cff83 | 2014-01-13 12:37:03 +0000 | [diff] [blame] | 98 | ifneq (${PLAT},all) |
| 99 | $(info Including ${PLAT}/platform.mk) |
| 100 | include plat/${PLAT}/platform.mk |
| 101 | $(info Including bl1.mk) |
| 102 | include bl1/bl1.mk |
| 103 | $(info Including bl2.mk) |
| 104 | include bl2/bl2.mk |
| 105 | $(info Including bl31.mk) |
| 106 | include bl31/bl31.mk |
| 107 | endif |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 108 | |
Ian Spray | 36eaaf3 | 2014-01-30 17:25:28 +0000 | [diff] [blame] | 109 | .PHONY: all msg_start ${PLATFORMS} dump clean realclean distclean bl1 bl2 bl31 cscope locate-checkpatch checkcodebase checkpatch |
James Morrissey | eaaeece | 2013-11-01 13:56:59 +0000 | [diff] [blame] | 110 | .SUFFIXES: |
| 111 | |
| 112 | |
Ryan Harkin | 25cff83 | 2014-01-13 12:37:03 +0000 | [diff] [blame] | 113 | BL1_OBJS := $(addprefix ${BUILD_BL1}/,${BL1_OBJS} ${BL_COMMON_OBJS} ${PLAT_BL_COMMON_OBJS}) |
| 114 | BL2_OBJS := $(addprefix ${BUILD_BL2}/,${BL2_OBJS} ${BL_COMMON_OBJS} ${PLAT_BL_COMMON_OBJS}) |
| 115 | BL31_OBJS := $(addprefix ${BUILD_BL31}/,${BL31_OBJS} ${BL_COMMON_OBJS} ${PLAT_BL_COMMON_OBJS}) |
James Morrissey | eaaeece | 2013-11-01 13:56:59 +0000 | [diff] [blame] | 116 | BL1_MAPFILE := $(addprefix ${BUILD_BL1}/,${BL1_MAPFILE}) |
| 117 | BL2_MAPFILE := $(addprefix ${BUILD_BL2}/,${BL2_MAPFILE}) |
| 118 | BL31_MAPFILE := $(addprefix ${BUILD_BL31}/,${BL31_MAPFILE}) |
| 119 | BL1_LINKERFILE := $(addprefix ${BUILD_BL1}/,${BL1_LINKERFILE}) |
| 120 | BL2_LINKERFILE := $(addprefix ${BUILD_BL2}/,${BL2_LINKERFILE}) |
| 121 | BL31_LINKERFILE := $(addprefix ${BUILD_BL31}/,${BL31_LINKERFILE}) |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 122 | |
Ryan Harkin | d7a6b0f | 2014-01-13 14:40:13 +0000 | [diff] [blame] | 123 | INCLUDES += -Ilib/include/ \ |
| 124 | -Iinclude/${ARCH}/ \ |
| 125 | -Iinclude/ \ |
| 126 | -Iarch/system/gic \ |
| 127 | -Icommon/psci \ |
| 128 | -Iinclude/stdlib \ |
| 129 | -Iinclude/stdlib/sys \ |
| 130 | -Iplat/${PLAT} \ |
| 131 | ${PLAT_INCLUDES} |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 132 | |
Harry Liebel | 0af6d64 | 2013-12-20 18:51:12 +0000 | [diff] [blame] | 133 | ASFLAGS += -nostdinc -ffreestanding -Wa,--fatal-warnings \ |
Sandrine Bailleux | df64a55 | 2014-02-11 13:31:33 +0000 | [diff] [blame^] | 134 | -mgeneral-regs-only -D__ASSEMBLY__ ${INCLUDES} \ |
| 135 | -DDEBUG=${DEBUG} |
Harry Liebel | 4f60368 | 2014-01-14 18:11:48 +0000 | [diff] [blame] | 136 | CFLAGS := -nostdinc -pedantic -ffreestanding -Wall \ |
| 137 | -Werror -mgeneral-regs-only -std=c99 -c -Os \ |
| 138 | -DDEBUG=${DEBUG} ${INCLUDES} ${CFLAGS} |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 139 | |
Sandrine Bailleux | 3e850a8 | 2013-11-20 11:50:48 +0000 | [diff] [blame] | 140 | LDFLAGS += --fatal-warnings -O1 |
James Morrissey | eaaeece | 2013-11-01 13:56:59 +0000 | [diff] [blame] | 141 | BL1_LDFLAGS := -Map=${BL1_MAPFILE} --script ${BL1_LINKERFILE} --entry=${BL1_ENTRY_POINT} |
| 142 | BL2_LDFLAGS := -Map=${BL2_MAPFILE} --script ${BL2_LINKERFILE} --entry=${BL2_ENTRY_POINT} |
| 143 | BL31_LDFLAGS := -Map=${BL31_MAPFILE} --script ${BL31_LINKERFILE} --entry=${BL31_ENTRY_POINT} |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 144 | |
| 145 | |
| 146 | vpath %.ld.S bl1:bl2:bl31 |
| 147 | vpath %.c bl1:bl2:bl31 |
| 148 | vpath %.c bl1/${ARCH}:bl2/${ARCH}:bl31/${ARCH} |
| 149 | vpath %.S bl1/${ARCH}:bl2/${ARCH}:bl31/${ARCH} |
| 150 | |
| 151 | |
James Morrissey | eaaeece | 2013-11-01 13:56:59 +0000 | [diff] [blame] | 152 | ifneq (${DEBUG}, 0) |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 153 | #CFLAGS += -g -O0 |
| 154 | CFLAGS += -g |
| 155 | # -save-temps -fverbose-asm |
| 156 | ASFLAGS += -g -Wa,--gdwarf-2 |
| 157 | endif |
| 158 | |
| 159 | |
James Morrissey | eaaeece | 2013-11-01 13:56:59 +0000 | [diff] [blame] | 160 | CC := ${CROSS_COMPILE}gcc |
| 161 | CPP := ${CROSS_COMPILE}cpp |
| 162 | AS := ${CROSS_COMPILE}gcc |
| 163 | AR := ${CROSS_COMPILE}ar |
| 164 | LD := ${CROSS_COMPILE}ld |
| 165 | OC := ${CROSS_COMPILE}objcopy |
| 166 | OD := ${CROSS_COMPILE}objdump |
| 167 | NM := ${CROSS_COMPILE}nm |
| 168 | PP := ${CROSS_COMPILE}gcc -E ${CFLAGS} |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 169 | |
| 170 | |
Ryan Harkin | 25cff83 | 2014-01-13 12:37:03 +0000 | [diff] [blame] | 171 | bl1: ${BUILD_BL1} ${BUILD_PLAT}/bl1.bin |
| 172 | bl2: ${BUILD_BL2} ${BUILD_PLAT}/bl2.bin |
| 173 | bl31: ${BUILD_BL31} ${BUILD_PLAT}/bl31.bin |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 174 | |
Ian Spray | 36eaaf3 | 2014-01-30 17:25:28 +0000 | [diff] [blame] | 175 | BASE_COMMIT ?= origin/master |
| 176 | |
Ryan Harkin | 25cff83 | 2014-01-13 12:37:03 +0000 | [diff] [blame] | 177 | ifeq (${PLAT},all) |
| 178 | ifeq (${MAKECMDGOALS},clean) |
| 179 | $(error "Please select a platform with PLAT=<platform>. You can use 'make distclean' to clean up all platform builds") |
| 180 | endif |
| 181 | endif |
Ian Spray | 36eaaf3 | 2014-01-30 17:25:28 +0000 | [diff] [blame] | 182 | |
| 183 | locate-checkpatch: |
| 184 | ifndef CHECKPATCH |
| 185 | $(error "Please set CHECKPATCH to point to the Linux checkpatch.pl file, eg: CHECKPATCH=../linux/script/checkpatch.pl") |
| 186 | else |
| 187 | ifeq (,$(wildcard ${CHECKPATCH})) |
| 188 | $(error "The file CHECKPATCH points to cannot be found, use eg: CHECKPATCH=../linux/script/checkpatch.pl") |
| 189 | endif |
| 190 | endif |
| 191 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 192 | clean: |
| 193 | @echo " CLEAN" |
Ryan Harkin | 25cff83 | 2014-01-13 12:37:03 +0000 | [diff] [blame] | 194 | ${Q}rm -rf ${BUILD_PLAT} |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 195 | |
James Morrissey | eaaeece | 2013-11-01 13:56:59 +0000 | [diff] [blame] | 196 | realclean distclean: |
| 197 | @echo " REALCLEAN" |
| 198 | ${Q}rm -rf ${BUILD_BASE} |
Joakim Bech | 35fab8c | 2014-01-23 14:51:49 +0100 | [diff] [blame] | 199 | ${Q}rm -f ${CURDIR}/cscope.* |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 200 | |
| 201 | dump: |
| 202 | @echo " OBJDUMP" |
James Morrissey | eaaeece | 2013-11-01 13:56:59 +0000 | [diff] [blame] | 203 | ${Q}${OD} -d ${BUILD_BL1}/bl1.elf > ${BUILD_BL1}/bl1.dump |
| 204 | ${Q}${OD} -d ${BUILD_BL2}/bl2.elf > ${BUILD_BL2}/bl2.dump |
| 205 | ${Q}${OD} -d ${BUILD_BL31}/bl31.elf > ${BUILD_BL31}/bl31.dump |
| 206 | |
Ian Spray | 36eaaf3 | 2014-01-30 17:25:28 +0000 | [diff] [blame] | 207 | checkcodebase: locate-checkpatch |
| 208 | @echo " CHECKING STYLE" |
| 209 | @if test -d .git ; then \ |
| 210 | git ls-files | while read GIT_FILE ; do ${CHECKPATCH} ${CHECKCODE_ARGS} -f $$GIT_FILE ; done ; \ |
| 211 | else \ |
| 212 | find . -type f -not -iwholename "*.git*" -not -iwholename "*build*" -exec ${CHECKPATCH} ${CHECKCODE_ARGS} -f {} \; ; \ |
| 213 | fi |
| 214 | |
| 215 | checkpatch: locate-checkpatch |
| 216 | @echo " CHECKING STYLE" |
| 217 | @git format-patch --stdout ${BASE_COMMIT} | ${CHECKPATCH} ${CHECKPATCH_ARGS} - || true |
| 218 | |
James Morrissey | eaaeece | 2013-11-01 13:56:59 +0000 | [diff] [blame] | 219 | ${BUILD_DIRS}: |
| 220 | ${Q}mkdir -p "$@" |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 221 | |
James Morrissey | eaaeece | 2013-11-01 13:56:59 +0000 | [diff] [blame] | 222 | |
| 223 | ${BUILD_BL1}/%.o: %.S |
| 224 | @echo " AS $<" |
| 225 | ${Q}${AS} ${ASFLAGS} -c $< -o $@ |
| 226 | |
| 227 | ${BUILD_BL2}/%.o: %.S |
| 228 | @echo " AS $<" |
| 229 | ${Q}${AS} ${ASFLAGS} -c $< -o $@ |
| 230 | |
| 231 | ${BUILD_BL31}/%.o: %.S |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 232 | @echo " AS $<" |
James Morrissey | eaaeece | 2013-11-01 13:56:59 +0000 | [diff] [blame] | 233 | ${Q}${AS} ${ASFLAGS} -c $< -o $@ |
| 234 | |
| 235 | ${BUILD_BL1}/%.o: %.c |
| 236 | @echo " CC $<" |
| 237 | ${Q}${CC} ${CFLAGS} -c $< -o $@ |
| 238 | |
| 239 | ${BUILD_BL2}/%.o: %.c |
| 240 | @echo " CC $<" |
| 241 | ${Q}${CC} ${CFLAGS} -c $< -o $@ |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 242 | |
James Morrissey | eaaeece | 2013-11-01 13:56:59 +0000 | [diff] [blame] | 243 | ${BUILD_BL31}/%.o: %.c |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 244 | @echo " CC $<" |
James Morrissey | eaaeece | 2013-11-01 13:56:59 +0000 | [diff] [blame] | 245 | ${Q}${CC} ${CFLAGS} -c $< -o $@ |
| 246 | |
| 247 | ${BUILD_BL1}/%.ld: %.ld.S |
Ryan Harkin | 25cff83 | 2014-01-13 12:37:03 +0000 | [diff] [blame] | 248 | @echo " PP $<" |
James Morrissey | eaaeece | 2013-11-01 13:56:59 +0000 | [diff] [blame] | 249 | ${Q}${AS} ${ASFLAGS} -P -E $< -o $@ |
| 250 | |
| 251 | ${BUILD_BL2}/%.ld: %.ld.S |
Ryan Harkin | 25cff83 | 2014-01-13 12:37:03 +0000 | [diff] [blame] | 252 | @echo " PP $<" |
James Morrissey | eaaeece | 2013-11-01 13:56:59 +0000 | [diff] [blame] | 253 | ${Q}${AS} ${ASFLAGS} -P -E $< -o $@ |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 254 | |
James Morrissey | eaaeece | 2013-11-01 13:56:59 +0000 | [diff] [blame] | 255 | ${BUILD_BL31}/%.ld: %.ld.S |
Ryan Harkin | 25cff83 | 2014-01-13 12:37:03 +0000 | [diff] [blame] | 256 | @echo " PP $<" |
James Morrissey | eaaeece | 2013-11-01 13:56:59 +0000 | [diff] [blame] | 257 | ${Q}${AS} ${ASFLAGS} -P -E $< -o $@ |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 258 | |
| 259 | |
James Morrissey | eaaeece | 2013-11-01 13:56:59 +0000 | [diff] [blame] | 260 | ${BUILD_BL1}/bl1.elf: ${BL1_OBJS} ${BL1_LINKERFILE} |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 261 | @echo " LD $@" |
James Morrissey | eaaeece | 2013-11-01 13:56:59 +0000 | [diff] [blame] | 262 | ${Q}${LD} -o $@ ${LDFLAGS} ${BL1_LDFLAGS} ${BL1_OBJS} |
| 263 | |
| 264 | ${BUILD_BL2}/bl2.elf: ${BL2_OBJS} ${BL2_LINKERFILE} |
| 265 | @echo " LD $@" |
| 266 | ${Q}${LD} -o $@ ${LDFLAGS} ${BL2_LDFLAGS} ${BL2_OBJS} |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 267 | |
James Morrissey | eaaeece | 2013-11-01 13:56:59 +0000 | [diff] [blame] | 268 | ${BUILD_BL31}/bl31.elf: ${BL31_OBJS} ${BL31_LINKERFILE} |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 269 | @echo " LD $@" |
James Morrissey | eaaeece | 2013-11-01 13:56:59 +0000 | [diff] [blame] | 270 | ${Q}${LD} -o $@ ${LDFLAGS} ${BL31_LDFLAGS} ${BL31_OBJS} |
| 271 | |
Ryan Harkin | 25cff83 | 2014-01-13 12:37:03 +0000 | [diff] [blame] | 272 | ${BUILD_PLAT}/bl1.bin: ${BUILD_BL1}/bl1.elf |
| 273 | @echo " BIN $@" |
James Morrissey | eaaeece | 2013-11-01 13:56:59 +0000 | [diff] [blame] | 274 | ${Q}${OC} -O binary $< $@ |
| 275 | @echo |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 276 | @echo "Built $@ successfully" |
| 277 | @echo |
| 278 | |
Ryan Harkin | 25cff83 | 2014-01-13 12:37:03 +0000 | [diff] [blame] | 279 | ${BUILD_PLAT}/bl2.bin: ${BUILD_BL2}/bl2.elf |
| 280 | @echo " BIN $@" |
James Morrissey | eaaeece | 2013-11-01 13:56:59 +0000 | [diff] [blame] | 281 | ${Q}${OC} -O binary $< $@ |
| 282 | @echo |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 283 | @echo "Built $@ successfully" |
| 284 | @echo |
| 285 | |
Ryan Harkin | 25cff83 | 2014-01-13 12:37:03 +0000 | [diff] [blame] | 286 | ${BUILD_PLAT}/bl31.bin: ${BUILD_BL31}/bl31.elf |
| 287 | @echo " BIN $@" |
James Morrissey | eaaeece | 2013-11-01 13:56:59 +0000 | [diff] [blame] | 288 | ${Q}${OC} -O binary $< $@ |
| 289 | @echo |
| 290 | @echo "Built $@ successfully" |
| 291 | @echo |
Ryan Harkin | 72ee331 | 2014-01-15 16:55:07 +0000 | [diff] [blame] | 292 | |
Joakim Bech | 35fab8c | 2014-01-23 14:51:49 +0100 | [diff] [blame] | 293 | cscope: |
| 294 | @echo " CSCOPE" |
| 295 | ${Q}find ${CURDIR} -name "*.[chsS]" > cscope.files |
| 296 | ${Q}cscope -b -q -k |
| 297 | |
Ryan Harkin | 72ee331 | 2014-01-15 16:55:07 +0000 | [diff] [blame] | 298 | help: |
Ian Spray | 36eaaf3 | 2014-01-30 17:25:28 +0000 | [diff] [blame] | 299 | @echo "usage: ${MAKE} PLAT=<all|${HELP_PLATFORMS}> <all|bl1|bl2|bl31|distclean|clean|checkcodebase|checkpatch|dump>" |
Ryan Harkin | 72ee331 | 2014-01-15 16:55:07 +0000 | [diff] [blame] | 300 | @echo "" |
| 301 | @echo "PLAT is used to specify which platform you wish to build." |
| 302 | @echo "" |
| 303 | @echo "Supported Targets:" |
Ian Spray | 36eaaf3 | 2014-01-30 17:25:28 +0000 | [diff] [blame] | 304 | @echo " all Build the BL1, BL2 and BL31 binaries" |
| 305 | @echo " bl1 Build the BL1 binary" |
| 306 | @echo " bl2 Build the BL2 binary" |
| 307 | @echo " bl31 Build the BL31 binary" |
| 308 | @echo " checkcodebase Check the coding style of the entire source tree" |
| 309 | @echo " checkpatch Check the coding style on changes in the current" |
| 310 | @echo " branch against BASE_COMMIT (default origin/master)" |
| 311 | @echo " clean Clean the build for the selected platform" |
Joakim Bech | 35fab8c | 2014-01-23 14:51:49 +0100 | [diff] [blame] | 312 | @echo " cscope Generate cscope index" |
Ian Spray | 36eaaf3 | 2014-01-30 17:25:28 +0000 | [diff] [blame] | 313 | @echo " distclean Remove all build artifacts for all platforms" |
| 314 | @echo " dump Generate object file dumps" |
Ryan Harkin | 72ee331 | 2014-01-15 16:55:07 +0000 | [diff] [blame] | 315 | @echo "" |
| 316 | @echo "note: most build targets require PLAT to be set to a specific platform." |
| 317 | @echo "" |
| 318 | @echo "example: build all targets for the FVP platform:" |
| 319 | @echo " CROSS_COMPILE=aarch64-none-elf- make PLAT=fvp all" |