ports: Allow specifying custom make targets

This commit is contained in:
Bananymous 2025-06-28 17:24:14 +03:00
parent fa4095ba95
commit 463ce05da0
1 changed files with 9 additions and 2 deletions

View File

@ -46,6 +46,9 @@ if [ ! -f "$MESON_CROSS_FILE" ] || [ "$MESON_CROSS_FILE" -ot "$BANAN_TOOLCHAIN_D
sed -i "s/SYSROOT/$BANAN_SYSROOT/" "$MESON_CROSS_FILE" sed -i "s/SYSROOT/$BANAN_SYSROOT/" "$MESON_CROSS_FILE"
fi fi
MAKE_BUILD_TARGETS=('all')
MAKE_INSTALL_TARGETS=('install')
clean() { clean() {
find . -mindepth 1 -maxdepth 1 -not -name 'patches' -not -name 'build.sh' -exec rm -rf {} + find . -mindepth 1 -maxdepth 1 -not -name 'patches' -not -name 'build.sh' -exec rm -rf {} +
} }
@ -69,11 +72,15 @@ configure() {
} }
build() { build() {
make -j$(nproc) || exit 1 for target in "${MAKE_BUILD_TARGETS[@]}"; do
make -j$(nproc) $target || exit 1
done
} }
install() { install() {
make install "DESTDIR=$BANAN_SYSROOT" || exit 1 for target in "${MAKE_INSTALL_TARGETS[@]}"; do
make $target "DESTDIR=$BANAN_SYSROOT" || exit 1
done
} }
source $1 source $1