blob: 9cec681a49e1a8c7adb2066ab342e664c270f6bf [file] [log] [blame]
Konstantin Porotchkinbf58b8a2018-02-26 16:28:40 +02001#
2# Copyright (C) 2018 Marvell International Ltd.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5# https://spdx.org/licenses
6
7PROJECT = doimage
8OBJECTS = doimage.o
9
10CFLAGS = -Wall -Werror
11ifeq (${DEBUG},1)
12 CFLAGS += -g -O0 -DDEBUG
13else
14 CFLAGS += -O2
15endif
16
17ifeq (${MARVELL_SECURE_BOOT},1)
18DOIMAGE_CC_FLAGS := -DCONFIG_MVEBU_SECURE_BOOT
19DOIMAGE_LD_FLAGS := -lconfig -lmbedtls -lmbedcrypto -lmbedx509
20endif
21
22CFLAGS += ${DOIMAGE_CC_FLAGS}
23
24# Make soft links and include from local directory otherwise wrong headers
25# could get pulled in from firmware tree.
26INCLUDE_PATHS = -I.
27
28CC := gcc
29RM := rm -rf
30
31.PHONY: all clean
32
33all: ${PROJECT}
34
35${PROJECT}: ${OBJECTS} Makefile
36 @echo " LD $@"
37 ${Q}${CC} ${OBJECTS} ${DOIMAGE_LD_FLAGS} -o $@
38 @echo
39 @echo "Built $@ successfully"
40 @echo
41
Jan Kiszka67f2f542018-10-02 09:28:00 +020042%.o: %.c Makefile
Konstantin Porotchkinbf58b8a2018-02-26 16:28:40 +020043 @echo " CC $<"
44 ${Q}${CC} -c ${CFLAGS} ${INCLUDE_PATHS} $< -o $@
45
46clean:
47 ${Q}${RM} ${PROJECT}
48 ${Q}${RM} ${OBJECTS}