@ -11,11 +11,22 @@ MAKE = make
CFLAGS += $( INCLUDE_DIRS) -DportasmHANDLE_INTERRUPT= handle_trap -fmessage-length= 0 \
CFLAGS += $( INCLUDE_DIRS) -DportasmHANDLE_INTERRUPT= handle_trap -fmessage-length= 0 \
-march= rv32imac_zicsr -mabi= ilp32 -mcmodel= medlow -ffunction-sections -fdata-sections \
-march= rv32imac_zicsr -mabi= ilp32 -mcmodel= medlow -ffunction-sections -fdata-sections \
--specs= nano.specs -fno-builtin-printf -Wno-unused-parameter -nostartfiles -g3 -Os
-Wno-unused-parameter -nostartfiles -g3 -Os
i f e q ( $( PICOLIBC ) , 1 )
CFLAGS += --specs= picolibc.specs -DPICOLIBC_INTEGER_PRINTF_SCANF
e l s e
CFLAGS += --specs= nano.specs -fno-builtin-printf
e n d i f
LDFLAGS += -nostartfiles -Xlinker --gc-sections -Wl,-Map,$( OUTPUT_DIR) /RTOSDemo.map \
LDFLAGS += -nostartfiles -Xlinker --gc-sections -Wl,-Map,$( OUTPUT_DIR) /RTOSDemo.map \
-T./fake_rom.ld -march= rv32imac -mabi= ilp32 -mcmodel= medlow -Xlinker \
-T./fake_rom.ld -march= rv32imac -mabi= ilp32 -mcmodel= medlow -Xlinker \
--defsym= __stack_size = 350 -Wl,--start-group -Wl,--end-group -Wl,--wrap= malloc \
--defsym= __stack_size = 350 -Wl,--start-group -Wl,--end-group
i f e q ( $( PICOLIBC ) , 1 )
LDFLAGS += --specs= picolibc.specs --oslib= semihost --crt0= minimal -DPICOLIBC_INTEGER_PRINTF_SCANF
e l s e
LDFLAGS += -Wl,--wrap= malloc \
-Wl,--wrap= free -Wl,--wrap= open -Wl,--wrap= lseek -Wl,--wrap= read -Wl,--wrap= write \
-Wl,--wrap= free -Wl,--wrap= open -Wl,--wrap= lseek -Wl,--wrap= read -Wl,--wrap= write \
-Wl,--wrap= fstat -Wl,--wrap= stat -Wl,--wrap= close -Wl,--wrap= link -Wl,--wrap= unlink \
-Wl,--wrap= fstat -Wl,--wrap= stat -Wl,--wrap= close -Wl,--wrap= link -Wl,--wrap= unlink \
-Wl,--wrap= execve -Wl,--wrap= fork -Wl,--wrap= getpid -Wl,--wrap= kill -Wl,--wrap= wait \
-Wl,--wrap= execve -Wl,--wrap= fork -Wl,--wrap= getpid -Wl,--wrap= kill -Wl,--wrap= wait \
@ -24,6 +35,7 @@ LDFLAGS += -nostartfiles -Xlinker --gc-sections -Wl,-Map,$(OUTPUT_DIR)/RTOSDemo.
-Wl,--wrap= _fstat -Wl,--wrap= _stat -Wl,--wrap= _close -Wl,--wrap= _link -Wl,--wrap= _unlink \
-Wl,--wrap= _fstat -Wl,--wrap= _stat -Wl,--wrap= _close -Wl,--wrap= _link -Wl,--wrap= _unlink \
-Wl,--wrap= _execve -Wl,--wrap= _fork -Wl,--wrap= _getpid -Wl,--wrap= _kill -Wl,--wrap= _wait \
-Wl,--wrap= _execve -Wl,--wrap= _fork -Wl,--wrap= _getpid -Wl,--wrap= _kill -Wl,--wrap= _wait \
-Wl,--wrap= _isatty -Wl,--wrap= _times -Wl,--wrap= _sbrk -Wl,--wrap= __exit -Wl,--wrap= _puts
-Wl,--wrap= _isatty -Wl,--wrap= _times -Wl,--wrap= _sbrk -Wl,--wrap= __exit -Wl,--wrap= _puts
e n d i f
# -Wl,--wrap=_exit
# -Wl,--wrap=_exit
#
#
@ -92,7 +104,9 @@ SOURCE_FILES += (DEMO_PROJECT)/main_full.c
SOURCE_FILES += ( DEMO_PROJECT) /ns16550.c
SOURCE_FILES += ( DEMO_PROJECT) /ns16550.c
SOURCE_FILES += ( DEMO_PROJECT) /riscv-virt.c
SOURCE_FILES += ( DEMO_PROJECT) /riscv-virt.c
# Lightweight print formatting to use in place of the heavier GCC equivalent.
# Lightweight print formatting to use in place of the heavier GCC equivalent.
i f n e q ( $( PICOLIBC ) , 1 )
SOURCE_FILES += ./printf-stdarg.c
SOURCE_FILES += ./printf-stdarg.c
e n d i f
ASM_SOURCE_FILES += ./start.S
ASM_SOURCE_FILES += ./start.S
ASM_SOURCE_FILES += ./RegTest.S
ASM_SOURCE_FILES += ./RegTest.S
ASM_SOURCE_FILES += ./vector.S
ASM_SOURCE_FILES += ./vector.S