1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-26 06:53:52 +01:00
chrysn c3ebae38f7 examples/rust: Simplify Makefiles
The APPLICATION_RUST_MODULE declaration is moved to a more prominent
position, given that it is now not part of a cesspool of boilerplate any
more.
2025-02-21 23:52:11 +01:00

53 lines
1.7 KiB
Makefile

# name of your application
APPLICATION = rust_gcoap
# The name of crate (as per Cargo.toml package name, but with '-' replaced with '_')
#
# The presence of this triggers building Rust code contained in this
# application in addition to any C code.
APPLICATION_RUST_MODULE = rust_gcoap
# 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)/../../../..
# Basic networking, and gcoap
USEMODULE += gcoap
USEMODULE += netdev_default
USEMODULE += auto_init_gnrc_netif
USEMODULE += gnrc_ipv6_default
USEMODULE += gnrc_icmpv6_echo
USEMODULE += ztimer
USEMODULE += ztimer_usec
USEMODULE += ztimer_msec
USEMODULE += ztimer_sec
USEMODULE += gnrc_netapi_callbacks
# for the "vfs" feature of riot-coap-handler-demos (and vfs.c)
USEMODULE += vfs
USEMODULE += constfs
# for the "saul" feature of riot-coap-handler-demos
USEMODULE += saul_default
# 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:
DEVELHELP ?= 1
# Change this to 0 show compiler invocation lines by default:
QUIET ?= 1
# Add 12k extra stack: The Rust examples take more of it than gcoap expects,
# for reasons that are not fully understood (it's not the string formatter).
CFLAGS += -DGCOAP_STACK_SIZE='(THREAD_STACKSIZE_DEFAULT+DEBUG_EXTRA_STACKSIZE+sizeof(coap_pkt_t)+12288)'
# This thread needs some more stack for printing the addresses, once more being
# hit by string formatting.
CFLAGS += -DTHREAD_STACKSIZE_MAIN='(THREAD_STACKSIZE_DEFAULT+THREAD_EXTRA_STACKSIZE_PRINTF+1024)'
include $(RIOTBASE)/Makefile.include