make: Fix parallel building with some container platforms (VPP-880) 49/7149/4
authorChris Luke <chrisy@flirble.org>
Wed, 14 Jun 2017 15:24:41 +0000 (11:24 -0400)
committerDamjan Marion <dmarion.lists@gmail.com>
Sat, 24 Jun 2017 14:02:37 +0000 (14:02 +0000)
commitb2861e8fb6855e9924887e5743d65ebbfbc6d7d2
treeaf67c38e890d6479172e5b9b4efe1c333d145cfd
parent9f5a2b6310ce5c8e59c32ca6f27d8a187b0e4346
make: Fix parallel building with some container platforms (VPP-880)

With some Linux container platforms /proc/cpuinfo reads as an empty
file. (Aside: stat on /proc/cpuinfo always indicates a length of
zero bytes, regardless of its content).

This has the effect that the make '-j' parameter being passed the
unhelpful value of '0' both in build-root/Makefile and dpdk/Makefile.
Make complains with the error:

  make: the '-j' option requires a positive integer argument

This patch checks for '0' and replaces it with '2' as a reasonable
number of jobs to run in parallel when the CPU count isn't known
(and assumed to be one). It also makes the value determination
consistent between VPP and DPDK (2*ncpu).

Change-Id: I78b89420114a825fab4d339e4f9291d486b7b9c8
Signed-off-by: Chris Luke <chrisy@flirble.org>
build-root/Makefile
dpdk/Makefile