build: standardize parallel make arguments

Currently the number of make jobs used for the default build target are
hardcoded and the value used varies across files.

For consistency (and potentially better performance), use
`make -j "$(nproc)"` everywhere that `make -j` is currently used.

Kind of relates to commit 500d8f2d6 ("ci: run make in parallel where
applicable", 2023-08-14) / PR #5960.
This commit is contained in:
Kelvin M. Klann 2024-02-27 23:54:35 -03:00
parent 223f71df7d
commit 93a5d7a2f5
4 changed files with 22 additions and 22 deletions

View file

@ -23,7 +23,7 @@ gcov_generate() {
make distclean &&
./configure --prefix=/usr --enable-fatal-warnings \
--enable-apparmor --enable-gcov &&
make -j4 &&
make -j "$(nproc)" &&
sudo make install
rm -fr gcov-dir gcov-file

View file

@ -26,7 +26,7 @@ tar -xJvf "$CODE_ARCHIVE"
#mkdir -p "$INSTALL_DIR"
cd "$CODE_DIR"
./configure --prefix=/usr --enable-apparmor "$@"
make -j2
make -j "$(nproc)"
mkdir debian
DESTDIR=debian make install-strip

View file

@ -44,5 +44,5 @@ mv $DIRFIRETOOLS $DIRFIREJAIL/extras/firetools
# build
cd $DIRFIREJAIL
cov-build --dir cov-int make -j 4 extras
cov-build --dir cov-int make -j "$(nproc)" extras
tar czvf myproject.tgz cov-int

View file

@ -82,7 +82,7 @@ mv "$DIST" firejail
cd firejail || exit 1
./configure --prefix=/usr --enable-fatal-warnings 2>&1 | tee ../output-configure
make -j4 2>&1 | tee ../output-make
make -j "$(nproc)" 2>&1 | tee ../output-make
cd ..
grep Warning output-configure output-make > ./report-test1
grep Error output-configure output-make >> ./report-test1
@ -99,7 +99,7 @@ print_title "${arr[2]}"
cd firejail || exit 1
make distclean
./configure --prefix=/usr --disable-dbusproxy --enable-fatal-warnings 2>&1 | tee ../output-configure
make -j4 2>&1 | tee ../output-make
make -j "$(nproc)" 2>&1 | tee ../output-make
cd ..
grep Warning output-configure output-make > ./report-test2
grep Error output-configure output-make >> ./report-test2
@ -116,7 +116,7 @@ print_title "${arr[3]}"
cd firejail || exit 1
make distclean
./configure --prefix=/usr --disable-chroot --enable-fatal-warnings 2>&1 | tee ../output-configure
make -j4 2>&1 | tee ../output-make
make -j "$(nproc)" 2>&1 | tee ../output-make
cd ..
grep Warning output-configure output-make > ./report-test3
grep Error output-configure output-make >> ./report-test3
@ -133,7 +133,7 @@ print_title "${arr[4]}"
cd firejail || exit 1
make distclean
./configure --prefix=/usr --disable-firetunnel --enable-fatal-warnings 2>&1 | tee ../output-configure
make -j4 2>&1 | tee ../output-make
make -j "$(nproc)" 2>&1 | tee ../output-make
cd ..
grep Warning output-configure output-make > ./report-test4
grep Error output-configure output-make >> ./report-test4
@ -150,7 +150,7 @@ print_title "${arr[5]}"
cd firejail || exit 1
make distclean
./configure --prefix=/usr --disable-userns --enable-fatal-warnings 2>&1 | tee ../output-configure
make -j4 2>&1 | tee ../output-make
make -j "$(nproc)" 2>&1 | tee ../output-make
cd ..
grep Warning output-configure output-make > ./report-test5
grep Error output-configure output-make >> ./report-test5
@ -168,7 +168,7 @@ print_title "${arr[6]}"
cd firejail || exit 1
make distclean
./configure --prefix=/usr --disable-network --enable-fatal-warnings 2>&1 | tee ../output-configure
make -j4 2>&1 | tee ../output-make
make -j "$(nproc)" 2>&1 | tee ../output-make
cd ..
grep Warning output-configure output-make > ./report-test6
grep Error output-configure output-make >> ./report-test6
@ -185,7 +185,7 @@ print_title "${arr[7]}"
cd firejail || exit 1
make distclean
./configure --prefix=/usr --disable-x11 --enable-fatal-warnings 2>&1 | tee ../output-configure
make -j4 2>&1 | tee ../output-make
make -j "$(nproc)" 2>&1 | tee ../output-make
cd ..
grep Warning output-configure output-make > ./report-test7
grep Error output-configure output-make >> ./report-test7
@ -202,7 +202,7 @@ print_title "${arr[8]}"
cd firejail || exit 1
make distclean
./configure --prefix=/usr --enable-selinux --enable-fatal-warnings 2>&1 | tee ../output-configure
make -j4 2>&1 | tee ../output-make
make -j "$(nproc)" 2>&1 | tee ../output-make
cd ..
grep Warning output-configure output-make > ./report-test8
grep Error output-configure output-make >> ./report-test8
@ -219,7 +219,7 @@ print_title "${arr[9]}"
cd firejail || exit 1
make distclean
./configure --prefix=/usr --disable-file-transfer --enable-fatal-warnings 2>&1 | tee ../output-configure
make -j4 2>&1 | tee ../output-make
make -j "$(nproc)" 2>&1 | tee ../output-make
cd ..
grep Warning output-configure output-make > ./report-test9
grep Error output-configure output-make >> ./report-test9
@ -236,7 +236,7 @@ print_title "${arr[10]}"
cd firejail || exit 1
make distclean
./configure --prefix=/usr --disable-whitelist --enable-fatal-warnings 2>&1 | tee ../output-configure
make -j4 2>&1 | tee ../output-make
make -j "$(nproc)" 2>&1 | tee ../output-make
cd ..
grep Warning output-configure output-make > ./report-test10
grep Error output-configure output-make >> ./report-test10
@ -253,7 +253,7 @@ print_title "${arr[11]}"
cd firejail || exit 1
make distclean
./configure --prefix=/usr --disable-globalcfg --enable-fatal-warnings 2>&1 | tee ../output-configure
make -j4 2>&1 | tee ../output-make
make -j "$(nproc)" 2>&1 | tee ../output-make
cd ..
grep Warning output-configure output-make > ./report-test11
grep Error output-configure output-make >> ./report-test11
@ -270,7 +270,7 @@ print_title "${arr[12]}"
cd firejail || exit 1
make distclean
./configure --prefix=/usr --enable-apparmor --enable-fatal-warnings 2>&1 | tee ../output-configure
make -j4 2>&1 | tee ../output-make
make -j "$(nproc)" 2>&1 | tee ../output-make
cd ..
grep Warning output-configure output-make > ./report-test12
grep Error output-configure output-make >> ./report-test12
@ -287,7 +287,7 @@ print_title "${arr[13]}"
cd firejail || exit 1
make distclean
./configure --prefix=/usr --enable-busybox-workaround --enable-fatal-warnings 2>&1 | tee ../output-configure
make -j4 2>&1 | tee ../output-make
make -j "$(nproc)" 2>&1 | tee ../output-make
cd ..
grep Warning output-configure output-make > ./report-test13
grep Error output-configure output-make >> ./report-test13
@ -304,7 +304,7 @@ print_title "${arr[14]}"
cd firejail || exit 1
make distclean
./configure --prefix=/usr --disable-overlayfs --enable-fatal-warnings 2>&1 | tee ../output-configure
make -j4 2>&1 | tee ../output-make
make -j "$(nproc)" 2>&1 | tee ../output-make
cd ..
grep Warning output-configure output-make > ./report-test14
grep Error output-configure output-make >> ./report-test14
@ -321,7 +321,7 @@ print_title "${arr[15]}"
cd firejail || exit 1
make distclean
./configure --prefix=/usr --disable-private-home --enable-fatal-warnings 2>&1 | tee ../output-configure
make -j4 2>&1 | tee ../output-make
make -j "$(nproc)" 2>&1 | tee ../output-make
cd ..
grep Warning output-configure output-make > ./report-test15
grep Error output-configure output-make >> ./report-test15
@ -338,7 +338,7 @@ print_title "${arr[16]}"
cd firejail || exit 1
make distclean
./configure --prefix=/usr --disable-man --enable-fatal-warnings 2>&1 | tee ../output-configure
make -j4 2>&1 | tee ../output-make
make -j "$(nproc)" 2>&1 | tee ../output-make
cd ..
grep Warning output-configure output-make > ./report-test16
grep Error output-configure output-make >> ./report-test16
@ -355,7 +355,7 @@ print_title "${arr[17]}"
cd firejail || exit 1
make distclean
./configure --prefix=/usr --disable-usertmpfs --enable-fatal-warnings 2>&1 | tee ../output-configure
make -j4 2>&1 | tee ../output-make
make -j "$(nproc)" 2>&1 | tee ../output-make
cd ..
grep Warning output-configure output-make > ./report-test17
grep Error output-configure output-make >> ./report-test17
@ -372,7 +372,7 @@ print_title "${arr[18]}"
cd firejail || exit 1
make distclean
./configure --prefix=/usr --disable-private-home --enable-fatal-warnings 2>&1 | tee ../output-configure
make -j4 2>&1 | tee ../output-make
make -j "$(nproc)" 2>&1 | tee ../output-make
cd ..
grep Warning output-configure output-make > ./report-test18
grep Error output-configure output-make >> ./report-test18
@ -389,7 +389,7 @@ print_title "${arr[19]}"
cd firejail || exit 1
make distclean
./configure --prefix=/usr --enable-ids --enable-fatal-warnings 2>&1 | tee ../output-configure
make -j4 2>&1 | tee ../output-make
make -j "$(nproc)" 2>&1 | tee ../output-make
cd ..
grep Warning output-configure output-make > ./report-test19
grep Error output-configure output-make >> ./report-test19