Currently you need to add every new sys and driver module into the
respective Makefile. This requires rebasing if another module was merged
in the meantime.
This PR allows you to omit the entry to {sys,drivers}/Makefile, if the
subfolder has the same name as the module name, which should be sensible
in most cases.
Many modules have subdirectories. Often these subdirectories should only
be included under certain circumstances. Modules that use submodules
currently need to use this pattern:
```make
DIRS = …
all: $(BINDIR)$(MODULE).a
@for i in $(DIRS) ; do $(MAKE) -C $$i ; done ;
include $(RIOTBASE)/Makefile.base
clean::
@for i in $(DIRS) ; do $(MAKE) -C $$i clean ; done ;
```
This PR moves the `all:` and `clean::` boilerplate into `Makefile.base`.
For many modules the `Makefile` contains a line like
```
MODULE:=$(shell basename $(CURDIR))
```
This conclusively shows that we do not have to set the module name
manually.
This PR removes the need to set the module name manually, if it is the
same as the basename. E.g. for `…/sys/vtimer/Makefile` the variable
make `MODULE` will still be `vtimer`, because it is the basename of the
Makefile.
Closes#993.
We do not need to descend into the modules to know what to do on
`make clean BOARD=blub`. We can just invoke `rm -rf bin/blub`.
This PR only keeps the descending into the USEPKGs, since they might
want to delete cached/downloaded/extracted data.