Makefile中添加获取编译的任务数

本内容转自:https://blog.csdn.net/robertsong2004/article/details/39012455

1
2
3
4
5
6
7
8
9
10
11
12
#
# Do a parallel build with multiple jobs, based on the number of CPUs online
# in this system: 'make -j8' on a 8-CPU system, etc.
#
# (To override it, run 'make JOBS=1' and similar.)
#
ifeq ($(JOBS),)
JOBS := $(shell grep -c ^processor /proc/cpuinfo 2>/dev/null)
ifeq ($(JOBS),)
JOBS := 1
endif
endif

Title:Makefile中添加获取编译的任务数

Author:Victor Huang

Time:2019-06-08 / 13:06

Link:http://wowothink.com/bee61d9c/

License: Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)