Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: Install most headers to Root (and libcore.a/libgui.a) #54

Merged
merged 1 commit into from
May 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions AK/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

mkdir -p ../Root/usr/include/AK/
cp ../AK/*.h ../Root/usr/include/AK/
4 changes: 4 additions & 0 deletions Kernel/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

mkdir -p ../Root/usr/include/Kernel/
cp *.h ../Root/usr/include/Kernel/
7 changes: 5 additions & 2 deletions Kernel/makeall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ build_targets="$build_targets ../Games/Snake"
build_targets="$build_targets ../Shell"
build_targets="$build_targets ../Demos/HelloWorld"
build_targets="$build_targets ../Demos/RetroFetch"
build_targets="$build_targets ." # the kernel

for targ in $build_targets; do
echo "Building $targ"
Expand All @@ -45,7 +46,9 @@ for targ in $build_targets; do
fi
done

$make_cmd clean
$make_cmd
# has no need to build separately, but install headers.
(cd ../SharedGraphics && ./install.sh)
(cd ../AK && ./install.sh)

sudo ./sync.sh

2 changes: 1 addition & 1 deletion Kernel/sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fi

if [ $(id -u) != 0 ]; then
echo "This needs to be run as root"
exit
exit 1
fi

rm -vf _fs_contents.lock
Expand Down
9 changes: 9 additions & 0 deletions LibCore/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,12 @@ $(LIBRARY): $(OBJS)
clean:
@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 changes: 5 additions & 0 deletions LibCore/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

mkdir -p ../Root/usr/include/LibCore/
cp *.h ../Root/usr/include/LibCore/
cp libcore.a ../Root/usr/lib/
6 changes: 6 additions & 0 deletions LibGUI/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,9 @@ $(LIBRARY): $(OBJS)
clean:
@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 changes: 5 additions & 0 deletions LibGUI/install.sh
Original file line number Diff line number Diff line change
@@ -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 changes: 4 additions & 0 deletions Servers/WindowServer/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

mkdir -p ../../Root/usr/include/WindowServer/
cp *.h ../../Root/usr/include/WindowServer/
4 changes: 4 additions & 0 deletions SharedGraphics/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

mkdir -p ../Root/usr/include/SharedGraphics/
cp *.h ../Root/usr/include/SharedGraphics/
19 changes: 19 additions & 0 deletions Toolchain/CMakeToolchain.txt
Original file line number Diff line number Diff line change
@@ -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)

1 change: 1 addition & 0 deletions Toolchain/UseIt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
DIR=$( dirname $( readlink -e "$0" ) )
export PATH="$DIR/Local/bin:$PATH"
export TOOLCHAIN="$DIR"
export SERENITY_ROOT="$DIR/.."
echo "$PATH"