Use "make --no-builtin-variables" to build client applications
Commit 1d7d9ad85650 ("host/Makefiles: Allow CC variable to be derived
from env") changed the client application Makfiles so that $(CC) will
not be modified if already set. The intent was to take into account
the values derived from the environment or the command line.
Unfortunately, the "?=" syntax will also consider 'default' (built-in)
variables as shown in this example:
$ cat Makefile
$(info CC=$(CC) origin: $(origin CC))
CC ?= foo
$(info CC=$(CC) origin: $(origin CC))
all:
$ make
CC=cc origin: default
CC=cc origin: default
make: Nothing to be done for 'all'.
As a result, unless CC is specified via the environment or the command
line, its value defaults to 'cc' which is not what we want for cross
compilation.
This commit fixes the issue in a similar way to optee_test, by
disabling built-in variables. This in turn requires adding explicit
compilation rules (%.o: %.c).
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Fixes: 1d7d9ad85650 ("host/Makefiles: Allow CC variable to be derived from env")
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
diff --git a/aes/Makefile b/aes/Makefile
index 3b9a8dc..4f97c4b 100644
--- a/aes/Makefile
+++ b/aes/Makefile
@@ -6,7 +6,7 @@
.PHONY: all
all:
- $(MAKE) -C host CROSS_COMPILE="$(HOST_CROSS_COMPILE)"
+ $(MAKE) -C host CROSS_COMPILE="$(HOST_CROSS_COMPILE)" --no-builtin-variables
$(MAKE) -C ta CROSS_COMPILE="$(TA_CROSS_COMPILE)"
.PHONY: clean