File: make.sh

package info (click to toggle)
keysmith 25.08.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,276 kB
  • sloc: cpp: 11,649; xml: 352; sh: 121; makefile: 3
file content (23 lines) | stat: -rwxr-xr-x 465 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
#
# SPDX-License-Identifier: BSD-2-Clause
# SPDX-FileCopyrightText: 2020 Johan Ouwerkerk <jm.ouwerkerk@gmail.com>
#

set -e

#
# Try to speed up builds by using parallel make. Assume that if MAKEFLAGS
# is set, someone is trying to control make behaviour explicitly and do not
# second-guess that.
#
if [ -z "$MAKEFLAGS" ]
then
    cores="$(nproc --all)"
    jobs="$(($cores * 5 / 4))"
    set -x
    make -j "$jobs" "$@"
else
    set -x
    make "$@"
fi