commit 2c89d7e2d81c7f5e02e8bb9fe55f7d857098cb31
Author: Thomas Schöpping <tschoepp@cit-ec.uni-bielefeld.de>
Date:   Mon Dec 17 15:35:33 2018 +0100

    Removed modules/flash.mk since flashing procedures highly depend on hardware.

diff --git a/modules/DiWheelDrive_1-1/Makefile b/modules/DiWheelDrive_1-1/Makefile
index 1a5e66f..d2e9ab4 100644
--- a/modules/DiWheelDrive_1-1/Makefile
+++ b/modules/DiWheelDrive_1-1/Makefile
@@ -294,8 +294,30 @@ ULIBS +=
 # End of user defines                                                          #
 ################################################################################
 
+################################################################################
+# Start of targets section                                                     #
+#                                                                              #
 
+# all and its dependencies
+BUILDDIR = ./build
 RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC
 include $(RULESPATH)/rules.mk
 
-include ../flash.mk
+# flash
+include $(AMIROOS)/bootloader/bootloader.mk
+FLASH_MODULES = $(PROJECT)
+FLASH_FILES = $(BUILDDIR)/$(PROJECT).$(FLASHTOOL_EXT)
+
+flash: $(FLASH_FILES)
+	$(info )
+ifeq ($(FLASHTOOL),SerialBoot)
+	$(info Flashing ($(FLASHTOOL)):)
+	$(FLASHTOOL_CMD) $(FLASHTOOL_ARGS)
+else
+	$(info ERROR: unable to flash the module (SerialBoot unavailable))
+endif
+
+#                                                                              #
+# End of targets section                                                       #
+################################################################################
+
diff --git a/modules/LightRing_1-0/Makefile b/modules/LightRing_1-0/Makefile
index 1a5e66f..d2e9ab4 100644
--- a/modules/LightRing_1-0/Makefile
+++ b/modules/LightRing_1-0/Makefile
@@ -294,8 +294,30 @@ ULIBS +=
 # End of user defines                                                          #
 ################################################################################
 
+################################################################################
+# Start of targets section                                                     #
+#                                                                              #
 
+# all and its dependencies
+BUILDDIR = ./build
 RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC
 include $(RULESPATH)/rules.mk
 
-include ../flash.mk
+# flash
+include $(AMIROOS)/bootloader/bootloader.mk
+FLASH_MODULES = $(PROJECT)
+FLASH_FILES = $(BUILDDIR)/$(PROJECT).$(FLASHTOOL_EXT)
+
+flash: $(FLASH_FILES)
+	$(info )
+ifeq ($(FLASHTOOL),SerialBoot)
+	$(info Flashing ($(FLASHTOOL)):)
+	$(FLASHTOOL_CMD) $(FLASHTOOL_ARGS)
+else
+	$(info ERROR: unable to flash the module (SerialBoot unavailable))
+endif
+
+#                                                                              #
+# End of targets section                                                       #
+################################################################################
+
diff --git a/modules/PowerManagement_1-1/Makefile b/modules/PowerManagement_1-1/Makefile
index 6b29a45..6778ce2 100644
--- a/modules/PowerManagement_1-1/Makefile
+++ b/modules/PowerManagement_1-1/Makefile
@@ -294,8 +294,30 @@ ULIBS +=
 # End of user defines                                                          #
 ################################################################################
 
+################################################################################
+# Start of targets section                                                     #
+#                                                                              #
 
+# all and its dependencies
+BUILDDIR = ./build
 RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC
 include $(RULESPATH)/rules.mk
 
-include ../flash.mk
+# flash
+include $(AMIROOS)/bootloader/bootloader.mk
+FLASH_MODULES = $(PROJECT)
+FLASH_FILES = $(BUILDDIR)/$(PROJECT).$(FLASHTOOL_EXT)
+
+flash: $(FLASH_FILES)
+	$(info )
+ifeq ($(FLASHTOOL),SerialBoot)
+	$(info Flashing ($(FLASHTOOL)):)
+	$(FLASHTOOL_CMD) $(FLASHTOOL_ARGS)
+else
+	$(info ERROR: unable to flash the module (SerialBoot unavailable))
+endif
+
+#                                                                              #
+# End of targets section                                                       #
+################################################################################
+
diff --git a/modules/STM32F4Discovery/Makefile b/modules/STM32F4Discovery/Makefile
index c57cd8e..5efe5c8 100644
--- a/modules/STM32F4Discovery/Makefile
+++ b/modules/STM32F4Discovery/Makefile
@@ -294,12 +294,22 @@ ULIBS +=
 # End of user defines                                                          #
 ################################################################################
 
+################################################################################
+# Start of targets section                                                     #
+#                                                                              #
 
+# all and its dependencies
+BUILDDIR = ./build
 RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC
 include $(RULESPATH)/rules.mk
 
+# flash
 include $(AMIROOS)/bootloader/bootloader.mk
 
-flash: build/$(PROJECT).elf
+flash: $(BUILDDIR)/$(PROJECT).elf
 	openocd -f interface/stlink-v2-1.cfg -c "set WORKAREASIZE 0x2000" -f target/stm32f4x.cfg -c "program build/$(PROJECT).elf verify reset exit"
 
+#                                                                              #
+# End of targets section                                                       #
+################################################################################
+
diff --git a/modules/flash.mk b/modules/flash.mk
deleted file mode 100644
index 7c29958..0000000
--- a/modules/flash.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-################################################################################
-# AMiRo-OS is an operating system designed for the Autonomous Mini Robot       #
-# (AMiRo) platform.                                                            #
-# Copyright (C) 2016..2018  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).                              #
-################################################################################
-
-
-
-# the path to this makefile
-FLASH_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
-
-include $(FLASH_DIR)../bootloader/bootloader.mk
-
-# the files to flash
-ifdef PROJECT
-  FLASH_MODULES = $(PROJECT)
-  FLASH_FILES = build/$(PROJECT).$(FLASHTOOL_EXT)
-else
-  FLASH_MODULES = $(MODULES)
-  FLASH_FILES = $(foreach module,$(MODULES),$(module)/build/$(module).$(FLASHTOOL_EXT))
-endif
-
-flash: $(FLASH_FILES)
-	$(info )
-ifeq ($(FLASHTOOL),SerialBoot)
-	$(info Flashing ($(FLASHTOOL)):)
-	$(FLASHTOOL_CMD) $(FLASHTOOL_ARGS)
-else
-	$(info ERROR: unable to flash the module (SerialBoot unavailable))
-endif
-
