Commit bd4a3ef8 authored by Jeremy Soller's avatar Jeremy Soller

Improve prefix generation and fix build

parent 0918ceb8
......@@ -4,7 +4,7 @@ ARCH?=x86_64
## Flags to pass to the installer (empty to download binary packages)
INSTALLER_FLAGS?=--cookbook=cookbook
## Enabled to use binary prefix (much faster)
PREFIX_BINARY?=1
PREFIX_BINARY?=0
## Enabled to build custom rustc
PREFIX_RUSTC?=1
## Filesystem size in MB (256 is the default)
......
......@@ -26,9 +26,7 @@ build/coreboot.elf: bootloader-coreboot/build/bootloader
cp -v $< $@
bootloader-efi/build/$(EFI_TARGET)/boot.efi: FORCE
unset XARGO_HOME XARGO_RUST_SRC && \
cd bootloader-efi && \
rustup component add rust-src && \
$(MAKE) build/$(EFI_TARGET)/boot.efi TARGET=$(EFI_TARGET)
build/bootloader.efi: bootloader-efi/build/$(EFI_TARGET)/boot.efi
......@@ -36,7 +34,7 @@ build/bootloader.efi: bootloader-efi/build/$(EFI_TARGET)/boot.efi
cp -v $< $@
build/harddrive-efi.bin: build/bootloader.efi build/filesystem.bin
dd if=/dev/zero of=$@.partial bs=1048576 count=$$(du -m $< | cut -f1)
dd if=/dev/zero of=$@.partial bs=1048576 count=$$(expr $$(du -m $< | cut -f1) + 1)
mkfs.vfat $@.partial
mmd -i $@.partial efi
mmd -i $@.partial efi/boot
......
......@@ -54,6 +54,32 @@ $(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 \
--target="$(TARGET)" \
&& \
make -j `$(NPROC)` && \
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" && $(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:
......@@ -200,16 +226,4 @@ $(PREFIX)/gcc-install.tar.gz: $(PREFIX)/gcc-install
--file "$@" \
--directory="$<" \
.
# Building full rustc may not be required
# $(PREFIX)/rust-install: $(ROOT)/rust | $(PREFIX)/gcc-install
# rm -rf "$(PREFIX)/rust-build" "$@"
# mkdir -p "$(PREFIX)/rust-build" "$@"
# cd "$(PREFIX)/rust-build" && \
# export PATH="$(PREFIX_PATH):$$PATH" && \
# "$</configure" --target="$(TARGET)" --prefix="$@" --disable-docs && \
# make -j `$(NPROC)` && \
# make -j `$(NPROC)` install
# touch "$@"
endif
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