emb6: allow for warnings to be disabled

Currently, due to the way emb6 is compiled in our build system, it is
not possible to deactivate certain warnings. This fix provides a
solution for that, by building the submodules in the package build step
instead of on their own, similar to how JerryScript is build.
This commit is contained in:
Martine Lenders 2018-02-15 18:52:26 +01:00
parent 95254990d0
commit 2b3b225485
2 changed files with 21 additions and 50 deletions

View File

@ -3,9 +3,20 @@ PKG_URL=https://github.com/hso-esk/emb6.git
PKG_VERSION=14e4a3cfff01644e078870e14e16a1fe60dcc895
PKG_LICENSE=BSD-3-Clause
# Collect all chosen sub-modules but not the pseudo-modules and the ones
# implemented in ./contrib/
EMB6_SUBMODULES:=$(filter-out emb6_contrib \
emb6_netdev \
emb6_router \
emb6_sock_%,$(filter emb6_%,$(USEMODULE)))
.PHONY: all
all: git-download
all: git-download $(EMB6_SUBMODULES)
"$(MAKE)" -C $(PKG_BUILDDIR)
# Rule for all submodules
emb6_%: git-download
"$(MAKE)" -C $(dir $(shell grep -lR "MODULE.*=.*\<$@\>" $(PKG_BUILDDIR)))
include $(RIOTBASE)/pkg/pkg.mk

View File

@ -4,6 +4,15 @@ EMB6_CONTRIB := $(RIOTBASE)/pkg/emb6/contrib
INCLUDES += -I$(PKG_BUILDDIR)/target
INCLUDES += -I$(RIOTBASE)/pkg/emb6/include
INCLUDES += -I$(EMB6_DIR)/emb6
INCLUDES += -I$(EMB6_DIR)/emb6/inc/net/ipv6
INCLUDES += -I$(EMB6_DIR)/emb6/inc/net/ipv6/multicast
INCLUDES += -I$(EMB6_DIR)/emb6/inc/mac/llsec
INCLUDES += -I$(EMB6_DIR)/emb6/inc/mac
INCLUDES += -I$(EMB6_DIR)/emb6/inc/net/rpl
INCLUDES += -I$(EMB6_DIR)/emb6/inc/net/sicslowpan
INCLUDES += -I$(EMB6_DIR)/emb6/inc/tport
INCLUDES += -I$(EMB6_DIR)/utils/inc
CFLAGS += -Wno-unused-parameter -Wno-unused-function -Wno-type-limits
CFLAGS += -Wno-sign-compare -Wno-missing-field-initializers
@ -12,64 +21,15 @@ ifeq (,$(filter emb6_router,$(USEMODULE)))
CFLAGS += -DEMB6_CONF_ROUTER=FALSE
endif
ifneq (,$(filter emb6_bsp,$(USEMODULE)))
DIRS += $(EMB6_DIR)/target/bsp
endif
ifneq (,$(filter emb6_common,$(USEMODULE)))
DIRS += $(EMB6_DIR)/emb6
INCLUDES += -I$(EMB6_DIR)/emb6
endif
ifneq (,$(filter emb6_contrib,$(USEMODULE)))
DIRS += $(EMB6_CONTRIB)
endif
ifneq (,$(filter emb6_ipv6,$(USEMODULE)))
DIRS += $(EMB6_DIR)/emb6/src/net/ipv6
INCLUDES += -I$(EMB6_DIR)/emb6/inc/net/ipv6
endif
ifneq (,$(filter emb6_ipv6_multicast,$(USEMODULE)))
DIRS += $(EMB6_DIR)/emb6/src/net/ipv6/multicast
INCLUDES += -I$(EMB6_DIR)/emb6/inc/net/ipv6/multicast
endif
ifneq (,$(filter emb6_llsec,$(USEMODULE)))
DIRS += $(EMB6_DIR)/emb6/src/mac/llsec
INCLUDES += -I$(EMB6_DIR)/emb6/inc/mac/llsec
endif
ifneq (,$(filter emb6_mac,$(USEMODULE)))
DIRS += $(EMB6_DIR)/emb6/src/mac
INCLUDES += -I$(EMB6_DIR)/emb6/inc/mac
endif
ifneq (,$(filter emb6_netdev,$(USEMODULE)))
DIRS += $(EMB6_CONTRIB)/netdev
endif
ifneq (,$(filter emb6_rpl,$(USEMODULE)))
DIRS += $(EMB6_DIR)/emb6/src/net/rpl
INCLUDES += -I$(EMB6_DIR)/emb6/inc/net/rpl
endif
ifneq (,$(filter emb6_sicslowpan,$(USEMODULE)))
DIRS += $(EMB6_DIR)/emb6/src/net/sicslowpan
INCLUDES += -I$(EMB6_DIR)/emb6/inc/net/sicslowpan
endif
ifneq (,$(filter emb6_sock,$(USEMODULE)))
DIRS += $(EMB6_DIR)/emb6/src/tport
INCLUDES += -I$(EMB6_DIR)/emb6/inc/tport
endif
ifneq (,$(filter emb6_sock_udp,$(USEMODULE)))
DIRS += $(EMB6_CONTRIB)/sock/udp
CFLAGS += -DSOCK_HAS_IPV6
endif
ifneq (,$(filter emb6_utils,$(USEMODULE)))
DIRS += $(EMB6_DIR)/utils/src
INCLUDES += -I$(EMB6_DIR)/utils/inc
endif