8.28. samurai stage 2 1.3

samurai provides a small Ninja-compatible build executor for the target userspace.

Input assumption: samurai-1.3.tar.gz is already present in LBI_SOURCES from the chapter 4 source staging step.

Licenses:

Dependencies:

samurai is a ninja-compatible build tool written in C99.

Extract and Enter the Source Tree

cd "/sources"
tar -xf samurai-1.3.tar.gz
cd samurai-1.3

Build samurai

Configure note: samurai uses a small POSIX Makefile and does not ship a configure script, so lbi_configure is not supported here. Build settings are passed directly to make.
make $LWI_MAKE_FLAGS \
    CC="clang" \
    CFLAGS="$LWI_CFLAGS" \
    LDFLAGS="$LBI_CUSTOM_LDFLAGS"

Install samurai

make install \
    PREFIX=/system \
    BINDIR=/system/binaries \
    MANDIR=/system/documentation/man-pages

ln -sf samu "/system/binaries/ninja"
ln -sf samu.1 "/system/documentation/man-pages/man1/ninja.1"

Command Explanations