mirror of
https://github.com/kmod-project/kmod.git
synced 2026-01-27 09:54:37 +00:00
As Tobias reported, rsync is a bit of heavyweight dependency. We introduced it, as a replacement for the rm/cp -r previously used. The rsync was inspired since, unlike make, meson will build all the test binaries/artefacts even without calling "meson test". We can go back to cp with --archive (--preserve=timestamps at least), which will ensure we don't get stale files. To ensure the second run doesn't copy the source folder as _subfolder_ of the dest we need to wildcard the copy... Plus we need a proper destination folder in the first place. With this, we get a no-op second+ builds - be that with meson or make. Since the explicit always-dirty state is by design, drop the meson TODO and document the output variable. Confirmed by comparing both the `make --debug` output and the execution times. Reported-by: Tobias Stoeckmann <tobias@stoeckmann.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Link: https://github.com/kmod-project/kmod/pull/192 Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
17 lines
363 B
Bash
Executable File
17 lines
363 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
SRCDIR=$1
|
|
BUILDDIR=$2
|
|
MODULE_PLAYGROUND=$3
|
|
|
|
# TODO: meson allows only out of tree builds
|
|
if test "$SRCDIR" != "$BUILDDIR"; then
|
|
mkdir -p "$MODULE_PLAYGROUND"
|
|
cp --archive "$SRCDIR/$MODULE_PLAYGROUND/"* "$MODULE_PLAYGROUND/"
|
|
fi
|
|
|
|
export MAKEFLAGS=${MAKEFLAGS-"-j$(nproc)"}
|
|
"${MAKE-make}" -C "$PWD/$MODULE_PLAYGROUND" modules
|