update include paths

This commit is contained in:
gabriel 2024-05-31 08:55:49 +02:00
parent 4cc156e0d0
commit 9105f5fb14
2 changed files with 18 additions and 5 deletions

View File

@ -3,6 +3,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.13 FATAL_ERROR)
SET(BOARD "iss" CACHE STRING "board to be compiled for")
OPTION(SEMIHOSTING "Enable Semihosting" ON)
SET(RISCV_ARCH "rv32imc" CACHE STRING "arch")
SET(RISCV_ABI "ilp32" CACHE STRING "abi")
@ -37,9 +38,9 @@ INCLUDE_DIRECTORIES(
${BSP_BASE}/include
${BSP_BASE}/drivers
${BSP_BASE}/libwrap/semihosting
${PLATFORM_DIR}
${ENV_DIR}
${PLATFORM_DIR})
)
# Source files
SET(ASM_SRCS
@ -69,6 +70,11 @@ LIST(APPEND COMMON_FLAGS "-mabi=${RISCV_ABI}" "-mcmodel=medany" "-DBOARD_${BOARD
# Compiler Options
ADD_COMPILE_OPTIONS("${COMMON_FLAGS}")
IF(SEMIHOSTING)
ADD_DEFINITIONS(-DSEMIHOSTING=1)
ELSE ()
ADD_DEFINITIONS(-DSEMIHOSTING=0)
ENDIF()
ADD_EXECUTABLE(${PROJECT_NAME} ${ASM_SRCS} ${C_SRCS} ${SRC_FILES})
@ -78,7 +84,7 @@ TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC ${LIBWRAP_TGC_LDFLAGS} LIBWRAP_TGC)
TARGET_LINK_LIBRARIES(${PROJECT_NAME}
PUBLIC
-march=${RISCV_ARCH} -mabi=${RISCV_ABI}
-T/scratch/gabriel/repos/Firmwares/bare-metal-bsp/env/iss/link.lds
-T../${PLATFORM_DIR}/link.lds #TODO Path
-Wl,-Map=${PROJECT_NAME}.map
-nostartfiles
-L${ENV_DIR}

View File

@ -8,7 +8,14 @@
int main()
{
char c = sh_readc();
printf(c);
char new[]="/scratch/gabriel/Documents/test_file";
//puts(new);
//char buf[10];
printf("TEST!!!");
//int fh = open(new, 0, 0);
//unlink(new);
//read(fh, buf, 10);
//printf(buf);
//read(fh, buf, 10);
return 0;
}