Offloaded make bootstrap to treetap

This commit is contained in:
Alexander Hill 2025-11-17 20:30:39 -05:00
parent a4c9aa19c7
commit bac2b53339
3 changed files with 70 additions and 21 deletions

View File

@ -17,6 +17,8 @@ export CXXFLAGS=$CFLAGS
export RANLIB=llvm-ranlib export RANLIB=llvm-ranlib
export LD=ld.lld export LD=ld.lld
export LDFLAGS="--sysroot=$BOOTSTRAP/root" export LDFLAGS="--sysroot=$BOOTSTRAP/root"
export TREETAP=$(pwd)/treetap
export TT_DIR=$(pwd)/.treetap
export TT_SYSROOT=$BOOTSTRAP/root export TT_SYSROOT=$BOOTSTRAP/root
export TT_TARGET=$TARGET export TT_TARGET=$TARGET
@ -24,7 +26,6 @@ export TT_TARGET=$TARGET
./treetap fetch sources/busybox/busybox.spec ./treetap fetch sources/busybox/busybox.spec
./treetap fetch sources/linux/linux.spec ./treetap fetch sources/linux/linux.spec
./treetap fetch sources/llvm/llvm.spec ./treetap fetch sources/llvm/llvm.spec
./treetap fetch sources/make/make.spec
./treetap fetch sources/musl/musl.spec ./treetap fetch sources/musl/musl.spec
# Make sure both clang-tblgen and llvm-tblgen are in the PATH. ~ahill # Make sure both clang-tblgen and llvm-tblgen are in the PATH. ~ahill
@ -234,25 +235,10 @@ make -O -j $PROCS install CONFIG_PREFIX=$BOOTSTRAP/root
cd .. cd ..
# Build Make # Build Make
MAKE_VERSION=$(sed -En "s/SRC_VERSION=\"?(.+)\"/\1/p" $SPEC/make/make.spec) $TREETAP fetch $SPEC/make/make.spec
tar xf $SOURCES/make/$MAKE_VERSION/make-*.tar* $TREETAP build $SPEC/make/make.spec
cd make-*/ $TREETAP package $SPEC/make/make.spec
./configure \ $TREETAP install .treetap/packages/$TARGET/make-*.cpio.xz $BOOTSTRAP/root
--bindir=/bin \
--datarootdir=/usr/share \
--enable-year2038 \
--host=$TARGET \
--includedir=/usr/include \
--libdir=/lib \
--libexecdir=/lib \
--localstatedir=/var \
--prefix=/ \
--runstatedir=/run \
--sbindir=/bin \
--sysconfdir=/etc
make -O -j $PROCS
make -O -j $PROCS install DESTDIR=$BOOTSTRAP/root
cd ..
# Install Treetap # Install Treetap
cp $BOOTSTRAP/../treetap $BOOTSTRAP/root/bin/ cp $BOOTSTRAP/../treetap $BOOTSTRAP/root/bin/

View File

@ -2,4 +2,32 @@
SRC_HASH="dd16fb1d67bfab79a72f5e8390735c49e3e8e70b4945a15ab1f81ddb78658fb3" SRC_HASH="dd16fb1d67bfab79a72f5e8390735c49e3e8e70b4945a15ab1f81ddb78658fb3"
SRC_NAME="make" SRC_NAME="make"
SRC_URL="https://ftp.gnu.org/gnu/make/make-4.4.1.tar.gz" SRC_URL="https://ftp.gnu.org/gnu/make/make-4.4.1.tar.gz"
SRC_VERSION="4.4.1" SRC_VERSION="4.4.1"
build() {
tar xf ../$SRC_FILENAME
cd make-*/
./configure \
--bindir=$TT_BINDIR \
--build=$TT_BUILD \
--datarootdir=/usr/share \
--enable-year2038 \
--host=$TT_TARGET \
--includedir=$TT_INCLUDEDIR \
--libdir=$TT_LIBDIR \
--libexecdir=$TT_LIBDIR \
--localstatedir=/var \
--prefix=$TT_PREFIX \
--runstatedir=/run \
--sbindir=$TT_BINDIR \
--sysconfdir=$TT_CONFDIR
make -O -j $TT_PROCS
}
clean() {
rm -rf make-*/
}
package() {
make -O -j $TT_PROCS install DESTDIR=$TT_INSTALLDIR
}

35
treetap
View File

@ -34,6 +34,41 @@
# November 9, 2025 (1.0.0) # November 9, 2025 (1.0.0)
# * Initial release [ahill] # * Initial release [ahill]
########################
# .spec File Reference #
########################
# For everyone trying to build .spec files (including myself), this is the list
# of useful variables to take advantage of. ~ahill
# Specification Functions:
# build - Builds the package
# clean - Cleans $TT_BUILDDIR for the next build
# package - Installs the package contents to $TT_INSTALLDIR
# Specification Variables:
# SRC_FILENAME - The name of the tarball to extract (optional)
# SRC_HASH - The hash of the tarball for verification purposes (required)
# SRC_NAME - The name of the package being built (required)
# SRC_URL - The URL of the tarball to be downloaded (required)
# SRC_VERSION - The version of the package being built (required)
# Treetap Variables:
# TT_BINDIR - The desired path for binaries [scope: source] [default: /bin]
# TT_BUILD - The target triple of the build system [scope: source]
# TT_BUILDDIR - The path to the build directory [scope: source]
# TT_CONFDIR - The desired path for configuration files [scope: source] [default: /etc]
# TT_DIR - The path to the treetap directory [scope: global]
# TT_INCLUDEDIR - The desired path for header files [scope: source] [default: /usr/include]
# TT_INSTALLDIR - The path to the install directory [scope: source]
# TT_LIBDIR - The desired path for libraries [scope: source] [default: /lib]
# TT_PKGDIR - The path to the package directory [scope: global]
# TT_PREFIX - The desired prefix for the package [scope: source] [default: /]
# TT_PROCS - The number of processors on the build system [scope: source]
# TT_SYSROOT - The sysroot of the target system [scope: global]
# TT_TARGET - The target triple of the target system [scope: source]
# TT_VERSION - The version of treetap being used [scope: global]
#################### ####################
# Global Variables # # Global Variables #
#################### ####################