Ingo Molnar | d24e473 | 2009-04-20 13:32:07 +0200 | [diff] [blame] | 1 | # |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame^] | 2 | # 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 Kim | 67cbbd7 | 2012-02-23 16:08:14 +0900 | [diff] [blame] | 4 | # |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame^] | 5 | # (To override it, run 'make JOBS=1' and similar.) |
Namhyung Kim | 67cbbd7 | 2012-02-23 16:08:14 +0900 | [diff] [blame] | 6 | # |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame^] | 7 | ifeq ($(JOBS),) |
8 | JOBS := $(shell grep -c ^processor /proc/cpuinfo 2>/dev/null) | ||||
9 | ifeq ($(JOBS),) | ||||
10 | JOBS := 1 | ||||
Jiri Olsa | 8e1b3f6 | 2013-04-15 04:06:58 +0200 | [diff] [blame] | 11 | endif |
Jiri Olsa | 2bcd355 | 2012-08-07 15:20:43 +0200 | [diff] [blame] | 12 | endif |
Kirill A. Shutemov | f4e7ac0 | 2010-08-21 03:38:20 +0300 | [diff] [blame] | 13 | |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame^] | 14 | export JOBS |
Peter Hurley | 79d824e | 2013-01-27 20:51:22 -0500 | [diff] [blame] | 15 | |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame^] | 16 | $(info $(shell printf '# [ perf build: Doing '\''make \033[33m-j'$(JOBS)'\033[m'\'' parallel build. ]\n')) |
Ingo Molnar | d24e473 | 2009-04-20 13:32:07 +0200 | [diff] [blame] | 17 | |
Ingo Molnar | de0f03f | 2013-10-02 09:43:23 +0200 | [diff] [blame] | 18 | # |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame^] | 19 | # Needed if no target specified: |
Ingo Molnar | de0f03f | 2013-10-02 09:43:23 +0200 | [diff] [blame] | 20 | # |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame^] | 21 | all: |
22 | @$(MAKE) -f Makefile.perf --no-print-directory -j$(JOBS) $@ | ||||
Ingo Molnar | de0f03f | 2013-10-02 09:43:23 +0200 | [diff] [blame] | 23 | |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame^] | 24 | %: |
25 | @$(MAKE) -f Makefile.perf --no-print-directory -j$(JOBS) $@ |