Harry Liebel | f58ad36 | 2014-01-10 18:00:33 +0000 | [diff] [blame] | 1 | # |
Masahiro Yamada | e3a2b31 | 2017-05-08 18:29:03 +0900 | [diff] [blame] | 2 | # Copyright (c) 2014-2017, 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 | |
dp-arm | 4972ec5 | 2016-05-25 16:20:20 +0100 | [diff] [blame] | 11 | PROJECT := fiptool${BIN_EXT} |
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 |
Evan Lloyd | f4ba5ca | 2015-12-03 09:47:51 +0000 | [diff] [blame] | 16 | CFLAGS := -Wall -Werror -pedantic -std=c99 |
Jeenu Viswambharan | 2f2cef4 | 2014-02-19 09:38:18 +0000 | [diff] [blame] | 17 | ifeq (${DEBUG},1) |
Harry Liebel | f58ad36 | 2014-01-10 18:00:33 +0000 | [diff] [blame] | 18 | CFLAGS += -g -O0 -DDEBUG |
19 | else | ||||
20 | CFLAGS += -O2 | ||||
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 | 4972ec5 | 2016-05-25 16:20:20 +0100 | [diff] [blame] | 36 | all: ${PROJECT} fip_create |
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 |
39 | @echo " LD $@" | ||||
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 | |
dp-arm | 4972ec5 | 2016-05-25 16:20:20 +0100 | [diff] [blame] | 45 | fip_create: fip_create.sh |
dp-arm | 65dfe4c | 2016-08-10 13:39:42 +0100 | [diff] [blame] | 46 | ${Q}mkdir -p ../fip_create |
47 | ${Q}install -m 755 fip_create.sh ../fip_create/fip_create | ||||
dp-arm | 4972ec5 | 2016-05-25 16:20:20 +0100 | [diff] [blame] | 48 | |
Masahiro Yamada | e3a2b31 | 2017-05-08 18:29:03 +0900 | [diff] [blame] | 49 | %.o: %.c %.h Makefile |
Jeenu Viswambharan | 2f2cef4 | 2014-02-19 09:38:18 +0000 | [diff] [blame] | 50 | @echo " CC $<" |
dp-arm | e95aaa6 | 2017-05-02 11:09:11 +0100 | [diff] [blame] | 51 | ${Q}${HOSTCC} -c ${CPPFLAGS} ${CFLAGS} ${INCLUDE_PATHS} $< -o $@ |
Harry Liebel | f58ad36 | 2014-01-10 18:00:33 +0000 | [diff] [blame] | 52 | |
53 | clean: | ||||
dp-arm | 4972ec5 | 2016-05-25 16:20:20 +0100 | [diff] [blame] | 54 | $(call SHELL_DELETE_ALL, ${PROJECT} ${OBJECTS} fip_create) |