summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorKatze Miau <miaukatzemiau@priveasy.de>2011-11-29 20:05:01 (GMT)
committerKatze Miau <miaukatzemiau@priveasy.de>2011-11-29 20:05:01 (GMT)
commite0a22e2ed3fbd278abc50a1d93856b7b8ac7c4b1 (patch)
treef8c41cc47b993213666a221f82345dc299c50711 /Makefile
parent653807779fa99c203f8c181444ee310e3a22400c (diff)
parent68ed1c8254613b8a4958cc9e8b80cae500f60179 (diff)
Merge branch 'master' of git.freifunk-jena.de:freifunk/ffj-buildroot-v2HEADmaster
Conflicts: Makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 20 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index a2f6104..051ff5c 100644
--- a/Makefile
+++ b/Makefile
@@ -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)/ $@/
contact: Jan Huwald // Impressum