diff options
author | Katze Miau <miaukatzemiau@priveasy.de> | 2011-11-29 20:05:01 (GMT) |
---|---|---|
committer | Katze Miau <miaukatzemiau@priveasy.de> | 2011-11-29 20:05:01 (GMT) |
commit | e0a22e2ed3fbd278abc50a1d93856b7b8ac7c4b1 (patch) | |
tree | f8c41cc47b993213666a221f82345dc299c50711 | |
parent | 653807779fa99c203f8c181444ee310e3a22400c (diff) | |
parent | 68ed1c8254613b8a4958cc9e8b80cae500f60179 (diff) |
Conflicts:
Makefile
-rw-r--r-- | Makefile | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -1,3 +1,22 @@ +NUMPROC := 1 +OS := $(shell uname) +export NUMPROC + +ifeq ($(OS),Linux) + NUMPROC := $(shell grep -c ^processor /proc/cpuinfo) + +else ifeq ($(OS),Darwin) + NUMPROC := $(shell sysctl hw.ncpu | awk '{print $$2}') +endif + +# Always use # of processory plus 1 +NUMPROC:=$$((${NUMPROC}+1)) +NUMPROC:=$(shell echo ${NUMPROC}) + +ifeq ($(NUMPROC),0) + NUMPROC = 1 +endif + .NOTPARALLEL: openwrt/backfire/.repo_access: @@ -44,6 +63,6 @@ image/%: config/$$(REPO)-$$(PLATFORM)-$$(MODEL).config \ cp -a files/common openwrt/$(REPO)/files [ -d files/$(PLATFORM) ] && rsync -a files/$(PLATFORM)/ openwrt/$(REPO)/files/ [ -d files/$(PLATFORM)-$(MODEL) ] && rsync -a files/$(PLATFORM)-$(MODEL)/ openwrt/$(REPO)/files/ - cd openwrt/$(REPO) && $(MAKE) + cd openwrt/$(REPO) && $(MAKE) -j$(NUMPROC) mkdir -p $@ rsync -a openwrt/$(REPO)/bin/$(PLATFORM)/ $@/ |