6.17. GNU Make 4.4.1
GNU Make provides the `make` and `gmake` build frontends needed by most target package build systems.
Input assumption: make-4.4.1.tar.gz is already present in LBI_SOURCES from the chapter 4 source staging step.
Source URL: https://gnu.mirror.constant.com/make/make-4.4.1.tar.gz
Upstream build note: GNU Make ships a generated configure script in release tarballs and documents a standard ./configure, make, make install flow.
Licenses:
- GPL-3.0-or-later
Dependencies:
- musl (libc)
- clang/llvm toolchain
- make (host)
GNU Make is a Makefile build orchestration tool. we need it to provide the target make and gmake commands used by most package build systems in later chapters.
Extract and Enter the Source Tree
cd "$LBI_SOURCES"
tar -xf make-4.4.1.tar.gz
cd make-4.4.1
Configure GNU Make
CC="$LBI_ROOT/system/tools/bin/$LBI_TARGET-clang" \
CFLAGS="--target=$LBI_TARGET --sysroot=$LBI_ROOT $LWI_CFLAGS" \
LDFLAGS="--target=$LBI_TARGET --sysroot=$LBI_ROOT $LBI_CUSTOM_LDFLAGS" \
lbi_configure \
--host="$LBI_TARGET" \
--without-guile \
--disable-nls
Build GNU Make
make $LWI_MAKE_FLAGS
Install GNU Make
make install DESTDIR="$LBI_ROOT"
ln -sf make "$LBI_ROOT/system/binaries/gmake"
Command Explanations
CC="$LBI_ROOT/system/tools/bin/$LBI_TARGET-clang": Uses the target-prefixed Clang compiler.CFLAGS="--target=$LBI_TARGET --sysroot=$LBI_ROOT $LWI_CFLAGS": Targets the selected triple and sysroot while preserving local C flag tuning.LDFLAGS="--target=$LBI_TARGET --sysroot=$LBI_ROOT $LBI_CUSTOM_LDFLAGS": Keeps link steps in the target sysroot and preserves local linker tuning.lbi_configure --host="$LBI_TARGET": Uses the book's configure helper for/systempaths and marks the build as a cross build.--without-guile: Disables GNU Make's optional Guile integration.--disable-nls: Disables native language support so this early build does not need gettext.make $LWI_MAKE_FLAGS: Builds GNU Make with the shared make parallelism setting.make install DESTDIR="$LBI_ROOT": Installs into the target root instead of the host filesystem.ln -sf make "$LBI_ROOT/system/binaries/gmake": Provides the commongmakecommand name for projects that explicitly request GNU Make.