From e27adadfb7e69ff1613fbc599091685661ec47a0 Mon Sep 17 00:00:00 2001 From: Rocco Marco Guglielmi Date: Sun, 17 Sep 2017 18:38:30 +0000 Subject: Added smart building for SAMA drivers git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10626 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/ports/SAMA/LLD/SPIv1/driver.mk | 6 ++++++ os/hal/ports/SAMA/SAMA5D2x/platform.mk | 13 ++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'os/hal/ports') diff --git a/os/hal/ports/SAMA/LLD/SPIv1/driver.mk b/os/hal/ports/SAMA/LLD/SPIv1/driver.mk index 7a873464d..cafe59fb8 100644 --- a/os/hal/ports/SAMA/LLD/SPIv1/driver.mk +++ b/os/hal/ports/SAMA/LLD/SPIv1/driver.mk @@ -1,2 +1,8 @@ +ifeq ($(USE_SMART_BUILD),yes) +ifneq ($(findstring HAL_USE_SPI TRUE,$(HALCONF)),) PLATFORMSRC += $(CHIBIOS)/os/hal/ports/SAMA/LLD/SPIv1/hal_spi_lld.c +else +PLATFORMSRC += $(CHIBIOS)/os/hal/ports/SAMA/LLD/SPIv1/hal_spi_lld.c +endif + PLATFORMINC += $(CHIBIOS)/os/hal/ports/SAMA/LLD/SPIv1 diff --git a/os/hal/ports/SAMA/SAMA5D2x/platform.mk b/os/hal/ports/SAMA/SAMA5D2x/platform.mk index 0ae77f33d..091b6f507 100644 --- a/os/hal/ports/SAMA/SAMA5D2x/platform.mk +++ b/os/hal/ports/SAMA/SAMA5D2x/platform.mk @@ -7,7 +7,18 @@ PLATFORMSRC := $(CHIBIOS)/os/hal/ports/SAMA/SAMA5D2x/hal_lld.c \ # Required include directories. PLATFORMINC := $(CHIBIOS)/os/hal/ports/SAMA/SAMA5D2x -# TODO: Add smart build. +# Optional platform files. +ifeq ($(USE_SMART_BUILD),yes) + +# Configuration files directory +ifeq ($(CONFDIR),) + CONFDIR = . +endif + +HALCONF := $(strip $(shell cat $(CONFDIR)/halconf.h | egrep -e "\#define")) + +else +endif # Drivers compatible with the platform. include $(CHIBIOS)/os/hal/ports/SAMA/LLD/DMAv1/driver.mk -- cgit v1.2.3