blob: 52e06a7ea5465377e3cb3a724c0bac2806fa3447 [file] [log] [blame]
Harry Liebelf58ad362014-01-10 18:00:33 +00001#
Evan Lloyd26c6cb42015-12-02 18:33:55 +00002# Copyright (c) 2014-2016, ARM Limited and Contributors. All rights reserved.
Harry Liebelf58ad362014-01-10 18:00:33 +00003#
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
Evan Lloyd26c6cb42015-12-02 18:33:55 +000031MAKE_HELPERS_DIRECTORY := ../../make_helpers/
32include ${MAKE_HELPERS_DIRECTORY}build_macros.mk
Evan Lloyda71d2592015-12-02 18:56:06 +000033include ${MAKE_HELPERS_DIRECTORY}build_env.mk
Evan Lloyd26c6cb42015-12-02 18:33:55 +000034
Harry Liebelf58ad362014-01-10 18:00:33 +000035PROJECT = fip_create
36OBJECTS = fip_create.o
37
38CFLAGS = -Wall -Werror -pedantic -std=c99
Jeenu Viswambharan2f2cef42014-02-19 09:38:18 +000039ifeq (${DEBUG},1)
Harry Liebelf58ad362014-01-10 18:00:33 +000040 CFLAGS += -g -O0 -DDEBUG
41else
42 CFLAGS += -O2
43endif
44
45# Make soft links and include from local directory otherwise wrong headers
46# could get pulled in from firmware tree.
47INCLUDE_PATHS = -I.
48
49CC := gcc
Harry Liebelf58ad362014-01-10 18:00:33 +000050
51.PHONY: all clean
52
Jeenu Viswambharan2f2cef42014-02-19 09:38:18 +000053all: ${PROJECT}
Harry Liebelf58ad362014-01-10 18:00:33 +000054
Jeenu Viswambharan2f2cef42014-02-19 09:38:18 +000055${PROJECT}: ${OBJECTS} Makefile
56 @echo " LD $@"
57 ${Q}${CC} ${OBJECTS} -o $@
Evan Lloyd26c6cb42015-12-02 18:33:55 +000058 @${ECHO_BLANK_LINE}
Sandrine Bailleux152c17f2014-10-27 17:10:46 +000059 @echo "Built $@ successfully"
Evan Lloyd26c6cb42015-12-02 18:33:55 +000060 @${ECHO_BLANK_LINE}
Harry Liebelf58ad362014-01-10 18:00:33 +000061
62%.o: %.c %.h Makefile
Jeenu Viswambharan2f2cef42014-02-19 09:38:18 +000063 @echo " CC $<"
64 ${Q}${CC} -c ${CFLAGS} ${INCLUDE_PATHS} $< -o $@
Harry Liebelf58ad362014-01-10 18:00:33 +000065
66clean:
Evan Lloyd26c6cb42015-12-02 18:33:55 +000067 $(call SHELL_DELETE_ALL, ${PROJECT} ${OBJECTS})
68