From 5391e50bb7721895d3406ed1dde7352113b74190 Mon Sep 17 00:00:00 2001 From: Aiman Ismail Date: Wed, 5 Feb 2020 07:00:14 +0100 Subject: [PATCH] pkg/tinydtls: cleanup Makefile.include - Removes `TINYDTLS_LOG` because it is redundant with `TINYDTLS_LOG_LVL` - Remove check for using tinydtls module because the Makefile will only be included if the tinydtls module is used --- pkg/tinydtls/Makefile.include | 54 +++++++++++++---------------------- 1 file changed, 20 insertions(+), 34 deletions(-) diff --git a/pkg/tinydtls/Makefile.include b/pkg/tinydtls/Makefile.include index 7b6eab554f..782a2e0dc4 100644 --- a/pkg/tinydtls/Makefile.include +++ b/pkg/tinydtls/Makefile.include @@ -7,45 +7,31 @@ ifeq ($(TOOLCHAIN), llvm) endif INCLUDES += -I$(RIOTBASE)/pkg/tinydtls/include +INCLUDES += -I$(PKG_BUILDDIR) +# Mandatory for tinyDTLS +CFLAGS += -DDTLSv12 -DWITH_SHA256 -ifneq (,$(filter tinydtls,$(USEMODULE))) - INCLUDES += -I$(PKG_BUILDDIR) - # Mandatory for tinyDTLS - CFLAGS += -DDTLSv12 -DWITH_SHA256 +# Dependencies partially under control of the App's requirements - # Dependencies partially under control of the App's requirements +# The configuration for socket overrides Sock +ifeq (,$(filter posix_sockets,$(USEMODULE))) + CFLAGS += -DWITH_RIOT_GNRC +endif - # The configuration for socket overrides Sock - ifeq (,$(filter posix_sockets,$(USEMODULE))) - CFLAGS += -DWITH_RIOT_GNRC +# NOTE: PSK should be enabled by default BUT if the user define any other cipher +# suite(s) it should not be enabled. +# TODO: Create the flag DTLS_CIPHERS with keywords PSK, ECC (and future) +ifeq (,$(filter -DDTLS_PSK,$(CFLAGS))) + ifeq (,$(filter -DDTLS_ECC,$(CFLAGS))) + CFLAGS += -DDTLS_PSK endif +endif - # NOTE: PSK should be enabled by default BUT if the user define any other cipher - # suite(s) it should not be enabled. - # TODO: Create the flag DTLS_CIPHERS with keywords PSK, ECC (and future) - ifeq (,$(filter -DDTLS_PSK,$(CFLAGS))) - ifeq (,$(filter -DDTLS_ECC,$(CFLAGS))) - CFLAGS += -DDTLS_PSK - endif - endif - - # Enable debug when using tinydtls_sock_dtls - ifneq (,$(filter -DDTLS_DEBUG,$(CFLAGS))) - ifeq (,$(TINYDTLS_LOG)) - CFLAGS += -DTINYDTLS_DEBUG - endif - endif - - # Handles the verbosity of tinyDTLS. Default: Minimum or just error messages. - ifeq (,$(filter -DTINYDTLS_DEBUG,$(CFLAGS))) - ifeq ( , $(TINYDTLS_LOG)) - CFLAGS += -DTINYDTLS_LOG_LVL=0 - else - CFLAGS += -DTINYDTLS_LOG_LVL=$(TINYDTLS_LOG) - endif - else - CFLAGS += -DTINYDTLS_LOG_LVL=6 - endif +# Handles the verbosity of tinyDTLS. Default: Minimum or just error messages. +ifeq (,$(filter -DDTLS_DEBUG,$(CFLAGS))) + CFLAGS += -DTINYDTLS_LOG_LVL=0 +else + CFLAGS += -DTINYDTLS_LOG_LVL=6 endif ifneq (,$(filter tinydtls_aes,$(USEMODULE)))