BuildSystem: Install base sysroot only once
Base sysroot is not only installed when creating the syroot directory for the first time. To get it installed again, you have to either delete the old sysroot diretory or run clean target This makes it so its actually possible to edit files specified in the base sysroot without random hacks.
This commit is contained in:
parent
8b612ba547
commit
581caff638
|
@ -6,8 +6,6 @@ endif ()
|
||||||
|
|
||||||
project(banan-os CXX C ASM)
|
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_INCLUDE ${BANAN_SYSROOT}/usr/include)
|
||||||
set(BANAN_LIB ${BANAN_SYSROOT}/usr/lib)
|
set(BANAN_LIB ${BANAN_SYSROOT}/usr/lib)
|
||||||
set(BANAN_BIN ${BANAN_SYSROOT}/usr/bin)
|
set(BANAN_BIN ${BANAN_SYSROOT}/usr/bin)
|
||||||
|
@ -57,8 +55,3 @@ add_subdirectory(kernel)
|
||||||
add_subdirectory(bootloader)
|
add_subdirectory(bootloader)
|
||||||
add_subdirectory(BAN)
|
add_subdirectory(BAN)
|
||||||
add_subdirectory(userspace)
|
add_subdirectory(userspace)
|
||||||
|
|
||||||
add_custom_target(sysroot
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${BANAN_SYSROOT}
|
|
||||||
COMMAND cd ${BANAN_SYSROOT} && tar xf ${BANAN_BASE_SYSROOT}
|
|
||||||
)
|
|
||||||
|
|
|
@ -66,6 +66,14 @@ run_bochs () {
|
||||||
$BANAN_SCRIPT_DIR/bochs.sh $@
|
$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
|
if [ -v QEMU_ACCEL ]; then
|
||||||
:
|
:
|
||||||
elif type kvm-ok &> /dev/null; then
|
elif type kvm-ok &> /dev/null; then
|
||||||
|
|
|
@ -58,7 +58,6 @@ target_compile_options(objlibc PUBLIC -Wall -Wextra -Werror -Wno-error=stack-usa
|
||||||
function(add_crtx crtx)
|
function(add_crtx crtx)
|
||||||
add_custom_target(${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
|
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})
|
add_dependencies(objlibc ${crtx})
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
Loading…
Reference in New Issue