Rafael Silva 2a17a7e8f8 rework make freertos port handling
this allows ports to specify a freertos port outside the FreeRTOS-Kernel lib directory, which would otherwise not be possible

Signed-off-by: Rafael Silva <rafaelsilva@ajtec.pt>
2022-06-02 09:35:30 +01:00

39 lines
839 B
Makefile

DEPS_SUBMODULES += lib/FreeRTOS-Kernel
include ../../../tools/top.mk
include ../../make.mk
FREERTOS_SRC = lib/FreeRTOS-Kernel
FREERTOS_PORT_PATH = lib/FreeRTOS-Kernel/portable/GCC
INC += \
src \
src/FreeRTOSConfig \
$(TOP)/hw \
$(TOP)/$(FREERTOS_SRC)/include \
$(TOP)/$(FREERTOS_PORT)
# Example source
EXAMPLE_SOURCE = \
src/freertos_hook.c \
src/main.c \
src/usb_descriptors.c
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
# FreeRTOS source, all files in port folder
SRC_C += \
$(FREERTOS_SRC)/list.c \
$(FREERTOS_SRC)/queue.c \
$(FREERTOS_SRC)/tasks.c \
$(FREERTOS_SRC)/timers.c \
$(subst $(TOP)/,,$(wildcard $(TOP)/$(FREERTOS_PORT)/*.c))
# Suppress FreeRTOS warnings
CFLAGS += -Wno-error=cast-qual
# FreeRTOS (lto + Os) linker issue
LDFLAGS += -Wl,--undefined=vTaskSwitchContext
include ../../rules.mk