aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports
diff options
context:
space:
mode:
authorRocco Marco Guglielmi <roccomarco.guglielmi@gmail.com>2017-09-17 18:38:30 +0000
committerRocco Marco Guglielmi <roccomarco.guglielmi@gmail.com>2017-09-17 18:38:30 +0000
commite27adadfb7e69ff1613fbc599091685661ec47a0 (patch)
tree7315e40d4c1f8d8dfcab9d89130ad6c069ab3f56 /os/hal/ports
parentc1f1faa85b6b6a0301b3f6b114abf8e9020cdd08 (diff)
downloadChibiOS-e27adadfb7e69ff1613fbc599091685661ec47a0.tar.gz
ChibiOS-e27adadfb7e69ff1613fbc599091685661ec47a0.tar.bz2
ChibiOS-e27adadfb7e69ff1613fbc599091685661ec47a0.zip
Added smart building for SAMA drivers
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10626 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports')
-rw-r--r--os/hal/ports/SAMA/LLD/SPIv1/driver.mk6
-rw-r--r--os/hal/ports/SAMA/SAMA5D2x/platform.mk13
2 files changed, 18 insertions, 1 deletions
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