2012-10-01 23:32:51 +07:00
|
|
|
#
|
2013-10-02 16:49:08 +07:00
|
|
|
# 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.
|
2013-01-28 08:51:22 +07:00
|
|
|
#
|
2013-10-02 16:49:08 +07:00
|
|
|
# (To override it, run 'make JOBS=1' and similar.)
|
2013-05-24 19:35:24 +07:00
|
|
|
#
|
2013-10-02 16:49:08 +07:00
|
|
|
ifeq ($(JOBS),)
|
|
|
|
JOBS := $(shell grep -c ^processor /proc/cpuinfo 2>/dev/null)
|
|
|
|
ifeq ($(JOBS),)
|
|
|
|
JOBS := 1
|
2013-04-15 09:06:58 +07:00
|
|
|
endif
|
2012-08-07 20:20:43 +07:00
|
|
|
endif
|
2010-08-21 07:38:20 +07:00
|
|
|
|
2013-10-02 16:49:08 +07:00
|
|
|
export JOBS
|
2010-08-11 01:37:34 +07:00
|
|
|
|
2013-10-02 16:49:08 +07:00
|
|
|
$(info $(shell printf '# [ perf build: Doing '\''make \033[33m-j'$(JOBS)'\033[m'\'' parallel build. ]\n'))
|
2009-04-20 18:32:07 +07:00
|
|
|
|
2013-10-02 14:43:23 +07:00
|
|
|
#
|
2013-10-02 16:49:08 +07:00
|
|
|
# Needed if no target specified:
|
2013-10-02 14:43:23 +07:00
|
|
|
#
|
2013-10-02 16:49:08 +07:00
|
|
|
all:
|
|
|
|
@$(MAKE) -f Makefile.perf --no-print-directory -j$(JOBS) $@
|
2013-10-01 21:28:09 +07:00
|
|
|
|
2013-10-02 16:49:08 +07:00
|
|
|
%:
|
|
|
|
@$(MAKE) -f Makefile.perf --no-print-directory -j$(JOBS) $@
|