2017-02-25 15:41:39 +01:00
|
|
|
PKG_BUILDDIR ?= $(PKGDIRBASE)/tinydtls
|
2016-11-03 16:53:24 +01:00
|
|
|
|
|
|
|
INCLUDES += -I$(PKG_BUILDDIR)
|
|
|
|
|
2017-02-15 17:17:24 +01:00
|
|
|
ifeq ($(TOOLCHAIN), llvm)
|
2017-09-22 14:52:51 +02:00
|
|
|
CFLAGS += -Wno-gnu-zero-variadic-macro-arguments -Wno-unused-function
|
2017-01-13 20:34:13 +01:00
|
|
|
endif
|
|
|
|
|
2019-11-05 15:40:22 +01:00
|
|
|
INCLUDES += -I$(RIOTBASE)/pkg/tinydtls/include
|
|
|
|
|
2017-11-22 14:13:00 +01:00
|
|
|
ifneq (,$(filter tinydtls,$(USEMODULE)))
|
|
|
|
INCLUDES += -I$(PKG_BUILDDIR)
|
|
|
|
# Mandatory for tinyDTLS
|
|
|
|
CFLAGS += -DDTLSv12 -DWITH_SHA256
|
|
|
|
|
|
|
|
# Dependencies partially under control of the App's requirements
|
|
|
|
|
|
|
|
# The configuration for socket overrides Sock
|
2019-03-14 13:22:00 +01:00
|
|
|
ifeq (,$(filter posix_sockets,$(USEMODULE)))
|
2017-11-22 14:13:00 +01:00
|
|
|
CFLAGS += -DWITH_RIOT_GNRC
|
|
|
|
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
|
|
|
|
|
2019-11-05 15:40:22 +01:00
|
|
|
# Enable debug when using tinydtls_sock_dtls
|
|
|
|
ifneq (,$(filter -DDTLS_DEBUG,$(CFLAGS)))
|
|
|
|
ifeq (,$(TINYDTLS_LOG))
|
|
|
|
CFLAGS += -DTINYDTLS_DEBUG
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2017-11-22 14:13:00 +01:00
|
|
|
# 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
|
|
|
|
endif
|
|
|
|
|
2016-11-03 16:53:24 +01:00
|
|
|
ifneq (,$(filter tinydtls_aes,$(USEMODULE)))
|
|
|
|
DIRS += $(PKG_BUILDDIR)/aes
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq (,$(filter tinydtls_ecc,$(USEMODULE)))
|
|
|
|
DIRS += $(PKG_BUILDDIR)/ecc
|
|
|
|
endif
|
2020-01-15 16:10:33 +01:00
|
|
|
|
|
|
|
# For now contrib only contains sock_dtls adaption
|
|
|
|
ifneq (,$(filter tinydtls_sock_dtls,$(USEMODULE)))
|
|
|
|
DIRS += $(RIOTBASE)/pkg/tinydtls/contrib
|
|
|
|
endif
|