Makefile 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #
  2. # Copyright (C) 2018 Marvell International Ltd.
  3. #
  4. # SPDX-License-Identifier: BSD-3-Clause
  5. # https://spdx.org/licenses
  6. include ../../../make_helpers/common.mk
  7. include ../../../make_helpers/toolchain.mk
  8. PROJECT = doimage
  9. OBJECTS = doimage.o
  10. HOSTCCFLAGS = -Wall -Werror
  11. ifeq (${DEBUG},1)
  12. HOSTCCFLAGS += -g -O0 -DDEBUG
  13. else
  14. HOSTCCFLAGS += -O2
  15. endif
  16. ifeq (${MARVELL_SECURE_BOOT},1)
  17. DOIMAGE_CC_FLAGS := -DCONFIG_MVEBU_SECURE_BOOT
  18. DOIMAGE_LD_FLAGS := -lconfig -lmbedtls -lmbedcrypto -lmbedx509
  19. endif
  20. HOSTCCFLAGS += ${DOIMAGE_CC_FLAGS}
  21. # Make soft links and include from local directory otherwise wrong headers
  22. # could get pulled in from firmware tree.
  23. INCLUDE_PATHS = -I.
  24. RM := rm -rf
  25. .PHONY: all clean
  26. all: ${PROJECT}
  27. ${PROJECT}: ${OBJECTS} Makefile
  28. $(s)echo " HOSTLD $@"
  29. $(q)$(host-cc) ${OBJECTS} ${DOIMAGE_LD_FLAGS} -o $@
  30. $(s)echo
  31. $(s)echo "Built $@ successfully"
  32. $(s)echo
  33. %.o: %.c Makefile
  34. $(s)echo " HOSTCC $<"
  35. $(q)$(host-cc) -c ${HOSTCCFLAGS} ${INCLUDE_PATHS} $< -o $@
  36. clean:
  37. $(q)${RM} ${PROJECT}
  38. $(q)${RM} ${OBJECTS}