Commit 9aaf4e35 authored by Jeremy Soller's avatar Jeremy Soller

WIP: Build of cross compiler

parent 5a7df39c
build
/build/
/prefix/
......@@ -40,10 +40,8 @@ fetch:
"$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../initfs.toml)" \
"$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../filesystem.toml)"
# Emulation recipes
include mk/qemu.mk
include mk/bochs.mk
include mk/virtualbox.mk
# Cross compiler recipes
include mk/cross.mk
# Kernel recipes
include mk/kernel.mk
......@@ -55,6 +53,11 @@ include mk/filesystem.mk
# Disk images
include mk/disk.mk
# Emulation recipes
include mk/qemu.mk
include mk/bochs.mk
include mk/virtualbox.mk
# CI image target
ci-img: FORCE
make INSTALLER_FLAGS= build/harddrive.bin.gz build/harddrive-efi.bin.gz build/livedisk.iso build/livedisk-efi.iso
......
PREFIX=$(ROOT)/prefix
binutils: $(PREFIX)/binutils-install
gcc-freestanding: $(PREFIX)/gcc-freestanding-install
relibc: $(PREFIX)/relibc-install
gcc: $(PREFIX)/gcc-install
$(PREFIX)/binutils.tar.bz2:
mkdir -p "$(@D)"
wget -O $@.partial "https://gitlab.redox-os.org/redox-os/binutils-gdb/-/archive/master/binutils-gdb-master.tar.bz2"
mv $@.partial $@
$(PREFIX)/binutils: $(PREFIX)/binutils.tar.bz2
mkdir -p "$@.partial"
tar --extract --file "$<" --directory "$@.partial" --strip-components=1
mv "$@.partial" "$@"
$(PREFIX)/binutils-install: $(PREFIX)/binutils
rm -rf "$<-build" "$@"
mkdir -p "$<-build" "$@"
cd "$<-build" && \
"$</configure" --target="$(TARGET)" --disable-werror --prefix="$@" && \
make all -j `nproc` && \
make install -j `nproc`
touch "$@"
$(PREFIX)/gcc.tar.bz2:
mkdir -p "$(@D)"
wget -O $@.partial "https://gitlab.redox-os.org/redox-os/gcc/-/archive/redox/gcc-redox.tar.bz2"
mv $@.partial $@
$(PREFIX)/gcc: $(PREFIX)/gcc.tar.bz2
mkdir -p "$@.partial"
tar --extract --file "$<" --directory "$@.partial" --strip-components=1
cd "$@.partial" && ./contrib/download_prerequisites
mv "$@.partial" "$@"
$(PREFIX)/gcc-freestanding-install: $(PREFIX)/gcc
rm -rf "$<-freestanding-build" "$@"
mkdir -p "$<-freestanding-build" "$@"
cd "$<-freestanding-build" && \
"$</configure" --target="$(TARGET)" --prefix="$@" --disable-nls --enable-languages=c,c++ --without-headers && \
make all-gcc -j `nproc` && \
make all-target-libgcc -j `nproc` && \
make install-gcc -j `nproc` && \
make install-target-libgcc -j `nproc`
touch "$@"
$(PREFIX)/relibc-install: $(PREFIX)/binutils-install $(PREFIX)/gcc-freestanding-install
cd relibc && \
make all -j `nproc` && \
make DESTDIR="$@" install -j `nproc`
touch "$@"
$(PREFIX)/gcc-install: $(PREFIX)/gcc $(PREFIX)/relibc-install
rm -rf "$<-build" "$@"
mkdir -p "$<-build" "$@"
cd "$<-build" && \
"$</configure" --target="$(TARGET)" --disable-werror --prefix="$@" --with-sysroot="$(PREFIX)/relibc-install" --disable-nls --enable-languages=c,c++ && \
make all-gcc -j `nproc` && \
make all-target-libgcc -j `nproc` && \
make install-gcc -j `nproc` && \
make install-target-libgcc -j `nproc` && \
make all-target-libstdc++-v3 -j `nproc` && \
make install-target-libstdc++-v3 -j `nproc`
touch "$@"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment