commit efe86ca9c23f7b8531d3c8e8af8c10863eadd12a
Author: Thomas Schöpping <tschoepp@cit-ec.uni-bielefeld.de>
Date:   Tue Oct 15 13:59:26 2019 +0200

    Makefiles revised
    AMiRo-LLD updated

diff --git a/amiro-os.mk b/amiro-os.mk
new file mode 100644
index 0000000..04ad6da
--- /dev/null
+++ b/amiro-os.mk
@@ -0,0 +1,97 @@
+################################################################################
+# AMiRo-OS is an operating system designed for the Autonomous Mini Robot       #
+# (AMiRo) platform.                                                            #
+# Copyright (C) 2016..2019  Thomas Schöpping et al.                            #
+#                                                                              #
+# This program is free software: you can redistribute it and/or modify         #
+# it under the terms of the GNU General Public License as published by         #
+# the Free Software Foundation, either version 3 of the License, or            #
+# (at your option) any later version.                                          #
+#                                                                              #
+# This program is distributed in the hope that it will be useful,              #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of               #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                #
+# GNU General Public License for more details.                                 #
+#                                                                              #
+# You should have received a copy of the GNU General Public License            #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.        #
+#                                                                              #
+# This research/work was supported by the Cluster of Excellence Cognitive      #
+# Interaction Technology 'CITEC' (EXC 277) at Bielefeld University, which is   #
+# funded by the German Research Foundation (DFG).                              #
+################################################################################
+
+
+
+# path to this directory
+AMIROOS_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
+
+# set AMiRo-OS path variable
+AMIROOS := $(AMIROOS_DIR:/=)
+
+# load bootloader files
+include $(AMIROOS)/bootloader/bootloader.mk
+
+# load kernel files
+include $(AMIROOS)/kernel/kernel.mk
+
+# load peryphery LLD files
+include $(AMIROOS)/periphery-lld/periphery-lld.mk
+
+# load AMiRo-OS files
+include $(AMIROOS)/modules/modules.mk
+include $(AMIROOS)/core/core.mk
+include $(AMIROOS)/test/test.mk
+
+# inclusion directories
+AMIROOS_INC = $(CONFDIR) \
+              $(AMIROOS) \
+              $(AMIROOS_BOOTLOADER_INC) \
+              $(AMIROOS_KERNEL_INC) \
+              $(AMIROOS_PERIPHERYLLD_INC) \
+              $(AMIROOS_MODULES_INC) \
+              $(AMIROOS_CORE_INC) \
+              $(AMIROOS_TEST_INC) \
+              $(MODULE_INC) \
+              $(APPS_INC)
+
+# C sources that can be compiled in ARM or THUMB mode depending on the global setting
+AMIROOS_CSRC = $(AMIROOS_BOOTLOADER_CSRC) \
+               $(AMIROOS_KERNEL_CSRC) \
+               $(AMIROOS_PERIPHERYLLD_CSRC) \
+               $(AMIROOS_MODULES_CSRC) \
+               $(AMIROOS_CORE_CSRC) \
+               $(AMIROOS_TEST_CSRC) \
+               $(MODULE_CSRC) \
+               $(APPS_CSRC)
+
+# C++ sources that can be compiled in ARM or THUMB mode depending on the global setting
+AMIROOS_CPPSRC = $(AMIROOS_BOOTLOADER_CPPSRC) \
+                 $(AMIROOS_KERNEL_CPPSRC) \
+                 $(AMIROOS_PERIPHERYLLD_CPPSRC) \
+                 $(AMIROOS_MODULES_CPPSRC) \
+                 $(AMIROOS_CORE_CPPSRC) \
+                 $(AMIROOS_TEST_CPPSRC) \
+                 $(MODULE_CPPSRC) \
+                 $(APPS_CPPSRC)
+
+# ASM source files
+AMIROOS_ASMSRC = $(AMIROOS_BOOTLOADER_ASMSRC) \
+                 $(AMIROOS_KERNEL_ASMSRC) \
+                 $(AMIROOS_PERIPHERYLLD_ASMSRC) \
+                 $(AMIROOS_MODULES_ASMSRC) \
+                 $(AMIROOS_CORE_ASMSRC) \
+                 $(AMIROOS_TEST_ASMSRC) \
+                 $(MODULE_ASMSRC) \
+                 $(APPS_ASMSRC)
+
+# ASM with preprocessor source files here
+AMIROOS_ASMXSRC = $(AMIROOS_BOOTLOADER_ASMXSRC) \
+                  $(AMIROOS_KERNEL_ASMXSRC) \
+                  $(AMIROOS_PERIPHERYLLD_ASMXSRC) \
+                  $(AMIROOS_MODULES_ASMXSRC) \
+                  $(AMIROOS_CORE_ASMXSRC) \
+                  $(AMIROOS_TEST_ASMXSRC) \
+                  $(MODULE_ASMXSRC) \
+                  $(APPS_ASMXSRC)
+
diff --git a/amiroos.mk b/amiroos.mk
deleted file mode 100644
index da99b7b..0000000
--- a/amiroos.mk
+++ /dev/null
@@ -1,97 +0,0 @@
-################################################################################
-# AMiRo-OS is an operating system designed for the Autonomous Mini Robot       #
-# (AMiRo) platform.                                                            #
-# Copyright (C) 2016..2019  Thomas Schöpping et al.                            #
-#                                                                              #
-# This program is free software: you can redistribute it and/or modify         #
-# it under the terms of the GNU General Public License as published by         #
-# the Free Software Foundation, either version 3 of the License, or            #
-# (at your option) any later version.                                          #
-#                                                                              #
-# This program is distributed in the hope that it will be useful,              #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of               #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                #
-# GNU General Public License for more details.                                 #
-#                                                                              #
-# You should have received a copy of the GNU General Public License            #
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.        #
-#                                                                              #
-# This research/work was supported by the Cluster of Excellence Cognitive      #
-# Interaction Technology 'CITEC' (EXC 277) at Bielefeld University, which is   #
-# funded by the German Research Foundation (DFG).                              #
-################################################################################
-
-
-
-# absolute path to this directory
-AMIROOS_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
-
-# set AMiRo-OS path variable
-AMIROOS := $(AMIROOS_DIR:/=)
-
-# load bootloader files
-include $(AMIROOS)/bootloader/bootloader.mk
-
-# load kernel files
-include $(AMIROOS)/kernel/kernel.mk
-
-# load peryphery LLD files
-include $(AMIROOS)/periphery-lld/periphery-lld.mk
-
-# load AMiRo-OS files
-include $(AMIROOS)/modules/modules.mk
-include $(AMIROOS)/core/core.mk
-include $(AMIROOS)/test/test.mk
-
-# inclusion directories
-AMIROOS_INC = $(CONFDIR) \
-              $(AMIROOS) \
-              $(AMIROOS_BOOTLOADER_INC) \
-              $(AMIROOS_KERNEL_INC) \
-              $(AMIROOS_PERIPHERYLLD_INC) \
-              $(AMIROOS_MODULES_INC) \
-              $(AMIROOS_CORE_INC) \
-              $(AMIROOS_TEST_INC) \
-              $(MODULE_INC) \
-              $(APPS_INC)
-
-# C sources that can be compiled in ARM or THUMB mode depending on the global setting
-AMIROOS_CSRC = $(AMIROOS_BOOTLOADER_CSRC) \
-               $(AMIROOS_KERNEL_CSRC) \
-               $(AMIROOS_PERIPHERYLLD_CSRC) \
-               $(AMIROOS_MODULES_CSRC) \
-               $(AMIROOS_CORE_CSRC) \
-               $(AMIROOS_TEST_CSRC) \
-               $(MODULE_CSRC) \
-               $(APPS_CSRC)
-
-# C++ sources that can be compiled in ARM or THUMB mode depending on the global setting
-AMIROOS_CPPSRC = $(AMIROOS_BOOTLOADER_CPPSRC) \
-                 $(AMIROOS_KERNEL_CPPSRC) \
-                 $(AMIROOS_PERIPHERYLLD_CPPSRC) \
-                 $(AMIROOS_MODULES_CPPSRC) \
-                 $(AMIROOS_CORE_CPPSRC) \
-                 $(AMIROOS_TEST_CPPSRC) \
-                 $(MODULE_CPPSRC) \
-                 $(APPS_CPPSRC)
-
-# ASM source files
-AMIROOS_ASMSRC = $(AMIROOS_BOOTLOADER_ASMSRC) \
-                 $(AMIROOS_KERNEL_ASMSRC) \
-                 $(AMIROOS_PERIPHERYLLD_ASMSRC) \
-                 $(AMIROOS_MODULES_ASMSRC) \
-                 $(AMIROOS_CORE_ASMSRC) \
-                 $(AMIROOS_TEST_ASMSRC) \
-                 $(MODULE_ASMSRC) \
-                 $(APPS_ASMSRC)
-
-# ASM with preprocessor source files here
-AMIROOS_ASMXSRC = $(AMIROOS_BOOTLOADER_ASMXSRC) \
-                  $(AMIROOS_KERNEL_ASMXSRC) \
-                  $(AMIROOS_PERIPHERYLLD_ASMXSRC) \
-                  $(AMIROOS_MODULES_ASMXSRC) \
-                  $(AMIROOS_CORE_ASMXSRC) \
-                  $(AMIROOS_TEST_ASMXSRC) \
-                  $(MODULE_ASMXSRC) \
-                  $(APPS_ASMXSRC)
-
diff --git a/bootloader/bootloader.mk b/bootloader/bootloader.mk
index f5c6f7b..7df00f0 100644
--- a/bootloader/bootloader.mk
+++ b/bootloader/bootloader.mk
@@ -23,7 +23,7 @@
 
 
 
-# the path to this makefile
+# path to this makefile
 AMIROOS_BOOTLOADER_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
 
 # set AMiRo-BLT path variable
diff --git a/core/core.mk b/core/core.mk
index a1c9dbc..4f0df56 100644
--- a/core/core.mk
+++ b/core/core.mk
@@ -23,7 +23,7 @@
 
 
 
-# absolute path to this directory
+# path to this directory
 AMIROOS_CORE_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
 
 # include paths
diff --git a/modules/DiWheelDrive_1-1/Makefile b/modules/DiWheelDrive_1-1/Makefile
index f623128..4f1812d 100644
--- a/modules/DiWheelDrive_1-1/Makefile
+++ b/modules/DiWheelDrive_1-1/Makefile
@@ -122,18 +122,18 @@ PROJECT := $(notdir $(PROJECT_PATH))
 MCU := cortex-m3
 
 # Module specific paths and directories.
-MODULEDIR := .
-CONFDIR := $(MODULEDIR)
-ifeq ($(BUILDDIR),)
-  BUILDDIR := $(PROJECT_PATH)/build
+MODULE_DIR := .
+CONFIG_DIR := $(MODULEDIR)
+ifeq ($(BUILD_DIR),)
+  BUILD_DIR := $(PROJECT_PATH)/build
 endif
-DEPDIR := $(dir $(BUILDDIR)).dep
+DEP_DIR := $(dir $(BUILD_DIR)).dep
 
 # Linker script.
-LDSCRIPT= STM32F103xE.ld
+LDSCRIPT = STM32F103xE.ld
 
 # General AMiRo-OS files.
-include ../../amiroos.mk
+include ../../amiro-os.mk
 
 # Module specific ChibiOS files.
 include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f1xx.mk
@@ -141,17 +141,17 @@ include $(CHIBIOS)/os/hal/ports/STM32/STM32F1xx/platform.mk
 include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
 
 # Periphery LLDs.
-AMIROOS_PERIPHERYLLD_INC += $(AMIROLLD)/drivers/A3906/v1 \
-                            $(AMIROLLD)/drivers/AT24C01B/v1 \
-                            $(AMIROLLD)/drivers/HMC5883L/v1 \
-                            $(AMIROLLD)/drivers/INA219/v1 \
-                            $(AMIROLLD)/drivers/L3G4200D/v1 \
-                            $(AMIROLLD)/drivers/LED/v1 \
-                            $(AMIROLLD)/drivers/LIS331DLH/v1 \
-                            $(AMIROLLD)/drivers/LTC4412/v1 \
-                            $(AMIROLLD)/drivers/PCA9544A/v1 \
-                            $(AMIROLLD)/drivers/TPS6211x/v1 \
-                            $(AMIROLLD)/drivers/VCNL4020/v1
+include $(AMIROLLD)/drivers/A3906/v1/alld_A3906.mk
+include $(AMIROLLD)/drivers/AT24C01B/v1/alld_AT24C01B.mk
+include $(AMIROLLD)/drivers/HMC5883L/v1/alld_HMC5883L.mk
+include $(AMIROLLD)/drivers/INA219/v1/alld_INA219.mk
+include $(AMIROLLD)/drivers/L3G4200D/v1/alld_L3G4200D.mk
+include $(AMIROLLD)/drivers/LED/v1/alld_LED.mk
+include $(AMIROLLD)/drivers/LIS331DLH/v1/alld_LIS331DLH.mk
+include $(AMIROLLD)/drivers/LTC4412/v1/alld_LTC4412.mk
+include $(AMIROLLD)/drivers/PCA9544A/v1/alld_PCA9544A.mk
+include $(AMIROLLD)/drivers/TPS6211x/v1/alld_TPS6211x.mk
+include $(AMIROLLD)/drivers/VCNL4020/v1/alld_VCNL4020.mk
 
 # Tests.
 AMIROOS_TEST_INC += $(AMIROOS_TEST_DIR)periphery-lld/A3906_v1 \
@@ -167,8 +167,8 @@ AMIROOS_TEST_INC += $(AMIROOS_TEST_DIR)periphery-lld/A3906_v1 \
                     $(AMIROOS_TEST_DIR)periphery-lld/VCNL4020_v1
 
 # Module specific inclusion directories
-MODULE_INC = $(MODULEDIR) \
-             $(wildcard $(MODULEDIR)/test/*)
+MODULE_INC = $(MODULE_DIR) \
+             $(wildcard $(MODULE_DIR)/test/*)
 
 # Module specific C source files.
 MODULE_CSRC = $(wildcard $(MODULE_INC:%=%/*.[Cc]))
diff --git a/modules/DiWheelDrive_1-2/Makefile b/modules/DiWheelDrive_1-2/Makefile
index 2a7498b..5c5fc4d 100644
--- a/modules/DiWheelDrive_1-2/Makefile
+++ b/modules/DiWheelDrive_1-2/Makefile
@@ -122,18 +122,18 @@ PROJECT := $(notdir $(PROJECT_PATH))
 MCU := cortex-m3
 
 # Module specific paths and directories.
-MODULEDIR := .
-CONFDIR := $(MODULEDIR)
-ifeq ($(BUILDDIR),)
-  BUILDDIR := $(PROJECT_PATH)/build
+MODULE_DIR := .
+CONFIG_DIR := $(MODULEDIR)
+ifeq ($(BUILD_DIR),)
+  BUILD_DIR := $(PROJECT_PATH)/build
 endif
-DEPDIR := $(dir $(BUILDDIR)).dep
+DEP_DIR := $(dir $(BUILD_DIR)).dep
 
 # Linker script.
-LDSCRIPT= STM32F103xE.ld
+LDSCRIPT = STM32F103xE.ld
 
 # General AMiRo-OS files.
-include ../../amiroos.mk
+include ../../amiro-os.mk
 
 # Module specific ChibiOS files.
 include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f1xx.mk
@@ -141,20 +141,19 @@ include $(CHIBIOS)/os/hal/ports/STM32/STM32F1xx/platform.mk
 include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
 
 # Periphery LLDs.
-AMIROOS_PERIPHERYLLD_INC += $(AMIROLLD)/drivers/A3906/v1 \
-                            $(AMIROLLD)/drivers/AT24C01B/v1 \
-                            $(AMIROLLD)/drivers/BNO055/v1 \
-                            $(AMIROLLD)/drivers/INA219/v1 \
-                            $(AMIROLLD)/drivers/LED/v1 \
-                            $(AMIROLLD)/drivers/LTC4412/v1 \
-                            $(AMIROLLD)/drivers/PCA9544A/v1 \
-                            $(AMIROLLD)/drivers/TPS6211x/v1 \
-                            $(AMIROLLD)/drivers/VCNL4020/v1
+include $(AMIROLLD)/drivers/A3906/v1/alld_A3906.mk
+include $(AMIROLLD)/drivers/AT24C01B/v1/alld_AT24C01B.mk
+#include $(AMIROLLD)/drivers/BNO055/v1/alld_BNO055.mk
+include $(AMIROLLD)/drivers/INA219/v1/alld_INA219.mk
+include $(AMIROLLD)/drivers/LED/v1/alld_LED.mk
+include $(AMIROLLD)/drivers/LTC4412/v1/alld_LTC4412.mk
+include $(AMIROLLD)/drivers/PCA9544A/v1/alld_PCA9544A.mk
+include $(AMIROLLD)/drivers/TPS6211x/v1/alld_TPS6211x.mk
+include $(AMIROLLD)/drivers/VCNL4020/v1/alld_VCNL4020.mk
 
 # Tests.
 AMIROOS_TEST_INC += $(AMIROOS_TEST_DIR)periphery-lld/A3906_v1 \
                     $(AMIROOS_TEST_DIR)periphery-lld/AT24C01B_v1 \
-                    $(AMIROOS_TEST_DIR)periphery-lld/BNO055_v1 \
                     $(AMIROOS_TEST_DIR)periphery-lld/INA219_v1 \
                     $(AMIROOS_TEST_DIR)periphery-lld/LED_v1 \
                     $(AMIROOS_TEST_DIR)periphery-lld/LTC4412_v1 \
@@ -163,8 +162,8 @@ AMIROOS_TEST_INC += $(AMIROOS_TEST_DIR)periphery-lld/A3906_v1 \
                     $(AMIROOS_TEST_DIR)periphery-lld/VCNL4020_v1
 
 # Module specific inclusion directories
-MODULE_INC = $(MODULEDIR) \
-             $(wildcard $(MODULEDIR)/test/*)
+MODULE_INC = $(MODULE_DIR) \
+             $(wildcard $(MODULE_DIR)/test/*)
 
 # Module specific C source files.
 MODULE_CSRC = $(wildcard $(MODULE_INC:%=%/*.[Cc]))
diff --git a/modules/LightRing_1-0/Makefile b/modules/LightRing_1-0/Makefile
index fb415bb..8ecd863 100644
--- a/modules/LightRing_1-0/Makefile
+++ b/modules/LightRing_1-0/Makefile
@@ -122,18 +122,18 @@ PROJECT := $(notdir $(PROJECT_PATH))
 MCU := cortex-m3
 
 # Module specific paths and directories.
-MODULEDIR := .
-CONFDIR := $(MODULEDIR)
-ifeq ($(BUILDDIR),)
-  BUILDDIR := $(PROJECT_PATH)/build
+MODULE_DIR := .
+CONFIG_DIR := $(MODULEDIR)
+ifeq ($(BUILD_DIR),)
+  BUILD_DIR := $(PROJECT_PATH)/build
 endif
-DEPDIR := $(dir $(BUILDDIR)).dep
+DEP_DIR := $(dir $(BUILD_DIR)).dep
 
 # Linker script.
-LDSCRIPT= STM32F103xE.ld
+LDSCRIPT = STM32F103xE.ld
 
 # General AMiRo-OS files.
-include ../../amiroos.mk
+include ../../amiro-os.mk
 
 # Module specific ChibiOS files.
 include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f1xx.mk
@@ -141,9 +141,9 @@ include $(CHIBIOS)/os/hal/ports/STM32/STM32F1xx/platform.mk
 include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
 
 # Periphery LLDs.
-AMIROOS_PERIPHERYLLD_INC += $(AMIROLLD)/drivers/AT24C01B/v1 \
-                            $(AMIROLLD)/drivers/TLC5947/v1 \
-                            $(AMIROLLD)/drivers/TPS20xxB/v1
+include $(AMIROLLD)/drivers/AT24C01B/v1/alld_AT24C01B.mk
+include $(AMIROLLD)/drivers/TLC5947/v1/alld_TLC5947.mk
+include $(AMIROLLD)/drivers/TPS20xxB/v1/alld_TPS20xxB.mk
 
 # Tests.
 AMIROOS_TEST_INC += $(AMIROOS_TEST_DIR)periphery-lld/AT24C01B_v1 \
@@ -151,8 +151,8 @@ AMIROOS_TEST_INC += $(AMIROOS_TEST_DIR)periphery-lld/AT24C01B_v1 \
                     $(AMIROOS_TEST_DIR)periphery-lld/TPS20xxB_v1
 
 # Module specific inclusion directories
-MODULE_INC = $(MODULEDIR) \
-             $(wildcard $(MODULEDIR)/test/*)
+MODULE_INC = $(MODULE_DIR) \
+             $(wildcard $(MODULE_DIR)/test/*)
 
 # Module specific C source files.
 MODULE_CSRC = $(wildcard $(MODULE_INC:%=%/*.[Cc]))
diff --git a/modules/LightRing_1-2/Makefile b/modules/LightRing_1-2/Makefile
index 08d8b9e..d312fb3 100644
--- a/modules/LightRing_1-2/Makefile
+++ b/modules/LightRing_1-2/Makefile
@@ -122,18 +122,18 @@ PROJECT := $(notdir $(PROJECT_PATH))
 MCU := cortex-m3
 
 # Module specific paths and directories.
-MODULEDIR := .
-CONFDIR := $(MODULEDIR)
-ifeq ($(BUILDDIR),)
-  BUILDDIR := $(PROJECT_PATH)/build
+MODULE_DIR := .
+CONFIG_DIR := $(MODULEDIR)
+ifeq ($(BUILD_DIR),)
+  BUILD_DIR := $(PROJECT_PATH)/build
 endif
-DEPDIR := $(dir $(BUILDDIR)).dep
+DEP_DIR := $(dir $(BUILD_DIR)).dep
 
 # Linker script.
-LDSCRIPT= STM32F103xE.ld
+LDSCRIPT = STM32F103xE.ld
 
 # General AMiRo-OS files.
-include ../../amiroos.mk
+include ../../amiro-os.mk
 
 # Module specific ChibiOS files.
 include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f1xx.mk
@@ -141,12 +141,12 @@ include $(CHIBIOS)/os/hal/ports/STM32/STM32F1xx/platform.mk
 include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
 
 # Periphery LLDs.
-AMIROOS_PERIPHERYLLD_INC += $(AMIROLLD)/drivers/AT24C01B/v1 \
-                            $(AMIROLLD)/drivers/INA219/v1 \
-                            $(AMIROLLD)/drivers/LED/v1 \
-                            $(AMIROLLD)/drivers/MIC9404x/v1 \
-                            $(AMIROLLD)/drivers/TLC5947/v1 \
-			    $(AMIROLLD)/drivers/DW1000/v1
+include $(AMIROLLD)/drivers/AT24C01B/v1/alld_AT24C01B.mk
+include $(AMIROLLD)/drivers/INA219/v1/alld_INA219.mk
+include $(AMIROLLD)/drivers/LED/v1/alld_LED.mk
+include $(AMIROLLD)/drivers/MIC9404x/v1/alld_MIC9404x.mk
+include $(AMIROLLD)/drivers/TLC5947/v1/alld_TLC5947.mk
+include $(AMIROLLD)/drivers/DW1000/v1/alld_DW1000.mk
 
 # Tests.
 AMIROOS_TEST_INC += $(AMIROOS_TEST_DIR)periphery-lld/AT24C01B_v1 \
@@ -154,11 +154,11 @@ AMIROOS_TEST_INC += $(AMIROOS_TEST_DIR)periphery-lld/AT24C01B_v1 \
                     $(AMIROOS_TEST_DIR)periphery-lld/LED_v1 \
                     $(AMIROOS_TEST_DIR)periphery-lld/MIC9404x_v1 \
                     $(AMIROOS_TEST_DIR)periphery-lld/TLC5947_v1 \
-		    $(AMIROOS_TEST_DIR)periphery-lld/DW1000_v1
+                    $(AMIROOS_TEST_DIR)periphery-lld/DW1000_v1
 
 # Module specific inclusion directories
-MODULE_INC = $(MODULEDIR) \
-             $(wildcard $(MODULEDIR)/test/*)
+MODULE_INC = $(MODULE_DIR) \
+             $(wildcard $(MODULE_DIR)/test/*)
 
 # Module specific C source files.
 MODULE_CSRC = $(wildcard $(MODULE_INC:%=%/*.[Cc]))
@@ -216,7 +216,7 @@ include $(RULESPATH)/rules.mk
 #                                                                              #
 
 FLASH_MODULES = $(PROJECT)
-FLASH_FILES = $(BUILDDIR)/$(PROJECT).$(FLASHTOOL_EXT)
+FLASH_FILES = $(BUILD_DIR)/$(PROJECT).$(FLASHTOOL_EXT)
 
 flash: $(FLASH_FILES)
 	$(info )
diff --git a/modules/NUCLEO-F103RB/Makefile b/modules/NUCLEO-F103RB/Makefile
index ed11cae..edb9b73 100644
--- a/modules/NUCLEO-F103RB/Makefile
+++ b/modules/NUCLEO-F103RB/Makefile
@@ -119,21 +119,21 @@ PROJECT_PATH := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
 PROJECT := $(notdir $(PROJECT_PATH))
 
 # Target settings.
-MCU = cortex-m3
+MCU := cortex-m3
 
 # Module specific paths and directories.
-MODULEDIR := .
-CONFDIR := $(MODULEDIR)
-ifeq ($(BUILDDIR),)
-  BUILDDIR := $(PROJECT_PATH)/build
+MODULE_DIR := .
+CONFIG_DIR := $(MODULEDIR)
+ifeq ($(BUILD_DIR),)
+  BUILD_DIR := $(PROJECT_PATH)/build
 endif
-DEPDIR := $(dir $(BUILDDIR)).dep
+DEP_DIR := $(dir $(BUILD_DIR)).dep
 
 # Linker script.
-LDSCRIPT= STM32F103xB.ld
+LDSCRIPT = STM32F103xB.ld
 
 # General AMiRo-OS files.
-include ../../amiroos.mk
+include ../../amiro-os.mk
 
 # Module specific ChibiOS files.
 include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f1xx.mk
@@ -141,9 +141,9 @@ include $(CHIBIOS)/os/hal/ports/STM32/STM32F1xx/platform.mk
 include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
 
 # Periphery LLDs.
-AMIROOS_PERIPHERYLLD_INC += $(AMIROLLD)/drivers/LED/v1 \
-                            $(AMIROLLD)/drivers/button/v1\
-                            $(AMIROLLD)/drivers/DW1000/v1
+include $(AMIROLLD)/drivers/LED/v1/alld_LED.mk
+include $(AMIROLLD)/drivers/button/v1/alld_button.mk
+include $(AMIROLLD)/drivers/DW1000/v1/alld_DW1000.mk
 
 # Tests.
 AMIROOS_TEST_INC += $(AMIROOS_TEST_DIR)periphery-lld/button_v1 \
@@ -151,8 +151,8 @@ AMIROOS_TEST_INC += $(AMIROOS_TEST_DIR)periphery-lld/button_v1 \
                     $(AMIROOS_TEST_DIR)periphery-lld/DW1000_v1
 
 # Module specific inclusion directories
-MODULE_INC = $(MODULEDIR) \
-             $(wildcard $(MODULEDIR)/test/*)
+MODULE_INC = $(MODULE_DIR) \
+             $(wildcard $(MODULE_DIR)/test/*)
 
 # Module specific C source files.
 MODULE_CSRC = $(wildcard $(MODULE_INC:%=%/*.[Cc]))
diff --git a/modules/NUCLEO-F401RE/Makefile b/modules/NUCLEO-F401RE/Makefile
index 417c9a7..2b82f69 100644
--- a/modules/NUCLEO-F401RE/Makefile
+++ b/modules/NUCLEO-F401RE/Makefile
@@ -119,21 +119,21 @@ PROJECT_PATH := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
 PROJECT := $(notdir $(PROJECT_PATH))
 
 # Target settings.
-MCU = cortex-m4
+MCU := cortex-m4
 
 # Module specific paths and directories.
-MODULEDIR := .
-CONFDIR := $(MODULEDIR)
-ifeq ($(BUILDDIR),)
-  BUILDDIR := $(PROJECT_PATH)/build
+MODULE_DIR := .
+CONFIG_DIR := $(MODULEDIR)
+ifeq ($(BUILD_DIR),)
+  BUILD_DIR := $(PROJECT_PATH)/build
 endif
-DEPDIR := $(dir $(BUILDDIR)).dep
+DEP_DIR := $(dir $(BUILD_DIR)).dep
 
 # Linker script.
-LDSCRIPT= STM32F401xE.ld
+LDSCRIPT = STM32F401xE.ld
 
 # General AMiRo-OS files.
-include ../../amiroos.mk
+include ../../amiro-os.mk
 
 # Module specific ChibiOS files.
 include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk
@@ -141,15 +141,15 @@ include $(CHIBIOS)/os/hal/ports/STM32/STM32F4xx/platform.mk
 include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
 
 # Periphery LLDs.
-AMIROOS_PERIPHERYLLD_INC += $(AMIROLLD)/drivers/LED/v1 \
-                            $(AMIROLLD)/drivers/button/v1
+include $(AMIROLLD)/drivers/LED/v1/alld_LED.mk
+include $(AMIROLLD)/drivers/button/v1/alld_button.mk
 
 # Tests.
 AMIROOS_TEST_INC += $(AMIROOS_TEST_DIR)periphery-lld/LED_v1
 
 # Module specific inclusion directories
-MODULE_INC = $(MODULEDIR) \
-             $(wildcard $(MODULEDIR)/test/*)
+MODULE_INC = $(MODULE_DIR) \
+             $(wildcard $(MODULE_DIR)/test/*)
 
 # Module specific C source files.
 MODULE_CSRC = $(wildcard $(MODULE_INC:%=%/*.[Cc]))
diff --git a/modules/NUCLEO-F767ZI/Makefile b/modules/NUCLEO-F767ZI/Makefile
index 381e77f..82ee056 100644
--- a/modules/NUCLEO-F767ZI/Makefile
+++ b/modules/NUCLEO-F767ZI/Makefile
@@ -119,21 +119,21 @@ PROJECT_PATH := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
 PROJECT := $(notdir $(PROJECT_PATH))
 
 # Target settings.
-MCU = cortex-m4
+MCU := cortex-m4
 
 # Module specific paths and directories.
-MODULEDIR := .
-CONFDIR := $(MODULEDIR)
-ifeq ($(BUILDDIR),)
-  BUILDDIR := $(PROJECT_PATH)/build
+MODULE_DIR := .
+CONFIG_DIR := $(MODULEDIR)
+ifeq ($(BUILD_DIR),)
+  BUILD_DIR := $(PROJECT_PATH)/build
 endif
-DEPDIR := $(dir $(BUILDDIR)).dep
+DEP_DIR := $(dir $(BUILD_DIR)).dep
 
 # Linker script.
-LDSCRIPT= STM32F76xxI.ld
+LDSCRIPT = STM32F76xxI.ld
 
 # General AMiRo-OS files.
-include ../../amiroos.mk
+include ../../amiro-os.mk
 
 # Module specific ChibiOS files.
 include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f7xx.mk
@@ -141,14 +141,14 @@ include $(CHIBIOS)/os/hal/ports/STM32/STM32F7xx/platform.mk
 include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
 
 # Periphery LLDs.
-AMIROOS_PERIPHERYLLD_INC += $(AMIROLLD)/drivers/LED/v1 \
-                            $(AMIROLLD)/drivers/button/v1
+include $(AMIROLLD)/drivers/LED/v1/alld_LED.mk
+include $(AMIROLLD)/drivers/button/v1/alld_button.mk
 # Tests.
 AMIROOS_TEST_INC += $(AMIROOS_TEST_DIR)periphery-lld/LED_v1
 
 # Module specific inclusion directories
-MODULE_INC = $(MODULEDIR) \
-             $(wildcard $(MODULEDIR)/test/*)
+MODULE_INC = $(MODULE_DIR) \
+             $(wildcard $(MODULE_DIR)/test/*)
 
 # Module specific C source files.
 MODULE_CSRC = $(wildcard $(MODULE_INC:%=%/*.[Cc]))
diff --git a/modules/NUCLEO-L476RG/Makefile b/modules/NUCLEO-L476RG/Makefile
index 67f7791..80d5ccc 100644
--- a/modules/NUCLEO-L476RG/Makefile
+++ b/modules/NUCLEO-L476RG/Makefile
@@ -122,18 +122,18 @@ PROJECT := $(notdir $(PROJECT_PATH))
 MCU := cortex-m4
 
 # Module specific paths and directories.
-MODULEDIR := .
-CONFDIR := $(MODULEDIR)
-ifeq ($(BUILDDIR),)
-  BUILDDIR := $(PROJECT_PATH)/build
+MODULE_DIR := .
+CONFIG_DIR := $(MODULEDIR)
+ifeq ($(BUILD_DIR),)
+  BUILD_DIR := $(PROJECT_PATH)/build
 endif
-DEPDIR := $(dir $(BUILDDIR)).dep
+DEP_DIR := $(dir $(BUILD_DIR)).dep
 
 # Linker script.
-LDSCRIPT := $(MODULEDIR)/STM32L476xG.ld
+LDSCRIPT := $(MODULE_DIR)/STM32L476xG.ld
 
 # General AMiRo-OS files.
-include ../../amiroos.mk
+include ../../amiro-os.mk
 
 # Module specific ChibiOS files.
 include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32l4xx.mk
@@ -141,9 +141,9 @@ include $(CHIBIOS)/os/hal/ports/STM32/STM32L4xx/platform.mk
 include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
 
 # Periphery LLDs.
-AMIROOS_PERIPHERYLLD_INC += $(AMIROLLD)/drivers/LED/v1 \
-                            $(AMIROLLD)/drivers/button/v1 \
-                            $(AMIROLLD)/drivers/MPU6050/v1
+include $(AMIROLLD)/drivers/LED/v1/alld_LED.mk
+include $(AMIROLLD)/drivers/button/v1/alld_button.mk
+include $(AMIROLLD)/drivers/MPU6050/v1/alld_MPU6050.mk
 
 # Tests.
 AMIROOS_TEST_INC += $(AMIROOS_TEST_DIR)periphery-lld/button_v1 \
@@ -151,8 +151,8 @@ AMIROOS_TEST_INC += $(AMIROOS_TEST_DIR)periphery-lld/button_v1 \
                     $(AMIROOS_TEST_DIR)periphery-lld/MPU6050_v1
 
 # Module specific inclusion directories
-MODULE_INC = $(MODULEDIR) \
-             $(wildcard $(MODULEDIR)/test/*)
+MODULE_INC = $(MODULE_DIR) \
+             $(wildcard $(MODULE_DIR)/test/*)
 
 # Module specific C source files.
 MODULE_CSRC = $(wildcard $(MODULE_INC:%=%/*.[Cc]))
diff --git a/modules/PowerManagement_1-1/Makefile b/modules/PowerManagement_1-1/Makefile
index edcaf66..4886790 100644
--- a/modules/PowerManagement_1-1/Makefile
+++ b/modules/PowerManagement_1-1/Makefile
@@ -122,18 +122,18 @@ PROJECT := $(notdir $(PROJECT_PATH))
 MCU := cortex-m4
 
 # Module specific paths and directories.
-MODULEDIR := .
-CONFDIR := $(MODULEDIR)
-ifeq ($(BUILDDIR),)
-  BUILDDIR := $(PROJECT_PATH)/build
+MODULE_DIR := .
+CONFIG_DIR := $(MODULEDIR)
+ifeq ($(BUILD_DIR),)
+  BUILD_DIR := $(PROJECT_PATH)/build
 endif
-DEPDIR := $(dir $(BUILDDIR)).dep
+DEP_DIR := $(dir $(BUILD_DIR)).dep
 
 # Linker script.
-LDSCRIPT= STM32F405xG.ld
+LDSCRIPT = STM32F405xG.ld
 
 # General AMiRo-OS files.
-include ../../amiroos.mk
+include ../../amiro-os.mk
 
 # Module specific ChibiOS files.
 include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk
@@ -141,18 +141,18 @@ include $(CHIBIOS)/os/hal/ports/STM32/STM32F4xx/platform.mk
 include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
 
 # Periphery LLDs.
-AMIROOS_PERIPHERYLLD_INC += $(AMIROLLD)/drivers/AT24C01B/v1 \
-                            $(AMIROLLD)/drivers/AT42QT1050/v1 \
-                            $(AMIROLLD)/drivers/bq241xx/v1 \
-                            $(AMIROLLD)/drivers/bq27500/v1 \
-                            $(AMIROLLD)/drivers/INA219/v1 \
-                            $(AMIROLLD)/drivers/LED/v1 \
-                            $(AMIROLLD)/drivers/MPR121/v1 \
-                            $(AMIROLLD)/drivers/PCA9544A/v1 \
-                            $(AMIROLLD)/drivers/PCAL6524/v1 \
-                            $(AMIROLLD)/drivers/PKxxxExxx/v1 \
-                            $(AMIROLLD)/drivers/TPS6211x/v1 \
-                            $(AMIROLLD)/drivers/VCNL4020/v1
+include $(AMIROLLD)/drivers/AT24C01B/v1/alld_AT24C01B.mk
+include $(AMIROLLD)/drivers/AT42QT1050/v1/alld_AT42QT1050.mk
+include $(AMIROLLD)/drivers/bq241xx/v1/alld_bq241xx.mk
+include $(AMIROLLD)/drivers/bq27500/v1/alld_bq27500.mk
+include $(AMIROLLD)/drivers/INA219/v1/alld_INA219.mk
+include $(AMIROLLD)/drivers/LED/v1/alld_LED.mk
+include $(AMIROLLD)/drivers/MPR121/v1/alld_MPR121.mk
+include $(AMIROLLD)/drivers/PCA9544A/v1/alld_PCA9544A.mk
+include $(AMIROLLD)/drivers/PCAL6524/v1/alld_PCAL6524.mk
+include $(AMIROLLD)/drivers/PKxxxExxx/v1/alld_PKxxxExxx.mk
+include $(AMIROLLD)/drivers/TPS6211x/v1/alld_TPS6211x.mk
+include $(AMIROLLD)/drivers/VCNL4020/v1/alld_VCNL4020.mk
 
 # Tests.
 AMIROOS_TEST_INC += $(AMIROOS_TEST_DIR)lld/adc \
@@ -172,8 +172,8 @@ AMIROOS_TEST_INC += $(AMIROOS_TEST_DIR)lld/adc \
                     $(AMIROOS_TEST_DIR)periphery-lld/VCNL4020_v1
 
 # Module specific inclusion directories
-MODULE_INC = $(MODULEDIR) \
-             $(wildcard $(MODULEDIR)/test/*)
+MODULE_INC = $(MODULE_DIR) \
+             $(wildcard $(MODULE_DIR)/test/*)
 
 # Module specific C source files.
 MODULE_CSRC = $(wildcard $(MODULE_INC:%=%/*.[Cc]))
diff --git a/modules/PowerManagement_1-2/Makefile b/modules/PowerManagement_1-2/Makefile
index edcaf66..4886790 100644
--- a/modules/PowerManagement_1-2/Makefile
+++ b/modules/PowerManagement_1-2/Makefile
@@ -122,18 +122,18 @@ PROJECT := $(notdir $(PROJECT_PATH))
 MCU := cortex-m4
 
 # Module specific paths and directories.
-MODULEDIR := .
-CONFDIR := $(MODULEDIR)
-ifeq ($(BUILDDIR),)
-  BUILDDIR := $(PROJECT_PATH)/build
+MODULE_DIR := .
+CONFIG_DIR := $(MODULEDIR)
+ifeq ($(BUILD_DIR),)
+  BUILD_DIR := $(PROJECT_PATH)/build
 endif
-DEPDIR := $(dir $(BUILDDIR)).dep
+DEP_DIR := $(dir $(BUILD_DIR)).dep
 
 # Linker script.
-LDSCRIPT= STM32F405xG.ld
+LDSCRIPT = STM32F405xG.ld
 
 # General AMiRo-OS files.
-include ../../amiroos.mk
+include ../../amiro-os.mk
 
 # Module specific ChibiOS files.
 include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk
@@ -141,18 +141,18 @@ include $(CHIBIOS)/os/hal/ports/STM32/STM32F4xx/platform.mk
 include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
 
 # Periphery LLDs.
-AMIROOS_PERIPHERYLLD_INC += $(AMIROLLD)/drivers/AT24C01B/v1 \
-                            $(AMIROLLD)/drivers/AT42QT1050/v1 \
-                            $(AMIROLLD)/drivers/bq241xx/v1 \
-                            $(AMIROLLD)/drivers/bq27500/v1 \
-                            $(AMIROLLD)/drivers/INA219/v1 \
-                            $(AMIROLLD)/drivers/LED/v1 \
-                            $(AMIROLLD)/drivers/MPR121/v1 \
-                            $(AMIROLLD)/drivers/PCA9544A/v1 \
-                            $(AMIROLLD)/drivers/PCAL6524/v1 \
-                            $(AMIROLLD)/drivers/PKxxxExxx/v1 \
-                            $(AMIROLLD)/drivers/TPS6211x/v1 \
-                            $(AMIROLLD)/drivers/VCNL4020/v1
+include $(AMIROLLD)/drivers/AT24C01B/v1/alld_AT24C01B.mk
+include $(AMIROLLD)/drivers/AT42QT1050/v1/alld_AT42QT1050.mk
+include $(AMIROLLD)/drivers/bq241xx/v1/alld_bq241xx.mk
+include $(AMIROLLD)/drivers/bq27500/v1/alld_bq27500.mk
+include $(AMIROLLD)/drivers/INA219/v1/alld_INA219.mk
+include $(AMIROLLD)/drivers/LED/v1/alld_LED.mk
+include $(AMIROLLD)/drivers/MPR121/v1/alld_MPR121.mk
+include $(AMIROLLD)/drivers/PCA9544A/v1/alld_PCA9544A.mk
+include $(AMIROLLD)/drivers/PCAL6524/v1/alld_PCAL6524.mk
+include $(AMIROLLD)/drivers/PKxxxExxx/v1/alld_PKxxxExxx.mk
+include $(AMIROLLD)/drivers/TPS6211x/v1/alld_TPS6211x.mk
+include $(AMIROLLD)/drivers/VCNL4020/v1/alld_VCNL4020.mk
 
 # Tests.
 AMIROOS_TEST_INC += $(AMIROOS_TEST_DIR)lld/adc \
@@ -172,8 +172,8 @@ AMIROOS_TEST_INC += $(AMIROOS_TEST_DIR)lld/adc \
                     $(AMIROOS_TEST_DIR)periphery-lld/VCNL4020_v1
 
 # Module specific inclusion directories
-MODULE_INC = $(MODULEDIR) \
-             $(wildcard $(MODULEDIR)/test/*)
+MODULE_INC = $(MODULE_DIR) \
+             $(wildcard $(MODULE_DIR)/test/*)
 
 # Module specific C source files.
 MODULE_CSRC = $(wildcard $(MODULE_INC:%=%/*.[Cc]))
diff --git a/modules/STM32F407G-DISC1/Makefile b/modules/STM32F407G-DISC1/Makefile
index 6733968..1ee7236 100644
--- a/modules/STM32F407G-DISC1/Makefile
+++ b/modules/STM32F407G-DISC1/Makefile
@@ -119,21 +119,21 @@ PROJECT_PATH := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
 PROJECT := $(notdir $(PROJECT_PATH))
 
 # Target settings.
-MCU = cortex-m4
+MCU := cortex-m4
 
 # Module specific paths and directories.
-MODULEDIR := .
-CONFDIR := $(MODULEDIR)
-ifeq ($(BUILDDIR),)
-  BUILDDIR := $(PROJECT_PATH)/build
+MODULE_DIR := .
+CONFIG_DIR := $(MODULEDIR)
+ifeq ($(BUILD_DIR),)
+  BUILD_DIR := $(PROJECT_PATH)/build
 endif
-DEPDIR := $(dir $(BUILDDIR)).dep
+DEP_DIR := $(dir $(BUILD_DIR)).dep
 
 # Linker script.
-LDSCRIPT= STM32F407xG.ld
+LDSCRIPT = STM32F407xG.ld
 
 # General AMiRo-OS files.
-include ../../amiroos.mk
+include ../../amiro-os.mk
 
 # Module specific ChibiOS files.
 include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk
@@ -141,15 +141,15 @@ include $(CHIBIOS)/os/hal/ports/STM32/STM32F4xx/platform.mk
 include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
 
 # Periphery LLDs.
-AMIROOS_PERIPHERYLLD_INC += $(AMIROLLD)/drivers/LED/v1 \
-                            $(AMIROLLD)/drivers/button/v1
+include $(AMIROLLD)/drivers/LED/v1/alld_LED.mk
+include $(AMIROLLD)/drivers/button/v1/alld_button.mk
 
 # Tests.
 AMIROOS_TEST_INC += $(AMIROOS_TEST_DIR)periphery-lld/LED_v1
 
 # Module specific inclusion directories
-MODULE_INC = $(MODULEDIR) \
-             $(wildcard $(MODULEDIR)/test/*)
+MODULE_INC = $(MODULE_DIR) \
+             $(wildcard $(MODULE_DIR)/test/*)
 
 # Module specific C source files.
 MODULE_CSRC = $(wildcard $(MODULE_INC:%=%/*.[Cc]))
diff --git a/modules/modules.mk b/modules/modules.mk
index 7e0272d..fa7c272 100644
--- a/modules/modules.mk
+++ b/modules/modules.mk
@@ -23,7 +23,7 @@
 
 
 
-# absolute path to this directory
+# path to this directory
 AMIROOS_MODULES_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
 
 # include paths
diff --git a/periphery-lld/AMiRo-LLD b/periphery-lld/AMiRo-LLD
index a5507ed..e637a51 160000
--- a/periphery-lld/AMiRo-LLD
+++ b/periphery-lld/AMiRo-LLD
@@ -1 +1 @@
-Subproject commit a5507edc6e69616a793494b332121a60ad8af7f9
+Subproject commit e637a5101e3bb1e0a082aa7d532c253af2263221
diff --git a/periphery-lld/periphery-lld.mk b/periphery-lld/periphery-lld.mk
index 79e276d..2b9f0f6 100644
--- a/periphery-lld/periphery-lld.mk
+++ b/periphery-lld/periphery-lld.mk
@@ -23,17 +23,16 @@
 
 
 
-# absolute path to this directory
+# path to this directory
 AMIRO_PERIPHERYLLD_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
 
-# set AMiRo-LLD path variable
-AMIROLLD := $(AMIRO_PERIPHERYLLD_DIR)AMiRo-LLD
+# load peryphery LLD files
+include $(AMIRO_PERIPHERYLLD_DIR)AMiRo-LLD/amiro-lld.mk
 
 # include paths
-AMIROOS_PERIPHERYLLD_INC = $(AMIROLLD) \
-                           $(AMIRO_PERIPHERYLLD_DIR:/=)
+AMIROOS_PERIPHERYLLD_INC = $(AMIRO_PERIPHERYLLD_DIR:/=) \
+                           $(AMIROLLD_INC)
 
 # C source files
-AMIROOS_PERIPHERYLLD_CSRC = $(AMIROLLD_CSRC) \
-                            $(wildcard $(AMIROOS_PERIPHERYLLD_INC:%=%/*.[Cc]))
-
+AMIROOS_PERIPHERYLLD_CSRC = $(AMIRO_PERIPHERYLLD_DIR)periphAL.c \
+                            $(AMIROLLD_CSRC) \
diff --git a/test/test.mk b/test/test.mk
index 4c48778..0b0ebe9 100644
--- a/test/test.mk
+++ b/test/test.mk
@@ -23,7 +23,7 @@
 
 
 
-# absolute path to this directory
+# path to this directory
 AMIROOS_TEST_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
 
 # include path
