Skip to content

Commit

Permalink
build: standardize parallel make arguments
Browse files Browse the repository at this point in the history
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 500d8f2 ("ci: run make in parallel where
applicable", 2023-08-14) / PR #5960.
  • Loading branch information
kmk3 committed Feb 29, 2024
1 parent c57e63b commit 58733d5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion gcov.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mkdeb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/tools/mkcoverit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
38 changes: 19 additions & 19 deletions test/compile/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 58733d5

Please sign in to comment.