1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/examples/gcoap/Makefile

110 lines
2.9 KiB
Makefile
Raw Normal View History

# Default Makefile, for host native GNRC-based networking
2016-10-29 21:24:06 +02:00
# name of your application
APPLICATION = gcoap_example
2016-10-29 21:24:06 +02:00
# If no BOARD is found in the environment, use this default:
BOARD ?= native
# This has to be the absolute path to the RIOT base directory:
RIOTBASE ?= $(CURDIR)/../..
# Include packages that pull up and auto-init the link layer.
# NOTE: 6LoWPAN will be included if IEEE802.15.4 devices are present
USEMODULE += netdev_default
2021-11-03 16:51:10 +01:00
# use GNRC by default
2022-03-06 00:22:59 +01:00
LWIP_IPV4 ?= 0
LWIP_IPV6 ?= 0
2021-11-03 16:51:10 +01:00
2022-03-06 00:22:59 +01:00
ifeq (,$(filter 1, $(LWIP_IPV4) $(LWIP_IPV6)))
2021-11-03 16:51:10 +01:00
USEMODULE += auto_init_gnrc_netif
# Specify the mandatory networking modules
USEMODULE += gnrc_ipv6_default
# Additional networking modules that can be dropped if not needed
USEMODULE += gnrc_icmpv6_echo
else
2022-03-06 00:22:59 +01:00
ifeq (1,$(LWIP_IPV4))
USEMODULE += ipv4_addr
USEMODULE += lwip_arp
USEMODULE += lwip_ipv4
USEMODULE += lwip_dhcp_auto
CFLAGS += -DETHARP_SUPPORT_STATIC_ENTRIES=1
endif
ifeq (1,$(LWIP_IPV6))
USEMODULE += ipv6_addr
USEMODULE += lwip_ipv6
USEMODULE += lwip_ipv6_autoconfig
endif
2021-11-03 16:51:10 +01:00
endif
2016-10-29 21:24:06 +02:00
USEMODULE += gcoap
# Required by gcoap example
USEMODULE += od
USEMODULE += fmt
USEMODULE += netutils
2022-03-06 00:22:59 +01:00
USEMODULE += random
2016-10-29 21:24:06 +02:00
# Add also the shell, some shell commands
USEMODULE += shell
USEMODULE += shell_cmds_default
USEMODULE += uri_parser
2016-10-29 21:24:06 +02:00
USEMODULE += ps
# /rtc resource for regular observe notifications
FEATURES_OPTIONAL += periph_rtc
2016-10-29 21:24:06 +02:00
# Comment this out to disable code in RIOT that does safety checking
# which is not needed in a production environment but helps in the
# development process:
2017-11-19 14:12:25 +01:00
DEVELHELP ?= 1
2016-10-29 21:24:06 +02:00
# Change this to 0 show compiler invocation lines by default:
QUIET ?= 1
# Instead of simulating an Ethernet connection, we can also simulate
# an IEEE 802.15.4 radio using ZEP
USE_ZEP ?= 0
# set the ZEP port for native
ZEP_PORT_BASE ?= 17754
ifeq (1,$(USE_ZEP))
USEMODULE += socket_zep
endif
# Pass through application configuration to the docker container, if
# BUILD_IN_DOCKER=1 is used:
DOCKER_ENV_VARS += LWIP_IPV4
DOCKER_ENV_VARS += LWIP_IPV6
DOCKER_ENV_VARS += USE_ZEP
DOCKER_ENV_VARS += ZEP_PORT_BASE
2016-10-29 21:24:06 +02:00
include $(RIOTBASE)/Makefile.include
ifneq (,$(filter periph_rtc,$(USEMODULE)))
USEMODULE += event_periodic
USEMODULE += event_periodic_callback
USEMODULE += event_thread
USEMODULE += ztimer_msec
endif
# For now this goes after the inclusion of Makefile.include so Kconfig symbols
# are available. Only set configuration via CFLAGS if Kconfig is not being used
# for this module.
ifndef CONFIG_KCONFIG_MODULE_GCOAP
## Uncomment to redefine port, for example use 61616 for RFC 6282 UDP compression.
#GCOAP_PORT = 5683
#CFLAGS += -DCONFIG_GCOAP_PORT=$(GCOAP_PORT)
## Uncomment to redefine request token length, max 8.
#GCOAP_TOKENLEN = 2
#CFLAGS += -DCONFIG_GCOAP_TOKENLEN=$(GCOAP_TOKENLEN)
# Increase from default for confirmable block2 follow-on requests
GCOAP_RESEND_BUFS_MAX ?= 2
CFLAGS += -DCONFIG_GCOAP_RESEND_BUFS_MAX=$(GCOAP_RESEND_BUFS_MAX)
endif