Browse Source

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.
dev/timer
René Kijewski 8 years ago
parent
commit
840c0f0a57
  1. 2
      Makefile.base
  2. 2
      core/Makefile
  3. 2
      cpu/arm_common/Makefile
  4. 4
      cpu/cortex-m3_common/Makefile
  5. 2
      cpu/lpc2387/gpioint/Makefile
  6. 2
      cpu/lpc2387/i2c/Makefile
  7. 2
      cpu/lpc2387/mci/Makefile
  8. 2
      cpu/lpc2387/rtc/Makefile
  9. 2
      cpu/lpc_common/Makefile
  10. 2
      cpu/native/rtc/Makefile
  11. 3
      cpu/sam3x8e/periph/Makefile
  12. 2
      drivers/Makefile
  13. 2
      drivers/at86rf231/Makefile
  14. 2
      drivers/cc110x/Makefile
  15. 2
      drivers/cc110x_ng/Makefile
  16. 2
      drivers/cc2420/Makefile
  17. 1
      drivers/lm75a/Makefile
  18. 1
      drivers/ltc4150/Makefile
  19. 1
      drivers/sht11/Makefile
  20. 1
      drivers/srf02/Makefile
  21. 1
      drivers/srf08/Makefile
  22. 2
      sys/auto_init/Makefile
  23. 2
      sys/bloom/Makefile
  24. 2
      sys/config/Makefile
  25. 2
      sys/crypto/Makefile
  26. 2
      sys/hashes/Makefile
  27. 2
      sys/lib/Makefile
  28. 2
      sys/net/ccn_lite/Makefile
  29. 2
      sys/net/crosslayer/net_help/Makefile
  30. 2
      sys/net/link_layer/ieee802154/Makefile
  31. 1
      sys/net/link_layer/net_if/Makefile
  32. 1
      sys/net/network_layer/sixlowpan/Makefile
  33. 2
      sys/net/routing/Makefile
  34. 2
      sys/net/routing/rpl/Makefile
  35. 2
      sys/net/transport_layer/destiny/Makefile
  36. 2
      sys/ping/Makefile
  37. 2
      sys/posix/Makefile
  38. 2
      sys/posix/pnet/Makefile
  39. 2
      sys/posix/pthread/Makefile
  40. 2
      sys/ps/Makefile
  41. 2
      sys/quad_math/Makefile
  42. 2
      sys/random/Makefile
  43. 2
      sys/shell/Makefile
  44. 2
      sys/timex/Makefile
  45. 2
      sys/transceiver/Makefile
  46. 2
      sys/uart0/Makefile
  47. 2
      sys/vtimer/Makefile
  48. 2
      tests/unittests/tests-core/Makefile

2
Makefile.base

@ -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)

2
core/Makefile

@ -1,3 +1 @@
MODULE =core
include $(RIOTBASE)/Makefile.base

2
cpu/arm_common/Makefile

@ -1,4 +1,2 @@
MODULE =arm_common
CFLAGS += $(CFLAGS_BASIC)
include $(RIOTBASE)/Makefile.base

4
cpu/cortex-m3_common/Makefile

@ -1,5 +1 @@
# define the module that is build
MODULE = cortex-m3_common
include $(RIOTBASE)/Makefile.base

2
cpu/lpc2387/gpioint/Makefile

@ -1,3 +1 @@
MODULE =gpioint
include $(RIOTBASE)/Makefile.base

2
cpu/lpc2387/i2c/Makefile

@ -1,3 +1 @@
MODULE =i2c
include $(RIOTBASE)/Makefile.base

2
cpu/lpc2387/mci/Makefile

@ -1,3 +1 @@
MODULE =mci
include $(RIOTBASE)/Makefile.base

2
cpu/lpc2387/rtc/Makefile

@ -1,3 +1 @@
MODULE =rtc
include $(RIOTBASE)/Makefile.base

2
cpu/lpc_common/Makefile

@ -1,3 +1 @@
MODULE =lpc_common
include $(RIOTBASE)/Makefile.base

2
cpu/native/rtc/Makefile

@ -1,5 +1,3 @@
MODULE =rtc
include $(RIOTBASE)/Makefile.base
$(BINDIR)$(MODULE)/%.o: %.c

3
cpu/sam3x8e/periph/Makefile

@ -1,4 +1 @@
MODULE = periph
include $(RIOTBASE)/Makefile.base

2
drivers/Makefile

@ -1,5 +1,3 @@
MODULE = drivers
DIRS=
ifneq (,$(filter powermon,$(USEMODULE)))
DIRS += powermon

2
drivers/at86rf231/Makefile

@ -1,3 +1 @@
MODULE =at86rf231
include $(RIOTBASE)/Makefile.base

2
drivers/cc110x/Makefile

@ -1,3 +1 @@
MODULE =cc110x
include $(RIOTBASE)/Makefile.base

2
drivers/cc110x_ng/Makefile

@ -1,5 +1,3 @@
MODULE =cc110x_ng
DIRS =
ifneq (,$(filter msb-430h,$(BOARD)))
DIRS += spi

2
drivers/cc2420/Makefile

@ -1,3 +1 @@
MODULE =cc2420
include $(RIOTBASE)/Makefile.base

1
drivers/lm75a/Makefile

@ -1,2 +1 @@
MODULE =lm75a
include $(RIOTBASE)/Makefile.base

1
drivers/ltc4150/Makefile

@ -1,2 +1 @@
MODULE =ltc4150
include $(RIOTBASE)/Makefile.base

1
drivers/sht11/Makefile

@ -1,2 +1 @@
MODULE =sht11
include $(RIOTBASE)/Makefile.base

1
drivers/srf02/Makefile

@ -1,2 +1 @@
MODULE =srf02
include $(RIOTBASE)/Makefile.base

1
drivers/srf08/Makefile

@ -1,2 +1 @@
MODULE =srf08
include $(RIOTBASE)/Makefile.base

2
sys/auto_init/Makefile

@ -1,5 +1,3 @@
MODULE = auto_init
ifneq (,$(filter net_if,$(USEMODULE)))
INCLUDES += -I$(RIOTBASE)/sys/net/include/
endif

2
sys/bloom/Makefile

@ -1,3 +1 @@
MODULE = bloom
include $(RIOTBASE)/Makefile.base

2
sys/config/Makefile

@ -1,3 +1 @@
MODULE =config
include $(RIOTBASE)/Makefile.base

2
sys/crypto/Makefile

@ -1,3 +1 @@
MODULE = crypto
include $(RIOTBASE)/Makefile.base

2
sys/hashes/Makefile

@ -1,3 +1 @@
MODULE = hashes
include $(RIOTBASE)/Makefile.base

2
sys/lib/Makefile

@ -1,3 +1 @@
MODULE =lib
include $(RIOTBASE)/Makefile.base

2
sys/net/ccn_lite/Makefile

@ -1,3 +1 @@
MODULE := ccn_lite
include $(RIOTBASE)/Makefile.base

2
sys/net/crosslayer/net_help/Makefile

@ -1,3 +1 @@
MODULE:=$(shell basename $(CURDIR))
include $(RIOTBASE)/Makefile.base

2
sys/net/link_layer/ieee802154/Makefile

@ -1,3 +1 @@
MODULE:=$(shell basename $(CURDIR))
include $(RIOTBASE)/Makefile.base

1
sys/net/link_layer/net_if/Makefile

@ -1,4 +1,3 @@
MODULE:=$(shell basename $(CURDIR))
INCLUDES += -I$(RIOTBASE)/drivers/include \
-I$(RIOTBASE)/drivers/cc110x_ng/include \
-I$(RIOTBASE)/sys/net/include

1
sys/net/network_layer/sixlowpan/Makefile

@ -1,2 +1 @@
MODULE:=$(shell basename $(CURDIR))
include $(RIOTBASE)/Makefile.base

2
sys/net/routing/Makefile

@ -1,3 +1 @@
MODULE:=$(shell basename $(CURDIR))
include $(RIOTBASE)/Makefile.base

2
sys/net/routing/rpl/Makefile

@ -1,3 +1 @@
MODULE:=$(shell basename $(CURDIR))
include $(RIOTBASE)/Makefile.base

2
sys/net/transport_layer/destiny/Makefile

@ -1,3 +1 @@
MODULE:=$(shell basename $(CURDIR))
include $(RIOTBASE)/Makefile.base

2
sys/ping/Makefile

@ -1,3 +1 @@
MODULE =ping
include $(RIOTBASE)/Makefile.base

2
sys/posix/Makefile

@ -1,3 +1 @@
MODULE = posix
include $(RIOTBASE)/Makefile.base

2
sys/posix/pnet/Makefile

@ -1,3 +1 @@
MODULE =pnet
include $(RIOTBASE)/Makefile.base

2
sys/posix/pthread/Makefile

@ -1,3 +1 @@
MODULE = pthread
include $(RIOTBASE)/Makefile.base

2
sys/ps/Makefile

@ -1,3 +1 @@
MODULE =ps
include $(RIOTBASE)/Makefile.base

2
sys/quad_math/Makefile

@ -1,3 +1 @@
MODULE = quad_math
include $(RIOTBASE)/Makefile.base

2
sys/random/Makefile

@ -1,3 +1 @@
MODULE = random
include $(RIOTBASE)/Makefile.base

2
sys/shell/Makefile

@ -1,3 +1 @@
MODULE = shell
include $(RIOTBASE)/Makefile.base

2
sys/timex/Makefile

@ -1,3 +1 @@
MODULE = timex
include $(RIOTBASE)/Makefile.base

2
sys/transceiver/Makefile

@ -1,5 +1,3 @@
MODULE =transceiver
ifneq (,$(filter cc2420,$(USEMODULE)))
INCLUDES += -I$(RIOTBASE)/sys/net/include
endif

2
sys/uart0/Makefile

@ -1,3 +1 @@
MODULE = uart0
include $(RIOTBASE)/Makefile.base

2
sys/vtimer/Makefile

@ -1,3 +1 @@
MODULE =vtimer
include $(RIOTBASE)/Makefile.base

2
tests/unittests/tests-core/Makefile

@ -1,3 +1 @@
MODULE = tests-core
include $(RIOTBASE)/Makefile.base

Loading…
Cancel
Save