1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-03 01:17:45 +03:00

mkosi: Simplify BUILDDIR/SRCDIR handling a bit

This commit is contained in:
Daan De Meyer 2023-02-21 15:19:06 +01:00
parent 01a0756427
commit d2a0ca2440

View File

@ -146,8 +146,7 @@ if [ ! -f "$BUILDDIR"/build.ninja ] ; then
-D ukify=true
fi
cd "$BUILDDIR"
ninja "$@"
ninja -C "$BUILDDIR" "$@"
if [ "$WITH_TESTS" = 1 ] ; then
if [ -n "$SANITIZERS" ]; then
export ASAN_OPTIONS="$MKOSI_ASAN_OPTIONS"
@ -157,33 +156,34 @@ if [ "$WITH_TESTS" = 1 ] ; then
TIMEOUT_MULTIPLIER=1
fi
meson test --print-errorlogs --timeout-multiplier=$TIMEOUT_MULTIPLIER
meson test -C "$BUILDDIR" --print-errorlogs --timeout-multiplier=$TIMEOUT_MULTIPLIER
fi
cd "$SRCDIR"
meson install -C "$BUILDDIR" --quiet --no-rebuild --only-changed
if [ -d mkosi.kernel/ ]; then
cd "$SRCDIR/mkosi.kernel"
mkdir -p "$BUILDDIR/mkosi.kernel"
SRCDIR="$SRCDIR/mkosi.kernel"
BUILDDIR="$BUILDDIR/mkosi.kernel"
cd "$SRCDIR"
mkdir -p "$BUILDDIR"
# Ensure fast incremental builds by fixating these values which usually change for each build.
export KBUILD_BUILD_TIMESTAMP="Fri Jun 5 15:58:00 CEST 2015"
export KBUILD_BUILD_HOST="mkosi"
scripts/kconfig/merge_config.sh -O "$BUILDDIR/mkosi.kernel" \
scripts/kconfig/merge_config.sh -O "$BUILDDIR" \
../mkosi.kernel.config \
tools/testing/selftests/bpf/config.x86_64 \
tools/testing/selftests/bpf/config
make O="$BUILDDIR/mkosi.kernel" -j "$(nproc)"
make O="$BUILDDIR" -j "$(nproc)"
KERNEL_RELEASE=$(make O="$BUILDDIR"/mkosi.kernel -s kernelrelease)
KERNEL_RELEASE=$(make O="$BUILDDIR" -s kernelrelease)
mkdir -p "$DESTDIR/usr/lib/modules/$KERNEL_RELEASE"
make O="$BUILDDIR/mkosi.kernel" INSTALL_MOD_PATH="$DESTDIR/usr" modules_install
make O="$BUILDDIR/mkosi.kernel" INSTALL_PATH="$DESTDIR/usr/lib/modules/$KERNEL_RELEASE" install
make O="$BUILDDIR" INSTALL_MOD_PATH="$DESTDIR/usr" modules_install
make O="$BUILDDIR" INSTALL_PATH="$DESTDIR/usr/lib/modules/$KERNEL_RELEASE" install
mkdir -p "$DESTDIR/usr/lib/kernel/selftests"
make -C tools/testing/selftests -j "$(nproc)" O="$BUILDDIR/mkosi.kernel" KSFT_INSTALL_PATH="$DESTDIR/usr/lib/kernel/selftests" SKIP_TARGETS="" install
make -C tools/testing/selftests -j "$(nproc)" O="$BUILDDIR" KSFT_INSTALL_PATH="$DESTDIR/usr/lib/kernel/selftests" SKIP_TARGETS="" install
ln -sf /usr/lib/kernel/selftests/bpf/bpftool "$DESTDIR/usr/bin/bpftool"
fi