host/Makefiles: Allow CC variable to be derived from env
When cross compiling with bitbake we only want to set CC if the env hasn't
already set it.
Change the host Makefiles to only assign CC and friends if-and-only-if not
already set by the environment.
As an example bitbake for the NXP WaRP7 will set
CROSS_COMPILE=arm-oe-linux-gnueabi-
and
CC=arm-oe-linux-gnueabi-gcc -march=armv7ve -marm -mfpu=neon
-mfloat-abi=hard -mcpu=cortex-a7
--sysroot=/opt/oecore-x86_64/sysroots/cortexa7hf-neon-oe-linux-gnueabi
Thus allowing for the user-space compliation to pick-up the necessary float
and sysroot parameters.
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
diff --git a/random/host/Makefile b/random/host/Makefile
index 8d063ae..fa8d4c3 100644
--- a/random/host/Makefile
+++ b/random/host/Makefile
@@ -1,10 +1,10 @@
-CC = $(CROSS_COMPILE)gcc
-LD = $(CROSS_COMPILE)ld
-AR = $(CROSS_COMPILE)ar
-NM = $(CROSS_COMPILE)nm
-OBJCOPY = $(CROSS_COMPILE)objcopy
-OBJDUMP = $(CROSS_COMPILE)objdump
-READELF = $(CROSS_COMPILE)readelf
+CC ?= $(CROSS_COMPILE)gcc
+LD ?= $(CROSS_COMPILE)ld
+AR ?= $(CROSS_COMPILE)ar
+NM ?= $(CROSS_COMPILE)nm
+OBJCOPY ?= $(CROSS_COMPILE)objcopy
+OBJDUMP ?= $(CROSS_COMPILE)objdump
+READELF ?= $(CROSS_COMPILE)readelf
OBJS = main.o