From 93f325b4eaffca67cc331550b333645428a6ac09 Mon Sep 17 00:00:00 2001 From: Scott Hadley Date: Thu, 11 Jul 2019 10:53:56 -0400 Subject: [PATCH] Edit frtos.mk with option to use stock malloc - Use MALLOC_VERSION= Change-Id: I4cd5e68c212970f6853a7a6d50bda33fa871d361 --- runtime/templates/frtos.mk | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/runtime/templates/frtos.mk b/runtime/templates/frtos.mk index 62dbf9a..a21928c 100644 --- a/runtime/templates/frtos.mk +++ b/runtime/templates/frtos.mk @@ -17,7 +17,13 @@ ISP_INCLUDES += -I$(FREERTOS_DIR)/Demo/RISC-V-Qemu-sifive_e-FreedomStudio/freedo ISP_INCLUDES += -I$(ISP_PREFIX)/riscv32-unknown-elf/include ISP_INCLUDES += -I$(ISP_RUNTIME) +MALLOC_VERSION ?= heap_2 + +ifeq ($(MALLOC_VERSION), heap_2) ISP_LIBS := $(FREERTOS_BUILD_DIR)/libfreertos.a +else +ISP_LIBS := $(FREERTOS_BUILD_DIR)/libfreertos-$(MALLOC_VERSION).a +endif RISCV_PATH ?= $(ISP_PREFIX) RISCV_GCC ?= $(abspath $(RISCV_PATH)/bin/clang) @@ -31,7 +37,14 @@ CC=$(RISCV_GCC) all: $(ISP_LIBS): + @echo $(MALLOC_VERSION) +ifeq ($(MALLOC_VERSION), heap_2) + $(MAKE) -C $(FREERTOS_RVDEMO_DIR) clean-libfreertos-objs $(MAKE) -C $(FREERTOS_RVDEMO_DIR) lib +else + $(MAKE) -C $(FREERTOS_RVDEMO_DIR) clean-libfreertos-objs + $(MAKE) -C $(FREERTOS_RVDEMO_DIR) build/libfreertos-$(MALLOC_VERSION).a +endif .PHONY: isp-runtime-common isp-runtime-common: $(ISP_LIBS) $(ISP_OBJECTS)