Compare commits
No commits in common. "1e269d9fabe3d681e9aac723ed5c6680c1217f24" and "d823d4baf4978c40578ccde1d8cfd3ae1ae6a2bd" have entirely different histories.
1e269d9fab
...
d823d4baf4
|
@ -5,6 +5,8 @@ ARCH?=x86_64
|
||||||
INSTALLER_FLAGS?=--cookbook=cookbook
|
INSTALLER_FLAGS?=--cookbook=cookbook
|
||||||
## Enabled to use binary prefix (much faster)
|
## Enabled to use binary prefix (much faster)
|
||||||
PREFIX_BINARY?=1
|
PREFIX_BINARY?=1
|
||||||
|
## Enabled to build custom rustc
|
||||||
|
PREFIX_RUSTC?=1
|
||||||
## Filesystem size in MB (256 is the default)
|
## Filesystem size in MB (256 is the default)
|
||||||
FILESYSTEM_SIZE?=256
|
FILESYSTEM_SIZE?=256
|
||||||
|
|
||||||
|
@ -46,10 +48,6 @@ KBUILD=build/kernel
|
||||||
## Userspace variables
|
## Userspace variables
|
||||||
export TARGET=$(ARCH)-unknown-redox
|
export TARGET=$(ARCH)-unknown-redox
|
||||||
BUILD=build/userspace
|
BUILD=build/userspace
|
||||||
INSTALLER=\
|
|
||||||
export REDOXER_TOOLCHAIN="$(ROOT)/$(PREFIX_INSTALL)" && \
|
|
||||||
export PATH="$(PREFIX_PATH):$$PATH" && \
|
|
||||||
installer/target/release/redox_installer $(INSTALLER_FLAGS)
|
|
||||||
|
|
||||||
## Bootloader variables
|
## Bootloader variables
|
||||||
EFI_TARGET=$(ARCH)-efi-pe
|
EFI_TARGET=$(ARCH)-efi-pe
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
build/filesystem.bin: filesystem.toml build/bootloader build/kernel prefix
|
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
|
-$(FUMOUNT) build/filesystem/ || true
|
||||||
rm -rf $@ $@.partial build/filesystem/
|
rm -rf $@ $@.partial build/filesystem/
|
||||||
dd if=/dev/zero of=$@.partial bs=1048576 count="$(FILESYSTEM_SIZE)"
|
dd if=/dev/zero of=$@.partial bs=1048576 count="$(FILESYSTEM_SIZE)"
|
||||||
cargo run --manifest-path redoxfs/Cargo.toml --release --bin redoxfs-mkfs $@.partial
|
cargo run --manifest-path redoxfs/Cargo.toml --release --bin redoxfs-mkfs $@.partial
|
||||||
mkdir -p build/filesystem/
|
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
|
sleep 2
|
||||||
pgrep redoxfs
|
pgrep redoxfs
|
||||||
cp $< build/filesystem/filesystem.toml
|
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 build/kernel build/filesystem/kernel
|
||||||
cp -r $(ROOT)/$(PREFIX_INSTALL)/$(TARGET)/include build/filesystem/include
|
cp -r $(ROOT)/$(PREFIX_INSTALL)/$(TARGET)/include build/filesystem/include
|
||||||
cp -r $(ROOT)/$(PREFIX_INSTALL)/$(TARGET)/lib build/filesystem/lib
|
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
|
sync
|
||||||
-$(FUMOUNT) build/filesystem/ || true
|
-$(FUMOUNT) build/filesystem/ || true
|
||||||
rm -rf build/filesystem/
|
rm -rf build/filesystem/
|
||||||
|
@ -23,14 +23,14 @@ build/filesystem.bin: filesystem.toml build/bootloader build/kernel prefix
|
||||||
mount: FORCE
|
mount: FORCE
|
||||||
mkdir -p build/filesystem/
|
mkdir -p build/filesystem/
|
||||||
cargo build --manifest-path redoxfs/Cargo.toml --release --bin redoxfs
|
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
|
sleep 2
|
||||||
pgrep redoxfs
|
pgrep redoxfs
|
||||||
|
|
||||||
mount_extra: FORCE
|
mount_extra: FORCE
|
||||||
mkdir -p build/filesystem/
|
mkdir -p build/filesystem/
|
||||||
cargo build --manifest-path redoxfs/Cargo.toml --release --bin redoxfs
|
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
|
sleep 2
|
||||||
pgrep redoxfs
|
pgrep redoxfs
|
||||||
|
|
||||||
|
|
12
mk/initfs.mk
12
mk/initfs.mk
|
@ -1,23 +1,23 @@
|
||||||
build/initfs.tag: initfs.toml prefix
|
build/initfs.tag: initfs.toml prefix
|
||||||
cargo build --manifest-path installer/Cargo.toml --release
|
|
||||||
rm -f build/libkernel.a
|
rm -f build/libkernel.a
|
||||||
rm -rf build/initfs
|
rm -rf build/initfs
|
||||||
mkdir -p 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 $@
|
touch $@
|
||||||
|
|
||||||
build/initfs_coreboot.tag: initfs_coreboot.toml prefix
|
build/initfs_coreboot.tag: initfs_coreboot.toml prefix
|
||||||
cargo build --manifest-path installer/Cargo.toml --release
|
|
||||||
rm -f build/libkernel_coreboot.a
|
rm -f build/libkernel_coreboot.a
|
||||||
rm -rf build/initfs_coreboot
|
rm -rf build/initfs_coreboot
|
||||||
mkdir -p 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 $@
|
touch $@
|
||||||
|
|
||||||
build/initfs_live.tag: initfs_live.toml prefix
|
build/initfs_live.tag: initfs_live.toml prefix
|
||||||
cargo build --manifest-path installer/Cargo.toml --release
|
|
||||||
rm -f build/libkernel_live.a
|
rm -f build/libkernel_live.a
|
||||||
rm -rf build/initfs_live
|
rm -rf build/initfs_live
|
||||||
mkdir -p 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 $@
|
touch $@
|
||||||
|
|
95
mk/prefix.mk
95
mk/prefix.mk
|
@ -1,15 +1,16 @@
|
||||||
PREFIX=prefix/$(TARGET)
|
PREFIX=prefix/$(TARGET)
|
||||||
|
|
||||||
PREFIX_BASE_INSTALL=$(PREFIX)/rust-freestanding-install
|
PREFIX_BASE_INSTALL=$(PREFIX)/binutils-install
|
||||||
PREFIX_FREESTANDING_INSTALL=$(PREFIX)/gcc-freestanding-install
|
PREFIX_FREESTANDING_INSTALL=$(PREFIX)/gcc-freestanding-install
|
||||||
PREFIX_INSTALL=$(PREFIX)/relibc-install
|
PREFIX_INSTALL=$(PREFIX)/relibc-install
|
||||||
|
|
||||||
ifeq ($(PREFIX_BINARY),1)
|
ifeq ($(PREFIX_RUSTC),1)
|
||||||
PREFIX_RELIBC_BASE=$(PREFIX)/rust-install
|
PREFIX_BASE_INSTALL=$(PREFIX)/rust-freestanding-install
|
||||||
export RUSTUP_TOOLCHAIN=$(ROOT)/$(PREFIX)/rust-install
|
ifeq ($(PREFIX_BINARY),1)
|
||||||
else
|
export RUSTUP_TOOLCHAIN=$(ROOT)/$(PREFIX)/gcc-install
|
||||||
PREFIX_RELIBC_BASE=$(PREFIX)/gcc-install
|
else
|
||||||
export RUSTUP_TOOLCHAIN=$(ROOT)/$(PREFIX)/rust-freestanding-install
|
export RUSTUP_TOOLCHAIN=$(ROOT)/$(PREFIX)/rust-freestanding-install
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
PREFIX_BASE_PATH=$(ROOT)/$(PREFIX_BASE_INSTALL)/bin
|
PREFIX_BASE_PATH=$(ROOT)/$(PREFIX_BASE_INSTALL)/bin
|
||||||
|
@ -31,11 +32,9 @@ PREFIX_STRIP=\
|
||||||
-exec strip --strip-unneeded {} ';' \
|
-exec strip --strip-unneeded {} ';' \
|
||||||
2> /dev/null
|
2> /dev/null
|
||||||
|
|
||||||
$(PREFIX)/relibc-install: $(ROOT)/relibc | $(PREFIX_RELIBC_BASE)
|
$(PREFIX)/relibc-install: $(ROOT)/relibc | $(PREFIX)/gcc-install
|
||||||
rm -rf "$@.partial" "$@"
|
rm -rf "$@.partial" "$@"
|
||||||
cp -r "$(PREFIX_RELIBC_BASE)" "$@.partial"
|
cp -r "$(PREFIX)/gcc-install" "$@.partial"
|
||||||
rm -rf "$@.partial/$(TARGET)/include/"*
|
|
||||||
cp -r "$(PREFIX_RELIBC_BASE)/$(TARGET)/include/c++" "$@.partial/$(TARGET)/include/c++"
|
|
||||||
cd "$<" && \
|
cd "$<" && \
|
||||||
export PATH="$(ROOT)/$@.partial/bin:$$PATH" && \
|
export PATH="$(ROOT)/$@.partial/bin:$$PATH" && \
|
||||||
export CARGO="env -u CARGO xargo" && \
|
export CARGO="env -u CARGO xargo" && \
|
||||||
|
@ -53,6 +52,38 @@ $(PREFIX)/relibc-install.tar.gz: $(PREFIX)/relibc-install
|
||||||
--directory="$<" \
|
--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)
|
ifeq ($(PREFIX_BINARY),1)
|
||||||
|
|
||||||
$(PREFIX)/gcc-install.tar.gz:
|
$(PREFIX)/gcc-install.tar.gz:
|
||||||
|
@ -67,18 +98,6 @@ $(PREFIX)/gcc-install: $(PREFIX)/gcc-install.tar.gz
|
||||||
touch "$@.partial"
|
touch "$@.partial"
|
||||||
mv "$@.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
|
else
|
||||||
|
|
||||||
$(PREFIX)/binutils.tar.bz2:
|
$(PREFIX)/binutils.tar.bz2:
|
||||||
|
@ -213,36 +232,4 @@ $(PREFIX)/gcc-install.tar.gz: $(PREFIX)/gcc-install
|
||||||
--file "$@" \
|
--file "$@" \
|
||||||
--directory="$<" \
|
--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
|
endif
|
||||||
|
|
2
relibc
2
relibc
|
@ -1 +1 @@
|
||||||
Subproject commit 0cc0fbecdc40956a74863154d4eb9109b97db3d2
|
Subproject commit a6fffd3fb57b96e4b4769da2e205f2a2be09a23f
|
Reference in New Issue