1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:17:35 +00:00

Toolchain: Make sure everything ends up in the right place in Root/

This commit is contained in:
Andreas Kling 2019-05-08 15:50:24 +02:00
parent 758e926b99
commit 81a280da87
3 changed files with 31 additions and 15 deletions

View file

@ -79,10 +79,12 @@ clean:
@echo "CLEAN"; rm -f $(LIBRARY) $(CPP_OBJS) $(ASM_OBJS) *.d @echo "CLEAN"; rm -f $(LIBRARY) $(CPP_OBJS) $(ASM_OBJS) *.d
install: $(LIBRARY) install: $(LIBRARY)
mkdir -p ../Root/usr/include
mkdir -p ../Root/usr/lib
# Copy headers # Copy headers
rsync -a --include '*/' --include '*.h' --exclude '*' . ../Base/usr/include rsync -r -a --include '*/' --include '*.h' --exclude '*' . ../Root/usr/include
# Install the library # Install the library
cp $(LIBRARY) ../Base/usr/lib cp $(LIBRARY) ../Root/usr/lib
cp crt0.o ../Base/usr/lib/ cp crt0.o ../Root/usr/lib/
cp crti.ao ../Base/usr/lib/crti.o cp crti.ao ../Root/usr/lib/crti.o
cp crtn.ao ../Base/usr/lib/crtn.o cp crtn.ao ../Root/usr/lib/crtn.o

View file

@ -23,6 +23,6 @@ clean:
install: $(LIBRARY) install: $(LIBRARY)
# Copy headers # Copy headers
rsync -a --include '*/' --include '*.h' --exclude '*' . ../Base/usr/include rsync -a --include '*/' --include '*.h' --exclude '*' . ../Root/usr/include
# Install the library # Install the library
cp $(LIBRARY) ../Base/usr/lib cp $(LIBRARY) ../Root/usr/lib

30
Toolchain/BuildIt.sh Normal file → Executable file
View file

@ -7,18 +7,27 @@ TARGET=i686-pc-serenity
PREFIX="$DIR/Local" PREFIX="$DIR/Local"
SYSROOT="$DIR/../Root" SYSROOT="$DIR/../Root"
echo PREFIX is $PREFIX
echo SYSROOT is $SYSROOT
mkdir -p "$DIR/Tarballs" mkdir -p "$DIR/Tarballs"
source "$DIR/UseIt.sh" source "$DIR/UseIt.sh"
pushd "$DIR/Tarballs" pushd "$DIR/Tarballs"
if [ ! -e "binutils-2.32.tar.gz" ]; then md5="$(md5sum binutils-2.32.tar.gz | cut -f1 -d' ')"
echo "bu md5='$md5'"
if [ ! -e "binutils-2.32.tar.gz" ] || [ "$md5" != "d1119c93fc0ed3007be4a84dd186af55" ] ; then
rm -f binutils-2.32.tar.gz
wget "http://ftp.gnu.org/gnu/binutils/binutils-2.32.tar.gz" wget "http://ftp.gnu.org/gnu/binutils/binutils-2.32.tar.gz"
else else
echo "Skipped downloading binutils" echo "Skipped downloading binutils"
fi fi
if [ ! -e "gcc-8.3.0.tar.gz" ]; then md5="$(md5sum gcc-8.3.0.tar.gz | cut -f1 -d' ')"
echo "gc md5='$md5'"
if [ ! -e "gcc-8.3.0.tar.gz" ] || [ "$md5" != "9972f8c24c02ebcb5a342c1b30de69ff" ] ; then
rm -f gcc-8.3.0.tar.gz
wget "http://ftp.gnu.org/gnu/gcc/gcc-8.3.0/gcc-8.3.0.tar.gz" wget "http://ftp.gnu.org/gnu/gcc/gcc-8.3.0/gcc-8.3.0.tar.gz"
else else
echo "Skipped downloading gcc" echo "Skipped downloading gcc"
@ -60,8 +69,8 @@ pushd "$DIR/Build/"
--target=$TARGET \ --target=$TARGET \
--with-sysroot=$SYSROOT \ --with-sysroot=$SYSROOT \
--disable-nls || exit 1 --disable-nls || exit 1
make -j $(nproc) make -j $(nproc) || exit 1
make install make install || exit 1
popd popd
pushd gcc pushd gcc
@ -72,14 +81,19 @@ pushd "$DIR/Build/"
--with-newlib \ --with-newlib \
--enable-languages=c,c++ || exit 1 --enable-languages=c,c++ || exit 1
make -j $(nproc) all-gcc all-target-libgcc echo "XXX build gcc and libgcc"
make install-gcc install-target-libgcc make -j $(nproc) all-gcc all-target-libgcc || exit 1
echo "XXX install gcc and libgcc"
make install-gcc install-target-libgcc || exit 1
echo "XXX serenity libc and libm"
make -C "$DIR/../LibC/" install make -C "$DIR/../LibC/" install
make -C "$DIR/../LibM/" install make -C "$DIR/../LibM/" install
make all-target-libstdc++-v3 echo "XXX build libstdc++"
make install-target-libstdc++-v3 make all-target-libstdc++-v3 || exit 1
echo "XXX install libstdc++"
make install-target-libstdc++-v3 || exit 1
popd popd
popd popd