diff --git a/CMakeLists.txt b/CMakeLists.txt index 250b5157..d262a1f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,8 +6,6 @@ endif () project(banan-os CXX C ASM) -set(BANAN_BASE_SYSROOT ${CMAKE_SOURCE_DIR}/base-sysroot.tar.gz) - set(BANAN_INCLUDE ${BANAN_SYSROOT}/usr/include) set(BANAN_LIB ${BANAN_SYSROOT}/usr/lib) set(BANAN_BIN ${BANAN_SYSROOT}/usr/bin) @@ -57,8 +55,3 @@ add_subdirectory(kernel) add_subdirectory(bootloader) add_subdirectory(BAN) add_subdirectory(userspace) - -add_custom_target(sysroot - COMMAND ${CMAKE_COMMAND} -E make_directory ${BANAN_SYSROOT} - COMMAND cd ${BANAN_SYSROOT} && tar xf ${BANAN_BASE_SYSROOT} -) diff --git a/script/build.sh b/script/build.sh index aa4b3bd8..e31efe6f 100755 --- a/script/build.sh +++ b/script/build.sh @@ -66,6 +66,14 @@ run_bochs () { $BANAN_SCRIPT_DIR/bochs.sh $@ } +if [ ! -d $BANAN_SYSROOT ]; then + mkdir -p $BANAN_SYSROOT + + pushd $BANAN_SYSROOT + run_fakeroot tar xf ${BANAN_ROOT_DIR}/base-sysroot.tar.gz + popd +fi + if [ -v QEMU_ACCEL ]; then : elif type kvm-ok &> /dev/null; then diff --git a/userspace/libraries/LibC/CMakeLists.txt b/userspace/libraries/LibC/CMakeLists.txt index 8ff1a9d6..cf7ec1fc 100644 --- a/userspace/libraries/LibC/CMakeLists.txt +++ b/userspace/libraries/LibC/CMakeLists.txt @@ -58,7 +58,6 @@ target_compile_options(objlibc PUBLIC -Wall -Wextra -Werror -Wno-error=stack-usa function(add_crtx crtx) add_custom_target(${crtx} COMMAND ${CMAKE_CXX_COMPILER} -c -o ${CMAKE_INSTALL_LIBDIR}/${crtx}.o ${CMAKE_CURRENT_SOURCE_DIR}/arch/${BANAN_ARCH}/${crtx}.S - DEPENDS sysroot ) add_dependencies(objlibc ${crtx}) endfunction()