Compare commits

..

No commits in common. "1e269d9fabe3d681e9aac723ed5c6680c1217f24" and "d823d4baf4978c40578ccde1d8cfd3ae1ae6a2bd" have entirely different histories.

5 changed files with 57 additions and 72 deletions

View File

@ -5,6 +5,8 @@ ARCH?=x86_64
INSTALLER_FLAGS?=--cookbook=cookbook
## Enabled to use binary prefix (much faster)
PREFIX_BINARY?=1
## Enabled to build custom rustc
PREFIX_RUSTC?=1
## Filesystem size in MB (256 is the default)
FILESYSTEM_SIZE?=256
@ -46,10 +48,6 @@ KBUILD=build/kernel
## Userspace variables
export TARGET=$(ARCH)-unknown-redox
BUILD=build/userspace
INSTALLER=\
export REDOXER_TOOLCHAIN="$(ROOT)/$(PREFIX_INSTALL)" && \
export PATH="$(PREFIX_PATH):$$PATH" && \
installer/target/release/redox_installer $(INSTALLER_FLAGS)
## Bootloader variables
EFI_TARGET=$(ARCH)-efi-pe

View File

@ -1,12 +1,11 @@
build/filesystem.bin: filesystem.toml build/bootloader build/kernel prefix
cargo build --manifest-path installer/Cargo.toml --release
cargo build --manifest-path redoxfs/Cargo.toml --release
-$(FUMOUNT) build/filesystem/ || true
rm -rf $@ $@.partial build/filesystem/
dd if=/dev/zero of=$@.partial bs=1048576 count="$(FILESYSTEM_SIZE)"
cargo run --manifest-path redoxfs/Cargo.toml --release --bin redoxfs-mkfs $@.partial
mkdir -p build/filesystem/
redoxfs/target/release/redoxfs $@.partial build/filesystem/
cargo build --manifest-path redoxfs/Cargo.toml --release --bin redoxfs
cargo run --manifest-path redoxfs/Cargo.toml --release --bin redoxfs -- $@.partial build/filesystem/
sleep 2
pgrep redoxfs
cp $< build/filesystem/filesystem.toml
@ -14,7 +13,8 @@ build/filesystem.bin: filesystem.toml build/bootloader build/kernel prefix
cp build/kernel build/filesystem/kernel
cp -r $(ROOT)/$(PREFIX_INSTALL)/$(TARGET)/include build/filesystem/include
cp -r $(ROOT)/$(PREFIX_INSTALL)/$(TARGET)/lib build/filesystem/lib
$(INSTALLER) -c $< build/filesystem/
export PATH="$(PREFIX_PATH):$$PATH" && \
cargo run --manifest-path installer/Cargo.toml --release -- $(INSTALLER_FLAGS) -c $< build/filesystem/
sync
-$(FUMOUNT) build/filesystem/ || true
rm -rf build/filesystem/
@ -23,14 +23,14 @@ build/filesystem.bin: filesystem.toml build/bootloader build/kernel prefix
mount: FORCE
mkdir -p build/filesystem/
cargo build --manifest-path redoxfs/Cargo.toml --release --bin redoxfs
redoxfs/target/release/redoxfs build/harddrive.bin build/filesystem/
cargo run --manifest-path redoxfs/Cargo.toml --release --bin redoxfs -- build/harddrive.bin build/filesystem/
sleep 2
pgrep redoxfs
mount_extra: FORCE
mkdir -p build/filesystem/
cargo build --manifest-path redoxfs/Cargo.toml --release --bin redoxfs
redoxfs/target/release/redoxfs build/extra.bin build/filesystem/
cargo run --manifest-path redoxfs/Cargo.toml --release --bin redoxfs -- build/extra.bin build/filesystem/
sleep 2
pgrep redoxfs

View File

@ -1,23 +1,23 @@
build/initfs.tag: initfs.toml prefix
cargo build --manifest-path installer/Cargo.toml --release
rm -f build/libkernel.a
rm -rf build/initfs
mkdir -p build/initfs
$(INSTALLER) -c $< build/initfs/
export PATH="$(PREFIX_PATH):$$PATH" && \
cargo run --manifest-path installer/Cargo.toml -- $(INSTALLER_FLAGS) -c $< build/initfs/
touch $@
build/initfs_coreboot.tag: initfs_coreboot.toml prefix
cargo build --manifest-path installer/Cargo.toml --release
rm -f build/libkernel_coreboot.a
rm -rf build/initfs_coreboot
mkdir -p build/initfs_coreboot
$(INSTALLER) -c $< build/initfs_coreboot/
export PATH="$(PREFIX_PATH):$$PATH" && \
cargo run --manifest-path installer/Cargo.toml -- $(INSTALLER_FLAGS) -c $< build/initfs_coreboot/
touch $@
build/initfs_live.tag: initfs_live.toml prefix
cargo build --manifest-path installer/Cargo.toml --release
rm -f build/libkernel_live.a
rm -rf build/initfs_live
mkdir -p build/initfs_live
$(INSTALLER) -c $< build/initfs_live/
export PATH="$(PREFIX_PATH):$$PATH" && \
cargo run --manifest-path installer/Cargo.toml -- $(INSTALLER_FLAGS) -c $< build/initfs_live/
touch $@

View File

@ -1,15 +1,16 @@
PREFIX=prefix/$(TARGET)
PREFIX_BASE_INSTALL=$(PREFIX)/rust-freestanding-install
PREFIX_BASE_INSTALL=$(PREFIX)/binutils-install
PREFIX_FREESTANDING_INSTALL=$(PREFIX)/gcc-freestanding-install
PREFIX_INSTALL=$(PREFIX)/relibc-install
ifeq ($(PREFIX_BINARY),1)
PREFIX_RELIBC_BASE=$(PREFIX)/rust-install
export RUSTUP_TOOLCHAIN=$(ROOT)/$(PREFIX)/rust-install
else
PREFIX_RELIBC_BASE=$(PREFIX)/gcc-install
ifeq ($(PREFIX_RUSTC),1)
PREFIX_BASE_INSTALL=$(PREFIX)/rust-freestanding-install
ifeq ($(PREFIX_BINARY),1)
export RUSTUP_TOOLCHAIN=$(ROOT)/$(PREFIX)/gcc-install
else
export RUSTUP_TOOLCHAIN=$(ROOT)/$(PREFIX)/rust-freestanding-install
endif
endif
PREFIX_BASE_PATH=$(ROOT)/$(PREFIX_BASE_INSTALL)/bin
@ -31,11 +32,9 @@ PREFIX_STRIP=\
-exec strip --strip-unneeded {} ';' \
2> /dev/null
$(PREFIX)/relibc-install: $(ROOT)/relibc | $(PREFIX_RELIBC_BASE)
$(PREFIX)/relibc-install: $(ROOT)/relibc | $(PREFIX)/gcc-install
rm -rf "$@.partial" "$@"
cp -r "$(PREFIX_RELIBC_BASE)" "$@.partial"
rm -rf "$@.partial/$(TARGET)/include/"*
cp -r "$(PREFIX_RELIBC_BASE)/$(TARGET)/include/c++" "$@.partial/$(TARGET)/include/c++"
cp -r "$(PREFIX)/gcc-install" "$@.partial"
cd "$<" && \
export PATH="$(ROOT)/$@.partial/bin:$$PATH" && \
export CARGO="env -u CARGO xargo" && \
@ -53,6 +52,38 @@ $(PREFIX)/relibc-install.tar.gz: $(PREFIX)/relibc-install
--directory="$<" \
.
$(PREFIX)/rust-install: $(ROOT)/rust | $(PREFIX)/relibc-install
rm -rf "$(PREFIX)/rust-build" "$@.partial" "$@"
mkdir -p "$(PREFIX)/rust-build"
cp -r "$(PREFIX)/relibc-install" "$@.partial"
cd "$(PREFIX)/rust-build" && \
export PATH="$(ROOT)/$@.partial/bin:$$PATH" && \
"$</configure" \
--prefix="/" \
--disable-docs \
--enable-cargo-native-static \
--enable-extended \
--enable-llvm-static-stdcpp \
--tools=cargo \
--target="$(TARGET)" \
&& \
$(MAKE) -j `$(NPROC)` && \
rm -rf "$(ROOT)/$@.partial/lib/rustlib" "$(ROOT)/$@.partial/share/doc/rust" && \
$(MAKE) -j `$(NPROC)` install DESTDIR="$(ROOT)/$@.partial"
rm -rf "$(PREFIX)/rust-build"
mkdir -p "$@.partial/lib/rustlib/x86_64-unknown-linux-gnu/bin"
cd "$@.partial" && find . -name *.old -exec rm {} ';' && $(PREFIX_STRIP)
touch "$@.partial"
mv "$@.partial" "$@"
$(PREFIX)/rust-install.tar.gz: $(PREFIX)/rust-install
tar \
--create \
--gzip \
--file "$@" \
--directory="$<" \
.
ifeq ($(PREFIX_BINARY),1)
$(PREFIX)/gcc-install.tar.gz:
@ -67,18 +98,6 @@ $(PREFIX)/gcc-install: $(PREFIX)/gcc-install.tar.gz
touch "$@.partial"
mv "$@.partial" "$@"
$(PREFIX)/rust-install.tar.gz:
mkdir -p "$(@D)"
wget -O $@.partial "https://static.redox-os.org/toolchain/$(TARGET)/rust-install.tar.gz"
mv $@.partial $@
$(PREFIX)/rust-install: $(PREFIX)/rust-install.tar.gz
rm -rf "$@.partial" "$@"
mkdir -p "$@.partial"
tar --extract --file "$<" --directory "$@.partial" --strip-components=1
touch "$@.partial"
mv "$@.partial" "$@"
else
$(PREFIX)/binutils.tar.bz2:
@ -213,36 +232,4 @@ $(PREFIX)/gcc-install.tar.gz: $(PREFIX)/gcc-install
--file "$@" \
--directory="$<" \
.
$(PREFIX)/rust-install: $(ROOT)/rust | $(PREFIX)/relibc-install
rm -rf "$(PREFIX)/rust-build" "$@.partial" "$@"
mkdir -p "$(PREFIX)/rust-build"
cp -r "$(PREFIX)/relibc-install" "$@.partial"
cd "$(PREFIX)/rust-build" && \
export PATH="$(ROOT)/$@.partial/bin:$$PATH" && \
"$</configure" \
--prefix="/" \
--disable-docs \
--enable-cargo-native-static \
--enable-extended \
--enable-llvm-static-stdcpp \
--tools=cargo \
--target="$(TARGET)" \
&& \
$(MAKE) -j `$(NPROC)` && \
rm -rf "$(ROOT)/$@.partial/lib/rustlib" "$(ROOT)/$@.partial/share/doc/rust" && \
$(MAKE) -j `$(NPROC)` install DESTDIR="$(ROOT)/$@.partial"
rm -rf "$(PREFIX)/rust-build"
mkdir -p "$@.partial/lib/rustlib/x86_64-unknown-linux-gnu/bin"
cd "$@.partial" && find . -name *.old -exec rm {} ';' && $(PREFIX_STRIP)
touch "$@.partial"
mv "$@.partial" "$@"
$(PREFIX)/rust-install.tar.gz: $(PREFIX)/rust-install
tar \
--create \
--gzip \
--file "$@" \
--directory="$<" \
.
endif

2
relibc

@ -1 +1 @@
Subproject commit 0cc0fbecdc40956a74863154d4eb9109b97db3d2
Subproject commit a6fffd3fb57b96e4b4769da2e205f2a2be09a23f