Make:Remove calls to shell from makefiles.

As an initial stage of making Trusted Firmware build environment more
portable, we remove most uses of the $(shell ) function and replace them
with more portable make function based solutions.

Note that the setting of BUILD_STRING still uses $(shell ) since it's
not possible to reimplement this as a make function. Avoiding invocation
of this on incompatible host platforms will be implemented separately.

Change-Id: I768e2f9a265c78814a4adf2edee4cc46cda0f5b8
This commit is contained in:
Evan Lloyd
2015-12-02 18:17:37 +00:00
parent 4c51badfb5
commit 231c14702c
5 changed files with 97 additions and 34 deletions

View File

@@ -47,15 +47,16 @@ OBJECTS := src/cert.o \
CFLAGS := -Wall -std=c99
# Check the platform
ifeq (${PLAT},none)
$(error "Error: Unknown platform. Please use PLAT=<platform name> to specify the platform")
endif
PLAT_MAKEFILE := platform.mk
PLAT_INCLUDE := $(shell find ../../plat/ -wholename '*/${PLAT}/${PLAT_MAKEFILE}' | \
sed 's/${PLAT_MAKEFILE}/include/')
MAKE_HELPERS_DIRECTORY := ../../make_helpers/
include ${MAKE_HELPERS_DIRECTORY}build_macros.mk
PLATFORM_ROOT := ../../plat/
include ${MAKE_HELPERS_DIRECTORY}plat_helpers.mk
PLAT_INCLUDE := $(wildcard ${PLAT_DIR}include)
ifeq ($(PLAT_INCLUDE),)
$(error "Error: Invalid platform '${PLAT}'")
$(error "Error: Invalid platform '${PLAT}' has no include directory.")
endif
ifeq (${DEBUG},1)