#
-# Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved.
+# Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
src/tbbr/tbb_ext.o \
src/tbbr/tbb_key.o
-CFLAGS := -Wall -std=c99
+HOSTCCFLAGS := -Wall -std=c99
MAKE_HELPERS_DIRECTORY := ../../make_helpers/
include ${MAKE_HELPERS_DIRECTORY}build_macros.mk
endif
ifeq (${DEBUG},1)
- CFLAGS += -g -O0 -DDEBUG -DLOG_LEVEL=40
+ HOSTCCFLAGS += -g -O0 -DDEBUG -DLOG_LEVEL=40
else
- CFLAGS += -O2 -DLOG_LEVEL=20
+ HOSTCCFLAGS += -O2 -DLOG_LEVEL=20
endif
ifeq (${V},0)
Q := @
endif
$(eval $(call add_define,USE_TBBR_DEFS))
-CFLAGS += ${DEFINES}
+HOSTCCFLAGS += ${DEFINES}
# Make soft links and include from local directory otherwise wrong headers
# could get pulled in from firmware tree.
all: clean ${BINARY}
${BINARY}: ${OBJECTS} Makefile
- @echo " LD $@"
+ @echo " HOSTLD $@"
@echo 'const char build_msg[] = "Built : "__TIME__", "__DATE__; \
const char platform_msg[] = "${PLAT_MSG}";' | \
- ${HOSTCC} -c ${CFLAGS} -xc - -o src/build_msg.o
+ ${HOSTCC} -c ${HOSTCCFLAGS} -xc - -o src/build_msg.o
${Q}${HOSTCC} src/build_msg.o ${OBJECTS} ${LIB_DIR} ${LIB} -o $@
%.o: %.c
- @echo " CC $<"
- ${Q}${HOSTCC} -c ${CFLAGS} ${INC_DIR} $< -o $@
+ @echo " HOSTCC $<"
+ ${Q}${HOSTCC} -c ${HOSTCCFLAGS} ${INC_DIR} $< -o $@
clean:
$(call SHELL_DELETE_ALL, src/build_msg.o ${OBJECTS})
PROJECT = doimage
OBJECTS = doimage.o
-CFLAGS = -Wall -Werror
+HOSTCCFLAGS = -Wall -Werror
ifeq (${DEBUG},1)
- CFLAGS += -g -O0 -DDEBUG
+ HOSTCCFLAGS += -g -O0 -DDEBUG
else
- CFLAGS += -O2
+ HOSTCCFLAGS += -O2
endif
ifeq (${MARVELL_SECURE_BOOT},1)
DOIMAGE_LD_FLAGS := -lconfig -lmbedtls -lmbedcrypto -lmbedx509
endif
-CFLAGS += ${DOIMAGE_CC_FLAGS}
+HOSTCCFLAGS += ${DOIMAGE_CC_FLAGS}
# Make soft links and include from local directory otherwise wrong headers
# could get pulled in from firmware tree.
INCLUDE_PATHS = -I.
-CC := gcc
+HOSTCC ?= gcc
RM := rm -rf
.PHONY: all clean
all: ${PROJECT}
${PROJECT}: ${OBJECTS} Makefile
- @echo " LD $@"
- ${Q}${CC} ${OBJECTS} ${DOIMAGE_LD_FLAGS} -o $@
+ @echo " HOSTLD $@"
+ ${Q}${HOSTCC} ${OBJECTS} ${DOIMAGE_LD_FLAGS} -o $@
@echo
@echo "Built $@ successfully"
@echo
%.o: %.c Makefile
- @echo " CC $<"
- ${Q}${CC} -c ${CFLAGS} ${INCLUDE_PATHS} $< -o $@
+ @echo " HOSTCC $<"
+ ${Q}${HOSTCC} -c ${HOSTCCFLAGS} ${INCLUDE_PATHS} $< -o $@
clean:
${Q}${RM} ${PROJECT}
#
-# Copyright (c) 2014-2017, ARM Limited and Contributors. All rights reserved.
+# Copyright (c) 2014-2018, ARM Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
V ?= 0
override CPPFLAGS += -D_GNU_SOURCE -D_XOPEN_SOURCE=700
-CFLAGS := -Wall -Werror -pedantic -std=c99
+HOSTCCFLAGS := -Wall -Werror -pedantic -std=c99
ifeq (${DEBUG},1)
- CFLAGS += -g -O0 -DDEBUG
+ HOSTCCFLAGS += -g -O0 -DDEBUG
else
- CFLAGS += -O2
+ HOSTCCFLAGS += -O2
endif
LDLIBS := -lcrypto
all: ${PROJECT}
${PROJECT}: ${OBJECTS} Makefile
- @echo " LD $@"
+ @echo " HOSTLD $@"
${Q}${HOSTCC} ${OBJECTS} -o $@ ${LDLIBS}
@${ECHO_BLANK_LINE}
@echo "Built $@ successfully"
@${ECHO_BLANK_LINE}
%.o: %.c %.h Makefile
- @echo " CC $<"
- ${Q}${HOSTCC} -c ${CPPFLAGS} ${CFLAGS} ${INCLUDE_PATHS} $< -o $@
+ @echo " HOSTCC $<"
+ ${Q}${HOSTCC} -c ${CPPFLAGS} ${HOSTCCFLAGS} ${INCLUDE_PATHS} $< -o $@
clean:
$(call SHELL_DELETE_ALL, ${PROJECT} ${OBJECTS})
OBJECTS := stm32image.o
V := 0
-CFLAGS := -Wall -Werror -pedantic -std=c99 -D_GNU_SOURCE
+HOSTCCFLAGS := -Wall -Werror -pedantic -std=c99 -D_GNU_SOURCE
+
ifeq (${DEBUG},1)
- CFLAGS += -g -O0 -DDEBUG
+ HOSTCCFLAGS += -g -O0 -DDEBUG
else
- CFLAGS += -O2
+ HOSTCCFLAGS += -O2
endif
ifeq (${V},0)
Q :=
endif
-CC := gcc
+HOSTCC := gcc
.PHONY: all clean distclean
all: ${PROJECT}
${PROJECT}: ${OBJECTS} Makefile
- @echo " LD $@"
- ${Q}${CC} ${OBJECTS} -o $@
+ @echo " HOSTLD $@"
+ ${Q}${HOSTCC} ${OBJECTS} -o $@
@${ECHO_BLANK_LINE}
@echo "Built $@ successfully"
@${ECHO_BLANK_LINE}
%.o: %.c Makefile
- @echo " CC $<"
- ${Q}${CC} -c ${CFLAGS} $< -o $@
+ @echo " HOSTCC $<"
+ ${Q}${HOSTCC} -c ${HOSTCCFLAGS} $< -o $@
clean:
$(call SHELL_DELETE_ALL, ${PROJECT} ${OBJECTS})