Compare commits
3 Commits
f5707c56e9
...
52b8045fc5
Author | SHA1 | Date |
---|---|---|
Jeremy Soller | 52b8045fc5 | |
Jeremy Soller | 34d4e2dcfd | |
Jeremy Soller | d894686192 |
48
mk/prefix.mk
48
mk/prefix.mk
|
@ -1,26 +1,10 @@
|
||||||
PREFIX=prefix/$(TARGET)
|
PREFIX=prefix/$(TARGET)
|
||||||
|
|
||||||
PREFIX_BASE_INSTALL=$(PREFIX)/rust-freestanding-install
|
|
||||||
PREFIX_FREESTANDING_INSTALL=$(PREFIX)/gcc-freestanding-install
|
|
||||||
PREFIX_INSTALL=$(PREFIX)/relibc-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
|
|
||||||
export RUSTUP_TOOLCHAIN=$(ROOT)/$(PREFIX)/rust-freestanding-install
|
|
||||||
endif
|
|
||||||
|
|
||||||
PREFIX_BASE_PATH=$(ROOT)/$(PREFIX_BASE_INSTALL)/bin
|
|
||||||
PREFIX_FREESTANDING_PATH=$(ROOT)/$(PREFIX_FREESTANDING_INSTALL)/bin
|
|
||||||
PREFIX_PATH=$(ROOT)/$(PREFIX_INSTALL)/bin
|
PREFIX_PATH=$(ROOT)/$(PREFIX_INSTALL)/bin
|
||||||
|
|
||||||
export PREFIX_RUSTFLAGS=-L $(ROOT)/$(PREFIX_INSTALL)/$(TARGET)/lib
|
export PREFIX_RUSTFLAGS=-L $(ROOT)/$(PREFIX_INSTALL)/$(TARGET)/lib
|
||||||
|
export RUSTUP_TOOLCHAIN=$(ROOT)/$(PREFIX_INSTALL)
|
||||||
prefix-base: $(PREFIX_BASE_INSTALL)
|
|
||||||
|
|
||||||
prefix-freestanding: $(PREFIX_FREESTANDING_INSTALL)
|
|
||||||
|
|
||||||
prefix: $(PREFIX_INSTALL)
|
prefix: $(PREFIX_INSTALL)
|
||||||
|
|
||||||
|
@ -31,11 +15,11 @@ 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)/rust-install
|
||||||
rm -rf "$@.partial" "$@"
|
rm -rf "$@.partial" "$@"
|
||||||
cp -r "$(PREFIX_RELIBC_BASE)" "$@.partial"
|
cp -r "$(PREFIX)/rust-install" "$@.partial"
|
||||||
rm -rf "$@.partial/$(TARGET)/include/"*
|
rm -rf "$@.partial/$(TARGET)/include/"*
|
||||||
cp -r "$(PREFIX_RELIBC_BASE)/$(TARGET)/include/c++" "$@.partial/$(TARGET)/include/c++"
|
cp -r "$(PREFIX)rust-install/$(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" && \
|
||||||
|
@ -55,18 +39,6 @@ $(PREFIX)/relibc-install.tar.gz: $(PREFIX)/relibc-install
|
||||||
|
|
||||||
ifeq ($(PREFIX_BINARY),1)
|
ifeq ($(PREFIX_BINARY),1)
|
||||||
|
|
||||||
$(PREFIX)/gcc-install.tar.gz:
|
|
||||||
mkdir -p "$(@D)"
|
|
||||||
wget -O $@.partial "https://static.redox-os.org/toolchain/$(TARGET)/gcc-install.tar.gz"
|
|
||||||
mv $@.partial $@
|
|
||||||
|
|
||||||
$(PREFIX)/gcc-install: $(PREFIX)/gcc-install.tar.gz
|
|
||||||
rm -rf "$@.partial" "$@"
|
|
||||||
mkdir -p "$@.partial"
|
|
||||||
tar --extract --file "$<" --directory "$@.partial" --strip-components=1
|
|
||||||
touch "$@.partial"
|
|
||||||
mv "$@.partial" "$@"
|
|
||||||
|
|
||||||
$(PREFIX)/rust-install.tar.gz:
|
$(PREFIX)/rust-install.tar.gz:
|
||||||
mkdir -p "$(@D)"
|
mkdir -p "$(@D)"
|
||||||
wget -O $@.partial "https://static.redox-os.org/toolchain/$(TARGET)/rust-install.tar.gz"
|
wget -O $@.partial "https://static.redox-os.org/toolchain/$(TARGET)/rust-install.tar.gz"
|
||||||
|
@ -81,6 +53,12 @@ $(PREFIX)/rust-install: $(PREFIX)/rust-install.tar.gz
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
|
PREFIX_BASE_INSTALL=$(PREFIX)/rust-freestanding-install
|
||||||
|
PREFIX_FREESTANDING_INSTALL=$(PREFIX)/gcc-freestanding-install
|
||||||
|
|
||||||
|
PREFIX_BASE_PATH=$(ROOT)/$(PREFIX_BASE_INSTALL)/bin
|
||||||
|
PREFIX_FREESTANDING_PATH=$(ROOT)/$(PREFIX_FREESTANDING_INSTALL)/bin
|
||||||
|
|
||||||
$(PREFIX)/binutils.tar.bz2:
|
$(PREFIX)/binutils.tar.bz2:
|
||||||
mkdir -p "$(@D)"
|
mkdir -p "$(@D)"
|
||||||
wget -O $@.partial "https://gitlab.redox-os.org/redox-os/binutils-gdb/-/archive/redox/binutils-gdb-redox.tar.bz2"
|
wget -O $@.partial "https://gitlab.redox-os.org/redox-os/binutils-gdb/-/archive/redox/binutils-gdb-redox.tar.bz2"
|
||||||
|
@ -170,7 +148,7 @@ $(PREFIX)/relibc-freestanding-install: $(ROOT)/relibc | $(PREFIX_BASE_INSTALL) $
|
||||||
mkdir -p "$@.partial"
|
mkdir -p "$@.partial"
|
||||||
cd "$<" && \
|
cd "$<" && \
|
||||||
export PATH="$(PREFIX_BASE_INSTALL):$(PREFIX_FREESTANDING_PATH):$$PATH" && \
|
export PATH="$(PREFIX_BASE_INSTALL):$(PREFIX_FREESTANDING_PATH):$$PATH" && \
|
||||||
export CARGO="env -u CARGO xargo" && \
|
export CARGO="env -u CARGO -u RUSTUP_TOOLCHAIN xargo" && \
|
||||||
export CC_$(subst -,_,$(TARGET))="$(TARGET)-gcc -isystem $(ROOT)/$@.partial/$(TARGET)/include" && \
|
export CC_$(subst -,_,$(TARGET))="$(TARGET)-gcc -isystem $(ROOT)/$@.partial/$(TARGET)/include" && \
|
||||||
$(MAKE) -j `$(NPROC)` all && \
|
$(MAKE) -j `$(NPROC)` all && \
|
||||||
$(MAKE) -j `$(NPROC)` install DESTDIR="$(ROOT)/$@.partial/$(TARGET)"
|
$(MAKE) -j `$(NPROC)` install DESTDIR="$(ROOT)/$@.partial/$(TARGET)"
|
||||||
|
@ -214,10 +192,10 @@ $(PREFIX)/gcc-install.tar.gz: $(PREFIX)/gcc-install
|
||||||
--directory="$<" \
|
--directory="$<" \
|
||||||
.
|
.
|
||||||
|
|
||||||
$(PREFIX)/rust-install: $(ROOT)/rust | $(PREFIX)/relibc-install
|
$(PREFIX)/rust-install: $(ROOT)/rust | $(PREFIX)/gcc-install
|
||||||
rm -rf "$(PREFIX)/rust-build" "$@.partial" "$@"
|
rm -rf "$(PREFIX)/rust-build" "$@.partial" "$@"
|
||||||
mkdir -p "$(PREFIX)/rust-build"
|
mkdir -p "$(PREFIX)/rust-build"
|
||||||
cp -r "$(PREFIX)/relibc-install" "$@.partial"
|
cp -r "$(PREFIX)/gcc-install" "$@.partial"
|
||||||
cd "$(PREFIX)/rust-build" && \
|
cd "$(PREFIX)/rust-build" && \
|
||||||
export PATH="$(ROOT)/$@.partial/bin:$$PATH" && \
|
export PATH="$(ROOT)/$@.partial/bin:$$PATH" && \
|
||||||
"$</configure" \
|
"$</configure" \
|
||||||
|
|
2
relibc
2
relibc
|
@ -1 +1 @@
|
||||||
Subproject commit ae34ade595c78ecae1d26ffc43007a570e721675
|
Subproject commit c7910a87546fd8f3b7fa7b05fa2dc8efd9506aac
|
Reference in New Issue