1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-25 22:43:50 +01:00
RIOT/cpu/native/Makefile.include
Marian Buschsieweke 646c8b46e6
cpu/native: move native hack from core here
CPU specific hacks never should go to `core`. This simplifies the hack
and moves it to `cpu/native` by providing a custom `sched.h` that adds
the workarounds for glibc and adds an `#include_next "sched.h"`.

It's a bit of a pity that RIOT's sched.h has a name conflict with
POSIX's sched.h - otherwise those hacks wouldn't really be needed.
2025-12-15 08:21:18 +01:00

38 lines
1.0 KiB
Makefile

ifneq (,$(filter periph_can,$(USEMODULE)))
ifeq (,$(filter libsocketcan,$(USEPKG)))
# link system libsocketcan if not using the provided package
LINKFLAGS += -lsocketcan
endif
endif
ifneq (,$(filter can,$(USEMODULE)))
# In case of native, we rely on the real CAN implementation to handle
# the nitty-gritty details such as loop delay.
CFLAGS += -DCONFIG_FDCAN_DEVICE_TRANSCEIVER_LOOP_DELAY=0
endif
ifneq (,$(filter periph_timer,$(USEMODULE)))
# using timer_settime requires -lrt
LINKFLAGS += -lrt
endif
TOOLCHAINS_SUPPORTED = gnu llvm afl
# Platform triple as used by Rust
ifeq ($(OS) $(OS_ARCH),Linux x86_64)
ifneq (,$(filter arch_32bit,$(FEATURES_USED)))
RUST_TARGET = i686-unknown-linux-gnu
else
RUST_TARGET = x86_64-unknown-linux-gnu
endif
endif
include $(RIOTMAKE)/arch/native.inc.mk
USE_LIBUCONTEXT := $(shell pkg-config libucontext 2> /dev/null && echo 1 || echo 0)
ifeq ($(USE_LIBUCONTEXT),1)
CFLAGS += $(pkg-config libucontext --cflags) -DUSE_LIBUCONTEXT=1
LINKFLAGS += $(shell pkg-config libucontext --libs)
endif