2023-04-02 04:07:27 +03:00
|
|
|
cmake_minimum_required(VERSION 3.26)
|
|
|
|
|
2023-10-23 13:27:23 +03:00
|
|
|
if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "banan-os")
|
|
|
|
message(FATAL_ERROR "CMAKE_SYSTEM_NAME is not banan-os")
|
|
|
|
endif ()
|
2023-10-16 01:37:57 +03:00
|
|
|
|
2023-12-28 19:14:42 +02:00
|
|
|
#add_compile_options(-mno-sse -mno-sse2)
|
|
|
|
add_compile_definitions(__enable_sse=1)
|
2023-09-23 02:28:25 +03:00
|
|
|
|
2023-10-23 13:27:23 +03:00
|
|
|
project(banan-os CXX C ASM)
|
2023-04-02 04:48:56 +03:00
|
|
|
|
2023-08-23 10:35:16 +03:00
|
|
|
set(BANAN_BASE_SYSROOT ${CMAKE_SOURCE_DIR}/base-sysroot.tar.gz)
|
2023-04-02 04:07:27 +03:00
|
|
|
set(BANAN_INCLUDE ${BANAN_SYSROOT}/usr/include)
|
2023-04-07 02:27:15 +03:00
|
|
|
set(BANAN_LIB ${BANAN_SYSROOT}/usr/lib)
|
2023-05-11 16:19:53 +03:00
|
|
|
set(BANAN_BIN ${BANAN_SYSROOT}/usr/bin)
|
2023-12-01 12:37:09 +02:00
|
|
|
set(BANAN_SHARE ${BANAN_SYSROOT}/usr/share)
|
2023-04-02 04:07:27 +03:00
|
|
|
set(BANAN_BOOT ${BANAN_SYSROOT}/boot)
|
2023-10-20 04:59:08 +03:00
|
|
|
|
2023-04-02 04:07:27 +03:00
|
|
|
add_subdirectory(kernel)
|
2023-11-14 03:44:47 +02:00
|
|
|
add_subdirectory(bootloader)
|
2023-04-02 04:07:27 +03:00
|
|
|
add_subdirectory(BAN)
|
|
|
|
add_subdirectory(libc)
|
2023-04-12 22:20:18 +03:00
|
|
|
add_subdirectory(LibELF)
|
2023-05-11 16:19:53 +03:00
|
|
|
add_subdirectory(userspace)
|
2023-04-02 04:07:27 +03:00
|
|
|
|
|
|
|
add_custom_target(sysroot
|
2023-10-25 19:45:18 +03:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${BANAN_SYSROOT}
|
2023-11-04 17:50:43 +02:00
|
|
|
COMMAND cd ${BANAN_SYSROOT} && tar xf ${BANAN_BASE_SYSROOT}
|
2023-04-02 04:07:27 +03:00
|
|
|
)
|
|
|
|
|
2023-04-06 00:23:02 +03:00
|
|
|
add_custom_target(headers
|
|
|
|
DEPENDS kernel-headers
|
|
|
|
DEPENDS ban-headers
|
|
|
|
DEPENDS libc-headers
|
2023-04-12 22:20:18 +03:00
|
|
|
DEPENDS libelf-headers
|
2023-04-06 00:23:02 +03:00
|
|
|
)
|
|
|
|
|
2023-10-23 13:27:23 +03:00
|
|
|
add_custom_target(install-sysroot
|
2023-11-04 17:50:43 +02:00
|
|
|
COMMAND cd ${BANAN_SYSROOT} && tar cf ${BANAN_SYSROOT_TAR} *
|
2023-04-02 04:07:27 +03:00
|
|
|
DEPENDS kernel-install
|
|
|
|
DEPENDS ban-install
|
|
|
|
DEPENDS libc-install
|
2023-05-11 16:19:53 +03:00
|
|
|
DEPENDS userspace-install
|
2023-08-23 10:35:16 +03:00
|
|
|
DEPENDS libelf-install
|
2023-04-02 04:07:27 +03:00
|
|
|
)
|