From c04d2606f6fb82aaf1fa341e61b834fff8f3db1c Mon Sep 17 00:00:00 2001 From: Dan Handley Date: Fri, 27 Mar 2015 17:44:35 +0000 Subject: Allow deeper platform port directory structure Update the top level makefile to allow platform ports to exist in subdirectories at any level instead of one level under `plat/`. The makefile recursively searches for all files called `platform.mk` in all subdirectories of `plat/`. The directory containing `platform.mk` is the platform name. Platform names must be unique across the codebase. Replace usage of HELP_PLATFORMS in the Makefile with PLATFORMS since these are both used to report the same information back to the user. Update the TSP and cert_create tool makefiles in a similar way to support a deeper platform port directory structure. Also add PLAT_ as a define passed through the top level makefile to the source files, to allow build time variation in common platform code. Change-Id: I213420164808c5ddb99a26144e8e3f141a7417b7 --- tools/cert_create/Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/cert_create/Makefile b/tools/cert_create/Makefile index f1aa79743..eac8cec80 100644 --- a/tools/cert_create/Makefile +++ b/tools/cert_create/Makefile @@ -47,7 +47,13 @@ CFLAGS := -Wall -std=c99 # Check the platform ifeq (${PLAT},none) - $(error Error: No platform defined. Use PLAT=.) + $(error "Error: Unknown platform. Please use PLAT= to specify the platform") +endif +PLAT_MAKEFILE := platform.mk +PLAT_INCLUDE := $(shell find ../../plat/ -wholename '*/${PLAT}/${PLAT_MAKEFILE}' | \ + sed 's/${PLAT_MAKEFILE}/include/') +ifeq ($(PLAT_INCLUDE),) + $(error "Error: Invalid platform '${PLAT}'") endif ifeq (${DEBUG},1) @@ -63,7 +69,7 @@ endif # Make soft links and include from local directory otherwise wrong headers # could get pulled in from firmware tree. -INC_DIR := -I ./include -I ../../plat/${PLAT}/include +INC_DIR := -I ./include -I ${PLAT_INCLUDE} LIB_DIR := LIB := -lssl -lcrypto -- cgit v1.2.3