aboutsummaryrefslogtreecommitdiffstats
path: root/os/nil/nil.mk
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-02-16 10:07:00 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-02-16 10:07:00 +0000
commitcf204e72ea5fd6e4be8b3295cb148fde5fdd47d2 (patch)
tree5aae4b9a6c78c8f14c2a6ca8cd6446f42b3b29bd /os/nil/nil.mk
parent641f2c372605cf405f0dda8536b45a78e0e5e2e2 (diff)
downloadChibiOS-cf204e72ea5fd6e4be8b3295cb148fde5fdd47d2.tar.gz
ChibiOS-cf204e72ea5fd6e4be8b3295cb148fde5fdd47d2.tar.bz2
ChibiOS-cf204e72ea5fd6e4be8b3295cb148fde5fdd47d2.zip
Tree reorganization.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8900 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/nil/nil.mk')
-rw-r--r--os/nil/nil.mk29
1 files changed, 26 insertions, 3 deletions
diff --git a/os/nil/nil.mk b/os/nil/nil.mk
index 51f0e8083..496100648 100644
--- a/os/nil/nil.mk
+++ b/os/nil/nil.mk
@@ -1,5 +1,28 @@
-# List of all the ChibiOS/NIL kernel files.
-KERNSRC = ${CHIBIOS}/os/nil/src/nil.c
+# List of all the ChibiOS/NIL kernel files, there is no need to remove the files
+# from this list, you can disable parts of the kernel by editing chconf.h.
+ifeq ($(USE_SMART_BUILD),yes)
+CHCONF := $(strip $(shell cat chconf.h | egrep -e "define"))
+KERNSRC := ${CHIBIOS}/os/nil/src/ch.c
+ifneq ($(findstring CH_CFG_USE_MAILBOXES TRUE,$(CHCONF)),)
+KERNSRC += $(CHIBIOS)/os/common/oslib/src/chmboxes.c
+endif
+ifneq ($(findstring CH_CFG_USE_MEMCORE TRUE,$(CHCONF)),)
+KERNSRC += $(CHIBIOS)/os/common/oslib/src/chmemcore.c
+endif
+ifneq ($(findstring CH_CFG_USE_HEAP TRUE,$(CHCONF)),)
+KERNSRC += $(CHIBIOS)/os/common/oslib/src/chheap.c
+endif
+ifneq ($(findstring CH_CFG_USE_MEMPOOLS TRUE,$(CHCONF)),)
+KERNSRC += $(CHIBIOS)/os/common/oslib/src/chmempools.c
+endif
+else
+KERNSRC := ${CHIBIOS}/os/nil/src/ch.c \
+ ${CHIBIOS}/os/common/oslib/src/chmboxes.c \
+ ${CHIBIOS}/os/common/oslib/src/chmemcore.c \
+ ${CHIBIOS}/os/common/oslib/src/chmempools.c \
+ ${CHIBIOS}/os/common/oslib/src/chheap.c
+endif
# Required include directories
-KERNINC = ${CHIBIOS}/os/nil/include
+KERNINC := ${CHIBIOS}/os/nil/include \
+ ${CHIBIOS}/os/common/oslib/include