mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:27:45 +00:00
Build: Install most headers to Root (and libcore.a/libgui.a)
This makes out-of-tree linking possible. And at the same time, add a CMakeToolchain.txt file that can be used to build arbitrary cmake-using applications on Serenity by pointing to the CMAKE_TOOLCHAIN_FILE when running cmake: -DCMAKE_TOOLCHAIN_FILE=~/code/serenity/Toolchain/CMakeToolchain.txt
This commit is contained in:
parent
2d98f4e28f
commit
5babcac289
12 changed files with 67 additions and 3 deletions
4
AK/install.sh
Executable file
4
AK/install.sh
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
mkdir -p ../Root/usr/include/AK/
|
||||||
|
cp ../AK/*.h ../Root/usr/include/AK/
|
4
Kernel/install.sh
Executable file
4
Kernel/install.sh
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
mkdir -p ../Root/usr/include/Kernel/
|
||||||
|
cp *.h ../Root/usr/include/Kernel/
|
|
@ -33,6 +33,7 @@ build_targets="$build_targets ../Games/Snake"
|
||||||
build_targets="$build_targets ../Shell"
|
build_targets="$build_targets ../Shell"
|
||||||
build_targets="$build_targets ../Demos/HelloWorld"
|
build_targets="$build_targets ../Demos/HelloWorld"
|
||||||
build_targets="$build_targets ../Demos/RetroFetch"
|
build_targets="$build_targets ../Demos/RetroFetch"
|
||||||
|
build_targets="$build_targets ." # the kernel
|
||||||
|
|
||||||
for targ in $build_targets; do
|
for targ in $build_targets; do
|
||||||
echo "Building $targ"
|
echo "Building $targ"
|
||||||
|
@ -45,7 +46,9 @@ for targ in $build_targets; do
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
$make_cmd clean
|
# has no need to build separately, but install headers.
|
||||||
$make_cmd
|
(cd ../SharedGraphics && ./install.sh)
|
||||||
|
(cd ../AK && ./install.sh)
|
||||||
|
|
||||||
sudo ./sync.sh
|
sudo ./sync.sh
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ fi
|
||||||
|
|
||||||
if [ $(id -u) != 0 ]; then
|
if [ $(id -u) != 0 ]; then
|
||||||
echo "This needs to be run as root"
|
echo "This needs to be run as root"
|
||||||
exit
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -vf _fs_contents.lock
|
rm -vf _fs_contents.lock
|
||||||
|
|
|
@ -36,3 +36,12 @@ $(LIBRARY): $(OBJS)
|
||||||
clean:
|
clean:
|
||||||
@echo "CLEAN"; rm -f $(LIBRARY) $(OBJS) *.d
|
@echo "CLEAN"; rm -f $(LIBRARY) $(OBJS) *.d
|
||||||
|
|
||||||
|
install: $(LIBRARY)
|
||||||
|
mkdir -p ../Root/usr/include/LibCore
|
||||||
|
mkdir -p ../Root/usr/include/AK
|
||||||
|
mkdir -p ../Root/usr/lib
|
||||||
|
# Copy headers
|
||||||
|
rsync -r -a --include '*/' --include '*.h' --exclude '*' . ../Root/usr/include/LibCore
|
||||||
|
rsync -r -a --include '*/' --include '*.h' --exclude '*' ../AK/ ../Root/usr/include/AK
|
||||||
|
# Install the library
|
||||||
|
cp $(LIBRARY) ../Root/usr/lib
|
||||||
|
|
5
LibCore/install.sh
Executable file
5
LibCore/install.sh
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
mkdir -p ../Root/usr/include/LibCore/
|
||||||
|
cp *.h ../Root/usr/include/LibCore/
|
||||||
|
cp libcore.a ../Root/usr/lib/
|
|
@ -77,3 +77,9 @@ $(LIBRARY): $(OBJS)
|
||||||
clean:
|
clean:
|
||||||
@echo "CLEAN"; rm -f $(LIBRARY) $(OBJS) *.d
|
@echo "CLEAN"; rm -f $(LIBRARY) $(OBJS) *.d
|
||||||
|
|
||||||
|
install: $(LIBRARY)
|
||||||
|
mkdir -p ../Root/usr/include/LibGUI
|
||||||
|
# Copy headers
|
||||||
|
rsync -r -a --include '*/' --include '*.h' --exclude '*' . ../Root/usr/include/LibGUI
|
||||||
|
# Install the library
|
||||||
|
cp $(LIBRARY) ../Root/usr/lib
|
||||||
|
|
5
LibGUI/install.sh
Executable file
5
LibGUI/install.sh
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
mkdir -p ../Root/usr/include/LibGUI/
|
||||||
|
cp *.h ../Root/usr/include/LibGUI/
|
||||||
|
cp libgui.a ../Root/usr/lib/
|
4
Servers/WindowServer/install.sh
Executable file
4
Servers/WindowServer/install.sh
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
mkdir -p ../../Root/usr/include/WindowServer/
|
||||||
|
cp *.h ../../Root/usr/include/WindowServer/
|
4
SharedGraphics/install.sh
Executable file
4
SharedGraphics/install.sh
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
mkdir -p ../Root/usr/include/SharedGraphics/
|
||||||
|
cp *.h ../Root/usr/include/SharedGraphics/
|
19
Toolchain/CMakeToolchain.txt
Normal file
19
Toolchain/CMakeToolchain.txt
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
set(CMAKE_SYSTEM_NAME Generic)
|
||||||
|
|
||||||
|
if (NOT DEFINED ENV{SERENITY_ROOT})
|
||||||
|
message(FATAL_ERROR "SERENITY_ROOT not set. Please source Toolchain/UseIt.sh.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# where to read from/write to
|
||||||
|
set(CMAKE_SYSROOT $ENV{SERENITY_ROOT}/Root)
|
||||||
|
set(CMAKE_STAGING_PREFIX $ENV{SERENITY_ROOT}/Root)
|
||||||
|
set(CMAKE_INSTALL_PREFIX $ENV{SERENITY_ROOT}/Root)
|
||||||
|
|
||||||
|
set(CMAKE_C_COMPILER i686-pc-serenity-gcc)
|
||||||
|
set(CMAKE_CXX_COMPILER i686-pc-serenity-g++)
|
||||||
|
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||||
|
|
|
@ -2,4 +2,5 @@
|
||||||
DIR=$( dirname $( readlink -e "$0" ) )
|
DIR=$( dirname $( readlink -e "$0" ) )
|
||||||
export PATH="$DIR/Local/bin:$PATH"
|
export PATH="$DIR/Local/bin:$PATH"
|
||||||
export TOOLCHAIN="$DIR"
|
export TOOLCHAIN="$DIR"
|
||||||
|
export SERENITY_ROOT="$DIR/.."
|
||||||
echo "$PATH"
|
echo "$PATH"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue