diff --git a/Makefile.include b/Makefile.include index 8027d9e9e7ae6ebff275d2cb9cf16d9ec80ca99c..330768004e84635fdb52ecbca710ebefe1c3812d 100644 --- a/Makefile.include +++ b/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 diff --git a/drivers/Makefile.include b/drivers/Makefile.include new file mode 100644 index 0000000000000000000000000000000000000000..49e12e4ee682492dc6d8e9664ab7619c550d7d13 --- /dev/null +++ b/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 diff --git a/examples/ccn-lite-client/Makefile b/examples/ccn-lite-client/Makefile index 36772c5f1b212aa09799743430918d9b88a41bb9..57420b83597a4680572e03100134fabdbce7acf6 100644 --- a/examples/ccn-lite-client/Makefile +++ b/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 diff --git a/examples/ccn-lite-relay/Makefile b/examples/ccn-lite-relay/Makefile index d0e72dbdb0b0c9783e0d3e9c12c16becf784305d..b5ad2a02074ce508fa82c809acc5046041b58762 100644 --- a/examples/ccn-lite-relay/Makefile +++ b/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 diff --git a/examples/default/Makefile b/examples/default/Makefile index 55f92b0c61f6040bc3f19388ae3360c01207e043..04f948076ca72acb760ca33df2d14c2de03354aa 100644 --- a/examples/default/Makefile +++ b/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 diff --git a/examples/rpl_udp/Makefile b/examples/rpl_udp/Makefile index 2228c286b9396e3daaf5dd53a753311fa00e1287..0a0d91c5e012dd6028a487d338b11e82601b9889 100644 --- a/examples/rpl_udp/Makefile +++ b/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 diff --git a/sys/Makefile b/sys/Makefile index 6c4147b771d161cdb23ff420979850f2f6fbe71e..2c91b56ba69cce8733f6702c2973775489a7905c 100644 --- a/sys/Makefile +++ b/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))) diff --git a/sys/Makefile.include b/sys/Makefile.include new file mode 100644 index 0000000000000000000000000000000000000000..4a35e9508ce7873a3fd7cf97ba6263cc6a11580c --- /dev/null +++ b/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 diff --git a/sys/crypto/3des/Makefile b/sys/crypto/3des/Makefile index d049bc5d83b9bc0e84e52061cc9595060aa8ba75..1f5e5d84efdcc58c580db1c3bdc8fe0a71a98935 100644 --- a/sys/crypto/3des/Makefile +++ b/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 diff --git a/sys/crypto/aes/Makefile b/sys/crypto/aes/Makefile index f387f13b0223ed0fa02149939a2b60459c705951..f00a84dbc6e9d92a48d39532e174b5679fe5eea2 100644 --- a/sys/crypto/aes/Makefile +++ b/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 diff --git a/sys/crypto/rc5/Makefile b/sys/crypto/rc5/Makefile index 38207c4cc33a3033ad17b7c3117e113971bbff0f..a78c1bd74ff56facc602014988cfcf605d73ce15 100644 --- a/sys/crypto/rc5/Makefile +++ b/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 diff --git a/sys/crypto/sha256/Makefile b/sys/crypto/sha256/Makefile index 9794942fc1b9de565129d6154c81ff8f2bdc773b..f14689585da50ff1588d2fdc54f11fa6be6424e9 100644 --- a/sys/crypto/sha256/Makefile +++ b/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 diff --git a/sys/crypto/skipjack/Makefile b/sys/crypto/skipjack/Makefile index 87f66d593ef683df9fa0d7afe8a0f82389cfd703..69ce210ded665cea901a995723acc4e16d99efed 100644 --- a/sys/crypto/skipjack/Makefile +++ b/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 diff --git a/sys/crypto/twofish/Makefile b/sys/crypto/twofish/Makefile index 7cfdd35787790978b2cdf9ccafaa58998ed92ae4..18c4e9d0fbbe2488e2faaa91e242e81e50f9a628 100644 --- a/sys/crypto/twofish/Makefile +++ b/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 diff --git a/sys/net/crosslayer/net_help/Makefile b/sys/net/crosslayer/net_help/Makefile index 26925d685f8801bdf95642bdb4c80f564d692381..c6e31807e89afcfcae778b012c3aae2940ce857a 100644 --- a/sys/net/crosslayer/net_help/Makefile +++ b/sys/net/crosslayer/net_help/Makefile @@ -1,5 +1,3 @@ MODULE:=$(shell basename $(CURDIR)) -INCLUDES += -I$(RIOTBASE)/sys/net/include - include $(RIOTBASE)/Makefile.base diff --git a/sys/net/link_layer/protocol-multiplex/Makefile b/sys/net/link_layer/protocol-multiplex/Makefile index 764e02c5b2ff41ba30274d3833d6b747abcf6fc7..c5126f06a4184ede31f9f8455f5bb12feda7fbb2 100644 --- a/sys/net/link_layer/protocol-multiplex/Makefile +++ b/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 diff --git a/sys/posix/pnet/Makefile b/sys/posix/pnet/Makefile index 8549b59171b795b9f62ce5f95aaeef1fcd2526c7..44ad39401f378723917f7cf85ed82895f566fed8 100644 --- a/sys/posix/pnet/Makefile +++ b/sys/posix/pnet/Makefile @@ -1,5 +1,3 @@ MODULE =pnet -CFLAGS += -isystem $(RIOTBASE)/sys/posix/pnet/include - include $(RIOTBASE)/Makefile.base diff --git a/sys/posix/pthread/Makefile b/sys/posix/pthread/Makefile index 96b84f147bc1026aa4754cb2d0191b41fbd67b29..f849d335bc37f03f3661ac721a204c3a578d5d23 100644 --- a/sys/posix/pthread/Makefile +++ b/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 diff --git a/sys/shell/commands/Makefile b/sys/shell/commands/Makefile index c82630b778cf22ed49feb58f4cf3c26a9b3368e0..64938e4899c5ed2043e6839edbcf100929de727f 100644 --- a/sys/shell/commands/Makefile +++ b/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))) diff --git a/tests/test_net_if/Makefile b/tests/test_net_if/Makefile index 028d6ac58c96030c492100266401185d93fbdf96..073f4b76abba720836e3893e7afe68816dad4962 100644 --- a/tests/test_net_if/Makefile +++ b/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 diff --git a/tests/test_pnet/Makefile b/tests/test_pnet/Makefile index ef5a45b08ac01105bda8915677e8b711de2a63c9..b1c34b788eed96f9a38da6409952fd159b7747af 100644 --- a/tests/test_pnet/Makefile +++ b/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 diff --git a/tests/test_pthread/Makefile b/tests/test_pthread/Makefile index 6e2a46c23e051ef7a404e8a53b34ac91cc95dddf..2deaa76c455bf9603591f892df938dcfb8358ac9 100644 --- a/tests/test_pthread/Makefile +++ b/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 diff --git a/tests/test_pthread_cooperation/Makefile b/tests/test_pthread_cooperation/Makefile index 2590de5206410b11bbd34c055d2da71fba966bf1..3430409269e9c79dc6f60560367100c39c18258f 100644 --- a/tests/test_pthread_cooperation/Makefile +++ b/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