Skip to content
Snippets Groups Projects
Commit 840c0f0a authored by René Kijewski's avatar René Kijewski
Browse files

make: detect their module name automatically

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.
parent 997dcd7e
No related branches found
No related tags found
No related merge requests found
Showing
with 2 additions and 37 deletions
......@@ -2,6 +2,8 @@ ifeq (, $(__RIOTBUILD_FLAG))
$(error You cannot build a module on its own. Use "make" in your application's directory instead.)
endif
MODULE ?= $(shell basename $(CURDIR))
ASMSRC = $(wildcard *.s)
ASSMSRC = $(wildcard *.S)
ASMOBJ = $(ASMSRC:%.s=$(BINDIR)$(MODULE)/%.o)
......
MODULE =core
include $(RIOTBASE)/Makefile.base
MODULE =arm_common
CFLAGS += $(CFLAGS_BASIC)
include $(RIOTBASE)/Makefile.base
# define the module that is build
MODULE = cortex-m3_common
include $(RIOTBASE)/Makefile.base
MODULE =gpioint
include $(RIOTBASE)/Makefile.base
MODULE =i2c
include $(RIOTBASE)/Makefile.base
MODULE =mci
include $(RIOTBASE)/Makefile.base
MODULE =rtc
include $(RIOTBASE)/Makefile.base
MODULE =lpc_common
include $(RIOTBASE)/Makefile.base
MODULE =rtc
include $(RIOTBASE)/Makefile.base
$(BINDIR)$(MODULE)/%.o: %.c
......
MODULE = periph
include $(RIOTBASE)/Makefile.base
MODULE = drivers
DIRS=
ifneq (,$(filter powermon,$(USEMODULE)))
DIRS += powermon
......
MODULE =at86rf231
include $(RIOTBASE)/Makefile.base
MODULE =cc110x
include $(RIOTBASE)/Makefile.base
MODULE =cc110x_ng
DIRS =
ifneq (,$(filter msb-430h,$(BOARD)))
DIRS += spi
......
MODULE =cc2420
include $(RIOTBASE)/Makefile.base
MODULE =lm75a
include $(RIOTBASE)/Makefile.base
MODULE =ltc4150
include $(RIOTBASE)/Makefile.base
MODULE =sht11
include $(RIOTBASE)/Makefile.base
MODULE =srf02
include $(RIOTBASE)/Makefile.base
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment