113 lines
4.5 KiB
CMake
113 lines
4.5 KiB
CMake
# -- Generated by scons. Add source files in current directory.
|
|
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
|
|
set(ARCH "riscv-nemu")
|
|
find_package(am-${ARCH} REQUIRED)
|
|
find_package(klib REQUIRED)
|
|
|
|
SET(CMAKE_SYSTEM_NAME Generic)
|
|
SET(CMAKE_SYSTEM_PROCESSOR virt64)
|
|
|
|
SET(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
|
|
SET(CMAKE_C_COMPILER "/nix/store/nxmr52s1hri63plbhvxcd08g2nxmbjx7-riscv32-none-elf-gcc-wrapper-13.2.0/bin/riscv32-none-elf-gcc")
|
|
SET(CMAKE_ASM_COMPILER "/nix/store/nxmr52s1hri63plbhvxcd08g2nxmbjx7-riscv32-none-elf-gcc-wrapper-13.2.0/bin/riscv32-none-elf-gcc")
|
|
SET(CMAKE_C_FLAGS "-ffreestanding -flax-vector-conversions -Wno-cpp -fno-common -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -fdiagnostics-color=always -O0 -ggdb -fvar-tracking ")
|
|
SET(CMAKE_ASM_FLAGS " -c -x assembler-with-cpp -D__ASSEMBLY__ -ggdb")
|
|
SET(CMAKE_C_COMPILER_WORKS TRUE)
|
|
|
|
SET(CMAKE_CXX_COMPILER "/nix/store/nxmr52s1hri63plbhvxcd08g2nxmbjx7-riscv32-none-elf-gcc-wrapper-13.2.0/bin/riscv32-none-elf-g++")
|
|
SET(CMAKE_CXX_FLAGS "-ffreestanding -flax-vector-conversions -Wno-cpp -fno-common -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -fdiagnostics-color=always -O0 -ggdb -fvar-tracking ")
|
|
SET(CMAKE_CXX_COMPILER_WORKS TRUE)
|
|
|
|
SET(CMAKE_OBJCOPY "/nix/store/nxmr52s1hri63plbhvxcd08g2nxmbjx7-riscv32-none-elf-gcc-wrapper-13.2.0/bin/riscv32-none-elf-objcopy")
|
|
SET(CMAKE_SIZE "/nix/store/nxmr52s1hri63plbhvxcd08g2nxmbjx7-riscv32-none-elf-gcc-wrapper-13.2.0/bin/riscv32-none-elf-size")
|
|
|
|
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections,-Map=rtthread.map,-cref,-u,_start -T ${CMAKE_SOURCE_DIR}/extra.ld -lgcc -static")
|
|
|
|
SET(CMAKE_CXX_STANDARD 14)
|
|
PROJECT(rtthread C CXX ASM)
|
|
INCLUDE_DIRECTORIES(
|
|
../../components/libc/compilers/common/include
|
|
../../components/drivers/include
|
|
../../components/dfs/dfs_v1/include
|
|
../../components/dfs/dfs_v1/filesystems/devfs
|
|
../../components/dfs/dfs_v1/filesystems/elmfat
|
|
../../components/dfs/dfs_v1/filesystems/romfs
|
|
../../components/finsh
|
|
.
|
|
../../include
|
|
../../components/libc/posix/io/poll
|
|
../../components/libc/posix/io/stdio
|
|
../../components/libc/posix/ipc
|
|
../../components/utilities/utest
|
|
../../components/utilities/libadt
|
|
)
|
|
|
|
ADD_DEFINITIONS(
|
|
-D__RTTHREAD__
|
|
)
|
|
|
|
SET(PROJECT_SOURCES
|
|
../../components/libc/compilers/common/cstring.c
|
|
../../components/libc/compilers/common/cwchar.c
|
|
../../components/libc/compilers/common/cctype.c
|
|
../../components/libc/compilers/common/ctime.c
|
|
../../components/libc/compilers/common/cstdio.c
|
|
../../components/libc/compilers/common/cstdlib.c
|
|
../../components/drivers/cputime/cputime.c
|
|
../../components/drivers/cputime/cputimer.c
|
|
../../components/drivers/ipc/completion.c
|
|
../../components/drivers/ipc/dataqueue.c
|
|
../../components/drivers/ipc/pipe.c
|
|
../../components/drivers/ipc/ringblk_buf.c
|
|
../../components/drivers/ipc/ringbuffer.c
|
|
../../components/drivers/ipc/waitqueue.c
|
|
../../components/drivers/ipc/workqueue.c
|
|
../../components/drivers/misc/rt_null.c
|
|
../../components/drivers/misc/rt_random.c
|
|
../../components/drivers/misc/rt_zero.c
|
|
../../components/drivers/rtc/rtc.c
|
|
../../components/drivers/serial/serial.c
|
|
../../components/dfs/dfs_v1/filesystems/devfs/devfs.c
|
|
../../components/dfs/dfs_v1/filesystems/elmfat/dfs_elm.c
|
|
../../components/dfs/dfs_v1/filesystems/elmfat/ff.c
|
|
../../components/dfs/dfs_v1/filesystems/elmfat/ffunicode.c
|
|
../../components/dfs/dfs_v1/filesystems/romfs/dfs_romfs.c
|
|
../../components/dfs/dfs_v1/filesystems/romfs/romfs.c
|
|
../../components/dfs/dfs_v1/src/dfs.c
|
|
../../components/dfs/dfs_v1/src/dfs_file.c
|
|
../../components/dfs/dfs_v1/src/dfs_fs.c
|
|
../../components/dfs/dfs_v1/src/dfs_posix.c
|
|
../../components/finsh/shell.c
|
|
../../components/finsh/msh_parse.c
|
|
../../components/finsh/msh_file.c
|
|
../../components/finsh/msh.c
|
|
../../components/finsh/cmd.c
|
|
../../src/clock.c
|
|
../../src/components.c
|
|
../../src/device.c
|
|
../../src/idle.c
|
|
../../src/ipc.c
|
|
../../src/irq.c
|
|
../../src/kservice.c
|
|
../../src/mem.c
|
|
../../src/mempool.c
|
|
../../src/object.c
|
|
../../src/scheduler_up.c
|
|
../../src/thread.c
|
|
../../src/timer.c
|
|
../../components/utilities/utest/utest.c
|
|
../../components/utilities/libadt/avl.c
|
|
../src/context.c
|
|
../src/hello.c
|
|
../src/interrupt.c
|
|
../src/libc.c
|
|
../src/uart.c
|
|
../src/init.c
|
|
)
|
|
|
|
ADD_EXECUTABLE(${CMAKE_PROJECT_NAME}.elf ${PROJECT_SOURCES})
|
|
TARGET_LINK_LIBRARIES(${CMAKE_PROJECT_NAME}.elf PRIVATE klib am-${ARCH})
|
|
ADD_CUSTOM_COMMAND(TARGET ${CMAKE_PROJECT_NAME}.elf POST_BUILD
|
|
COMMAND ${CMAKE_OBJCOPY} --set-section-flags .bss=alloc,load,contents -O binary ${CMAKE_PROJECT_NAME}.elf ${CMAKE_PROJECT_NAME}.bin
|
|
COMMAND ${CMAKE_SIZE} ${CMAKE_PROJECT_NAME}.elf)
|