Harry Liebel | f58ad36 | 2014-01-10 18:00:33 +0000 | [diff] [blame] | 1 | # |
Manish V Badarkhe | 635482e | 2020-08-13 05:56:33 +0100 | [diff] [blame] | 2 | # Copyright (c) 2014-2020, ARM Limited and Contributors. All rights reserved. |
Harry Liebel | f58ad36 | 2014-01-10 18:00:33 +0000 | [diff] [blame] | 3 | # |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | # SPDX-License-Identifier: BSD-3-Clause |
Harry Liebel | f58ad36 | 2014-01-10 18:00:33 +0000 | [diff] [blame] | 5 | # |
6 | |||||
Evan Lloyd | 26c6cb4 | 2015-12-02 18:33:55 +0000 | [diff] [blame] | 7 | MAKE_HELPERS_DIRECTORY := ../../make_helpers/ |
8 | include ${MAKE_HELPERS_DIRECTORY}build_macros.mk | ||||
Evan Lloyd | a71d259 | 2015-12-02 18:56:06 +0000 | [diff] [blame] | 9 | include ${MAKE_HELPERS_DIRECTORY}build_env.mk |
Evan Lloyd | 26c6cb4 | 2015-12-02 18:33:55 +0000 | [diff] [blame] | 10 | |
Manish V Badarkhe | 635482e | 2020-08-13 05:56:33 +0100 | [diff] [blame] | 11 | PROJECT := $(notdir ${FIPTOOL}) |
dp-arm | 4972ec5 | 2016-05-25 16:20:20 +0100 | [diff] [blame] | 12 | OBJECTS := fiptool.o tbbr_config.o |
dp-arm | 34c8201 | 2017-05-02 11:14:29 +0100 | [diff] [blame] | 13 | V ?= 0 |
Harry Liebel | f58ad36 | 2014-01-10 18:00:33 +0000 | [diff] [blame] | 14 | |
dp-arm | 4972ec5 | 2016-05-25 16:20:20 +0100 | [diff] [blame] | 15 | override CPPFLAGS += -D_GNU_SOURCE -D_XOPEN_SOURCE=700 |
Antonio Nino Diaz | 1c4d362 | 2018-10-04 14:35:38 +0100 | [diff] [blame] | 16 | HOSTCCFLAGS := -Wall -Werror -pedantic -std=c99 |
Jeenu Viswambharan | 2f2cef4 | 2014-02-19 09:38:18 +0000 | [diff] [blame] | 17 | ifeq (${DEBUG},1) |
Antonio Nino Diaz | 1c4d362 | 2018-10-04 14:35:38 +0100 | [diff] [blame] | 18 | HOSTCCFLAGS += -g -O0 -DDEBUG |
Harry Liebel | f58ad36 | 2014-01-10 18:00:33 +0000 | [diff] [blame] | 19 | else |
Antonio Nino Diaz | 1c4d362 | 2018-10-04 14:35:38 +0100 | [diff] [blame] | 20 | HOSTCCFLAGS += -O2 |
Harry Liebel | f58ad36 | 2014-01-10 18:00:33 +0000 | [diff] [blame] | 21 | endif |
dp-arm | 12e893b | 2016-08-24 13:21:08 +0100 | [diff] [blame] | 22 | LDLIBS := -lcrypto |
Harry Liebel | f58ad36 | 2014-01-10 18:00:33 +0000 | [diff] [blame] | 23 | |
dp-arm | 4972ec5 | 2016-05-25 16:20:20 +0100 | [diff] [blame] | 24 | ifeq (${V},0) |
25 | Q := @ | ||||
26 | else | ||||
27 | Q := | ||||
28 | endif | ||||
29 | |||||
Masahiro Yamada | 75440bf | 2017-07-26 18:21:59 +0900 | [diff] [blame] | 30 | INCLUDE_PATHS := -I../../include/tools_share |
Harry Liebel | f58ad36 | 2014-01-10 18:00:33 +0000 | [diff] [blame] | 31 | |
dp-arm | e95aaa6 | 2017-05-02 11:09:11 +0100 | [diff] [blame] | 32 | HOSTCC ?= gcc |
Harry Liebel | f58ad36 | 2014-01-10 18:00:33 +0000 | [diff] [blame] | 33 | |
Evan Lloyd | 93a7640 | 2015-12-02 20:30:13 +0000 | [diff] [blame] | 34 | .PHONY: all clean distclean |
Harry Liebel | f58ad36 | 2014-01-10 18:00:33 +0000 | [diff] [blame] | 35 | |
dp-arm | 4d133d9 | 2016-12-30 14:33:24 +0000 | [diff] [blame] | 36 | all: ${PROJECT} |
Harry Liebel | f58ad36 | 2014-01-10 18:00:33 +0000 | [diff] [blame] | 37 | |
Jeenu Viswambharan | 2f2cef4 | 2014-02-19 09:38:18 +0000 | [diff] [blame] | 38 | ${PROJECT}: ${OBJECTS} Makefile |
Antonio Nino Diaz | 1c4d362 | 2018-10-04 14:35:38 +0100 | [diff] [blame] | 39 | @echo " HOSTLD $@" |
dp-arm | e95aaa6 | 2017-05-02 11:09:11 +0100 | [diff] [blame] | 40 | ${Q}${HOSTCC} ${OBJECTS} -o $@ ${LDLIBS} |
Evan Lloyd | 26c6cb4 | 2015-12-02 18:33:55 +0000 | [diff] [blame] | 41 | @${ECHO_BLANK_LINE} |
Sandrine Bailleux | 152c17f | 2014-10-27 17:10:46 +0000 | [diff] [blame] | 42 | @echo "Built $@ successfully" |
Evan Lloyd | 26c6cb4 | 2015-12-02 18:33:55 +0000 | [diff] [blame] | 43 | @${ECHO_BLANK_LINE} |
Harry Liebel | f58ad36 | 2014-01-10 18:00:33 +0000 | [diff] [blame] | 44 | |
Masahiro Yamada | e3a2b31 | 2017-05-08 18:29:03 +0900 | [diff] [blame] | 45 | %.o: %.c %.h Makefile |
Antonio Nino Diaz | 1c4d362 | 2018-10-04 14:35:38 +0100 | [diff] [blame] | 46 | @echo " HOSTCC $<" |
47 | ${Q}${HOSTCC} -c ${CPPFLAGS} ${HOSTCCFLAGS} ${INCLUDE_PATHS} $< -o $@ | ||||
Harry Liebel | f58ad36 | 2014-01-10 18:00:33 +0000 | [diff] [blame] | 48 | |
49 | clean: | ||||
dp-arm | 4d133d9 | 2016-12-30 14:33:24 +0000 | [diff] [blame] | 50 | $(call SHELL_DELETE_ALL, ${PROJECT} ${OBJECTS}) |