blob: ce7874b73dd9929499084e020cf77fd8097b4aa1 [file] [log] [blame]
Ingo Molnard24e4732009-04-20 13:32:07 +02001#
Ingo Molnarbd69cc22013-10-02 11:49:08 +02002# Do a parallel build with multiple jobs, based on the number of CPUs online
3# in this system: 'make -j8' on a 8-CPU system, etc.
Namhyung Kim67cbbd72012-02-23 16:08:14 +09004#
Ingo Molnarbd69cc22013-10-02 11:49:08 +02005# (To override it, run 'make JOBS=1' and similar.)
Namhyung Kim67cbbd72012-02-23 16:08:14 +09006#
Ingo Molnarbd69cc22013-10-02 11:49:08 +02007ifeq ($(JOBS),)
8 JOBS := $(shell grep -c ^processor /proc/cpuinfo 2>/dev/null)
9 ifeq ($(JOBS),)
10 JOBS := 1
Jiri Olsa8e1b3f62013-04-15 04:06:58 +020011 endif
Jiri Olsa2bcd3552012-08-07 15:20:43 +020012endif
Kirill A. Shutemovf4e7ac02010-08-21 03:38:20 +030013
Ingo Molnarbd69cc22013-10-02 11:49:08 +020014export JOBS
Peter Hurley79d824e2013-01-27 20:51:22 -050015
Ingo Molnarbd69cc22013-10-02 11:49:08 +020016$(info $(shell printf '# [ perf build: Doing '\''make \033[33m-j'$(JOBS)'\033[m'\'' parallel build. ]\n'))
Ingo Molnard24e4732009-04-20 13:32:07 +020017
Ingo Molnarde0f03f2013-10-02 09:43:23 +020018#
Ingo Molnarbd69cc22013-10-02 11:49:08 +020019# Needed if no target specified:
Ingo Molnarde0f03f2013-10-02 09:43:23 +020020#
Ingo Molnarbd69cc22013-10-02 11:49:08 +020021all:
22 @$(MAKE) -f Makefile.perf --no-print-directory -j$(JOBS) $@
Ingo Molnarde0f03f2013-10-02 09:43:23 +020023
Ingo Molnarbd69cc22013-10-02 11:49:08 +020024%:
25 @$(MAKE) -f Makefile.perf --no-print-directory -j$(JOBS) $@