# Toolchain
################################################################################
+HOSTCC := gcc
+export HOSTCC
+
CC := ${CROSS_COMPILE}gcc
CPP := ${CROSS_COMPILE}cpp
AS := ${CROSS_COMPILE}gcc
LIB_DIR := -L ${OPENSSL_DIR}/lib
LIB := -lssl -lcrypto
-CC := gcc
+HOSTCC ?= gcc
.PHONY: all clean realclean
@echo 'const char build_msg[] = "Built : "__TIME__", "__DATE__; \
const char platform_msg[] = "${PLAT_MSG}";' | \
${CC} -c ${CFLAGS} -xc - -o src/build_msg.o
- ${Q}${CC} src/build_msg.o ${OBJECTS} ${LIB_DIR} ${LIB} -o $@
+ ${Q}${HOSTCC} src/build_msg.o ${OBJECTS} ${LIB_DIR} ${LIB} -o $@
%.o: %.c
@echo " CC $<"
- ${Q}${CC} -c ${CFLAGS} ${INC_DIR} $< -o $@
+ ${Q}${HOSTCC} -c ${CFLAGS} ${INC_DIR} $< -o $@
clean:
$(call SHELL_DELETE_ALL, src/build_msg.o ${OBJECTS})
INCLUDE_PATHS := -I. -I../../include/tools_share
-CC := gcc
+HOSTCC ?= gcc
.PHONY: all clean distclean
${PROJECT}: ${OBJECTS} Makefile
@echo " LD $@"
- ${Q}${CC} ${OBJECTS} -o $@ ${LDLIBS}
+ ${Q}${HOSTCC} ${OBJECTS} -o $@ ${LDLIBS}
@${ECHO_BLANK_LINE}
@echo "Built $@ successfully"
@${ECHO_BLANK_LINE}
%.o: %.c %.h Makefile
@echo " CC $<"
- ${Q}${CC} -c ${CPPFLAGS} ${CFLAGS} ${INCLUDE_PATHS} $< -o $@
+ ${Q}${HOSTCC} -c ${CPPFLAGS} ${CFLAGS} ${INCLUDE_PATHS} $< -o $@
clean:
$(call SHELL_DELETE_ALL, ${PROJECT} ${OBJECTS} fip_create)