Browse Source

Add include paths automatocally for USEMODULES

Application developers use `$(USEMODULES)` in their Makefiles to have
the relevant functionally automagically added to their apps. This even
does basic dependency tracking by means of `Makefile.dep`.

But an important thing is missing: the automatic adding of include
paths. This is inconvenient, error prone, and will hinder the RIOT core
developers in future to change folder structures.
dev/timer
René Kijewski 9 years ago
parent
commit
de29e4184c
  1. 10
      Makefile.include
  2. 12
      drivers/Makefile.include
  3. 2
      examples/ccn-lite-client/Makefile
  4. 2
      examples/ccn-lite-relay/Makefile
  5. 2
      examples/default/Makefile
  6. 2
      examples/rpl_udp/Makefile
  7. 1
      sys/Makefile
  8. 60
      sys/Makefile.include
  9. 5
      sys/crypto/3des/Makefile
  10. 5
      sys/crypto/aes/Makefile
  11. 5
      sys/crypto/rc5/Makefile
  12. 5
      sys/crypto/sha256/Makefile
  13. 5
      sys/crypto/skipjack/Makefile
  14. 5
      sys/crypto/twofish/Makefile
  15. 2
      sys/net/crosslayer/net_help/Makefile
  16. 4
      sys/net/link_layer/protocol-multiplex/Makefile
  17. 2
      sys/posix/pnet/Makefile
  18. 4
      sys/posix/pthread/Makefile
  19. 1
      sys/shell/commands/Makefile
  20. 2
      tests/test_net_if/Makefile
  21. 11
      tests/test_pnet/Makefile
  22. 7
      tests/test_pthread/Makefile
  23. 7
      tests/test_pthread_cooperation/Makefile

10
Makefile.include

@ -106,6 +106,16 @@ OBJ = $(SRC:%.c=${BINDIR}${PROJECT}/%.o)
$(BINDIR)$(PROJECT).a: $(OBJ)
$(AD)$(AR) -rc $(BINDIR)$(PROJECT).a $(OBJ)
# add extra include paths for packages in $(USEMODULE)
export USEMODULE_INCLUDES =
include $(RIOTBASE)/sys/Makefile.include
include $(RIOTBASE)/drivers/Makefile.include
USEMODULE_INCLUDES_ = $(shell echo $(USEMODULE_INCLUDES) | tr ' ' '\n' | awk '!a[$$0]++' | tr '\n' ' ')
INCLUDES += $(USEMODULE_INCLUDES_:%=-I%)
# include Makefile.includes for packages in $(USEPKG)
$(RIOTBASE)/pkg/%/Makefile.include::
$(AD)"$(MAKE)" -C $(RIOTBASE)/pkg/$* Makefile.include

12
drivers/Makefile.include

@ -0,0 +1,12 @@
ifneq (,$(filter cc2420,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/drivers/cc2420/include
endif
ifneq (,$(filter cc110x,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/drivers/cc110x/include
endif
ifneq (,$(filter cc110x_ng,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/drivers/cc110x_ng/include
endif
ifneq (,$(filter at86rf231,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/drivers/at86rf231/include
endif

2
examples/ccn-lite-client/Makefile

@ -48,6 +48,4 @@ USEMODULE += crypto_sha256
USEMODULE += ccn_lite
USEMODULE += ccn_lite_client
export INCLUDES = -I$(RIOTBASE)/sys/net/include
include $(RIOTBASE)/Makefile.include

2
examples/ccn-lite-relay/Makefile

@ -46,6 +46,4 @@ USEMODULE += rtc
USEMODULE += crypto_sha256
USEMODULE += ccn_lite
export INCLUDES = -I$(RIOTBASE)/sys/net/include/
include $(RIOTBASE)/Makefile.include

2
examples/default/Makefile

@ -55,6 +55,4 @@ ifneq (,$(filter native,$(BOARD)))
USEMODULE += random
endif
export INCLUDES += -I${RIOTBASE}/core/include/ -I${RIOTBASE}/sys/include/ -I${RIOTBASE}/drivers/include/
include $(RIOTBASE)/Makefile.include

2
examples/rpl_udp/Makefile

@ -49,6 +49,4 @@ USEMODULE += sixlowpan
USEMODULE += rpl
USEMODULE += destiny
export INCLUDES += -I$(RIOTBASE)/sys/net/include -I$(RIOTBASE)/sys/net/routing/rpl -I$(RIOTBASE)/drivers/cc110x
include $(RIOTBASE)/Makefile.include

1
sys/Makefile

@ -15,7 +15,6 @@ ifneq (,$(filter ps,$(USEMODULE)))
DIRS += ps
endif
ifneq (,$(filter posix,$(USEMODULE)))
INCLUDES += -I$(RIOTBASE)/sys/posix/include
DIRS += posix
endif
ifneq (,$(filter pnet,$(USEMODULE)))

60
sys/Makefile.include

@ -0,0 +1,60 @@
ifneq (,$(filter destiny,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/sys/net/include
endif
ifneq (,$(filter net_help,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/sys/net/include
USEMODULE_INCLUDES += $(RIOTBASE)/drivers/cc110x
USEMODULE_INCLUDES += $(RIOTBASE)/drivers/cc110x_ng/include
endif
ifneq (,$(filter net_if,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/sys/net/include
endif
ifneq (,$(filter protocol_multiplex,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/sys/net/include
endif
ifneq (,$(filter sixlowpan,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/sys/net/include
endif
ifneq (,$(filter rpl,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/sys/net/include
USEMODULE_INCLUDES += $(RIOTBASE)/sys/net/routing/rpl
endif
ifneq (,$(filter ieee802154,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/sys/net/include
endif
ifneq (,$(filter ccn_lite,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/sys/net/include
USEMODULE_INCLUDES += $(RIOTBASE)/sys/net/ccn_lite
endif
ifneq (,$(filter ccn_lite_client,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/sys/net/include
endif
ifneq (,$(filter crypto_3des,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/include/crypto
endif
ifneq (,$(filter crypto_aes,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/sys/include/crypto
endif
ifneq (,$(filter crypto_rc5,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/sys/include/crypto
endif
ifneq (,$(filter crypto_sha256,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/sys/include/crypto
endif
ifneq (,$(filter crypto_skipjack,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/sys/include/crypto
endif
ifneq (,$(filter crypto_twofish,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/sys/include/crypto
endif
ifneq (,$(filter posix,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/sys/posix/include
endif
ifneq (,$(filter pnet,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/sys/posix/pnet/include
endif
ifneq (,$(filter pthread,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/sys/posix/pthread/include
endif

5
sys/crypto/3des/Makefile

@ -1,8 +1,3 @@
SRC = 3des.c
OBJ = $(SRC:%.c=$(BINDIR)%.o)
DEP = $(SRC:%.c=$(BINDIR)%.d)
MODULE = crypto_3des
include $(RIOTBASE)/Makefile.base

5
sys/crypto/aes/Makefile

@ -1,8 +1,3 @@
SRC = aes.c
OBJ = $(SRC:%.c=$(BINDIR)%.o)
DEP = $(SRC:%.c=$(BINDIR)%.d)
MODULE = crypto_aes
include $(RIOTBASE)/Makefile.base

5
sys/crypto/rc5/Makefile

@ -1,8 +1,3 @@
SRC = rc5.c
OBJ = $(SRC:%.c=$(BINDIR)%.o)
DEP = $(SRC:%.c=$(BINDIR)%.d)
MODULE = crypto_rc5
include $(RIOTBASE)/Makefile.base

5
sys/crypto/sha256/Makefile

@ -1,8 +1,3 @@
SRC = sha256.c
OBJ = $(SRC:%.c=$(BINDIR)%.o)
DEP = $(SRC:%.c=$(BINDIR)%.d)
MODULE = crypto_sha256
include $(RIOTBASE)/Makefile.base

5
sys/crypto/skipjack/Makefile

@ -1,8 +1,3 @@
SRC = skipjack.c
OBJ = $(SRC:%.c=$(BINDIR)%.o)
DEP = $(SRC:%.c=$(BINDIR)%.d)
MODULE = crypto_skipjack
include $(RIOTBASE)/Makefile.base

5
sys/crypto/twofish/Makefile

@ -1,8 +1,3 @@
SRC = twofish.c
OBJ = $(SRC:%.c=$(BINDIR)%.o)
DEP = $(SRC:%.c=$(BINDIR)%.d)
MODULE = crypto_twofish
include $(RIOTBASE)/Makefile.base

2
sys/net/crosslayer/net_help/Makefile

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

4
sys/net/link_layer/protocol-multiplex/Makefile

@ -1,5 +1,3 @@
INCLUDES += -I$(RIOTBASE)/sys/net/include
MODULE:=protocol_multiplex
MODULE = protocol_multiplex
include $(RIOTBASE)/Makefile.base

2
sys/posix/pnet/Makefile

@ -1,5 +1,3 @@
MODULE =pnet
CFLAGS += -isystem $(RIOTBASE)/sys/posix/pnet/include
include $(RIOTBASE)/Makefile.base

4
sys/posix/pthread/Makefile

@ -1,7 +1,3 @@
MODULE = pthread
CFLAGS += -isystem $(RIOTBASE)/sys/posix/pthread/include
export INCLUDES += -I$(RIOTBASE)/sys/posix/pthread/include
include $(RIOTBASE)/Makefile.base

1
sys/shell/commands/Makefile

@ -14,7 +14,6 @@ ifneq (,$(filter cc110x,$(USEMODULE)))
endif
endif
ifneq (,$(filter net_if,$(USEMODULE)))
INCLUDES += -I$(RIOTBASE)/sys/net/include
SRC += sc_net_if.c
endif
ifneq (,$(filter mci,$(USEMODULE)))

2
tests/test_net_if/Makefile

@ -12,6 +12,4 @@ USEMODULE += auto_init
USEMODULE += net_if
USEMODULE += defaulttransceiver
export INCLUDES += -I$(RIOTBASE)/sys/net/include
include $(RIOTBASE)/Makefile.include

11
tests/test_pnet/Makefile

@ -1,4 +1,4 @@
export PROJECT =test_pnet
export PROJECT = test_pnet
include ../Makefile.tests_common
USEMODULE += auto_init
@ -7,13 +7,4 @@ USEMODULE += pnet
USEMODULE += vtimer
USEMODULE += defaulttransceiver
ifeq ($(BOARD),native)
CFLAGS += -isystem $(RIOTBASE)/sys/net/include \
-isystem $(RIOTBASE)/sys/posix/pnet/include
else
export INCLUDES += -I$(RIOTBASE)/sys/net/include \
-I$(RIOTBASE)/sys/posix/pnet/include \
-I$(RIOTBASE)/sys/posix/include
endif
include $(RIOTBASE)/Makefile.include

7
tests/test_pthread/Makefile

@ -4,11 +4,4 @@ include ../Makefile.tests_common
USEMODULE += posix
USEMODULE += pthread
ifeq ($(BOARD),native)
CFLAGS += -isystem $(RIOTBASE)/sys/posix/pthread/include
else
export INCLUDES += -I$(RIOTBASE)/sys/posix/pthread/include \
-I$(RIOTBASE)/sys/posix/include
endif
include $(RIOTBASE)/Makefile.include

7
tests/test_pthread_cooperation/Makefile

@ -4,11 +4,4 @@ include ../Makefile.tests_common
USEMODULE += posix
USEMODULE += pthread
ifeq ($(BOARD),native)
CFLAGS += -isystem $(RIOTBASE)/sys/posix/pthread/include
else
export INCLUDES = -I$(RIOTBASE)/sys/posix/pthread/include \
-I$(RIOTBASE)/sys/posix/include
endif
include $(RIOTBASE)/Makefile.include

Loading…
Cancel
Save