osmith has submitted this change. (
https://gerrit.osmocom.org/c/osmo-dev/+/35112?usp=email )
Change subject: gen_makefile: don't shell out to nproc
......................................................................
gen_makefile: don't shell out to nproc
Use python's multiprocessing.cpu_count() instead of "$(nproc)". The
latter didn't work properly in Makefiles, the right syntax would have
been "$(shell nproc)". Make didn't complain about it and assumed that we
want to use all CPUs with an empty argument "-j ", but meson doesn't
accept this syntax.
Change-Id: I58ca082339f3aff813f587f4c2be9c0951b9b2dd
---
M gen_makefile.py
1 file changed, 19 insertions(+), 1 deletion(-)
Approvals:
osmith: Looks good to me, approved; Verified
diff --git a/gen_makefile.py b/gen_makefile.py
index 9a8a5cf..7fc2bd2 100755
--- a/gen_makefile.py
+++ b/gen_makefile.py
@@ -49,6 +49,7 @@
import sys
import os
import argparse
+import multiprocessing
topdir = os.path.dirname(os.path.realpath(__file__))
all_deps_file = os.path.join(topdir, "all.deps")
@@ -85,7 +86,9 @@
parser.add_argument('-o', '--output', dest='output',
default='Makefile',
help='''Makefile filename (default: 'Makefile').''')
-parser.add_argument('-j', '--jobs', dest='jobs',
default='$(nproc)', nargs='?', const='$(nproc)',
+parser.add_argument('-j', '--jobs', dest='jobs', type=int,
+ default=multiprocessing.cpu_count(), nargs='?',
+ const=multiprocessing.cpu_count(),
help='''-j option to pass to 'make'.''')
parser.add_argument('-I', '--sudo-make-install',
dest='sudo_make_install',
--
To view, visit
https://gerrit.osmocom.org/c/osmo-dev/+/35112?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-Change-Id: I58ca082339f3aff813f587f4c2be9c0951b9b2dd
Gerrit-Change-Number: 35112
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: merged