16414dc6dSKonstantin Porotchkin# 26414dc6dSKonstantin Porotchkin# Copyright (C) 2018 Marvell International Ltd. 36414dc6dSKonstantin Porotchkin# 46414dc6dSKonstantin Porotchkin# SPDX-License-Identifier: BSD-3-Clause 56414dc6dSKonstantin Porotchkin# https://spdx.org/licenses 66414dc6dSKonstantin Porotchkin 77c4e1eeaSChris Kayinclude ../../../make_helpers/common.mk 8cc277de8SChris Kayinclude ../../../make_helpers/toolchain.mk 9cc277de8SChris Kay 106414dc6dSKonstantin PorotchkinPROJECT = doimage 116414dc6dSKonstantin PorotchkinOBJECTS = doimage.o 126414dc6dSKonstantin Porotchkin 136414dc6dSKonstantin PorotchkinHOSTCCFLAGS = -Wall -Werror 146414dc6dSKonstantin Porotchkinifeq (${DEBUG},1) 156414dc6dSKonstantin Porotchkin HOSTCCFLAGS += -g -O0 -DDEBUG 166414dc6dSKonstantin Porotchkinelse 176414dc6dSKonstantin Porotchkin HOSTCCFLAGS += -O2 186414dc6dSKonstantin Porotchkinendif 196414dc6dSKonstantin Porotchkin 206414dc6dSKonstantin Porotchkinifeq (${MARVELL_SECURE_BOOT},1) 216414dc6dSKonstantin PorotchkinDOIMAGE_CC_FLAGS := -DCONFIG_MVEBU_SECURE_BOOT 226414dc6dSKonstantin PorotchkinDOIMAGE_LD_FLAGS := -lconfig -lmbedtls -lmbedcrypto -lmbedx509 236414dc6dSKonstantin Porotchkinendif 246414dc6dSKonstantin Porotchkin 256414dc6dSKonstantin PorotchkinHOSTCCFLAGS += ${DOIMAGE_CC_FLAGS} 266414dc6dSKonstantin Porotchkin 276414dc6dSKonstantin Porotchkin# Make soft links and include from local directory otherwise wrong headers 286414dc6dSKonstantin Porotchkin# could get pulled in from firmware tree. 296414dc6dSKonstantin PorotchkinINCLUDE_PATHS = -I. 306414dc6dSKonstantin Porotchkin 316414dc6dSKonstantin PorotchkinRM := rm -rf 326414dc6dSKonstantin Porotchkin 336414dc6dSKonstantin Porotchkin.PHONY: all clean 346414dc6dSKonstantin Porotchkin 356414dc6dSKonstantin Porotchkinall: ${PROJECT} 366414dc6dSKonstantin Porotchkin 376414dc6dSKonstantin Porotchkin${PROJECT}: ${OBJECTS} Makefile 387c4e1eeaSChris Kay $(s)echo " HOSTLD $@" 397c4e1eeaSChris Kay $(q)$(host-cc) ${OBJECTS} ${DOIMAGE_LD_FLAGS} -o $@ 407c4e1eeaSChris Kay $(s)echo 417c4e1eeaSChris Kay $(s)echo "Built $@ successfully" 427c4e1eeaSChris Kay $(s)echo 436414dc6dSKonstantin Porotchkin 44*a4ac07c7SChris Kay$(OBJECTS): %.o: %.c Makefile 457c4e1eeaSChris Kay $(s)echo " HOSTCC $<" 467c4e1eeaSChris Kay $(q)$(host-cc) -c ${HOSTCCFLAGS} ${INCLUDE_PATHS} $< -o $@ 476414dc6dSKonstantin Porotchkin 486414dc6dSKonstantin Porotchkinclean: 497c4e1eeaSChris Kay $(q)${RM} ${PROJECT} 507c4e1eeaSChris Kay $(q)${RM} ${OBJECTS} 51