From f226581654b964ddcbbf0bfa0dd248e2fe7650b6 Mon Sep 17 00:00:00 2001
From: jbono <joan.bono@accenture.com>
Date: Fri, 17 Aug 2018 11:30:45 +0200
Subject: [PATCH] Improved install.sh to work in Ubuntu 18.04 and using max
 processors availables for compiling with make

---
 install.sh | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/install.sh b/install.sh
index a3b6cede5..27e191a44 100755
--- a/install.sh
+++ b/install.sh
@@ -11,6 +11,12 @@ function installProxmark_Linux {
   sudo apt-get autoclean -y
   sudo apt-get clean -y
   sudo apt-get update
+
+  # Install libcanberragtk in Ubuntu 18.04
+  if [[ $(cat /etc/issue | awk '{print $2}') = *"18.04"* ]]; then 
+    apt-get install libcanberra-gtk-module
+  fi
+
 # install RDV40 - proxmark3
   git clone https://github.com/RfidResearchGroup/proxmark3.git
   (
@@ -18,7 +24,7 @@ function installProxmark_Linux {
       git reset --hard
       git clean -dfx
       make clean
-      make all
+      make -j$(nproc) all 
       # Copy blacklist rules into /etc/udev/rules.d
       # check the Makefile for details
       sudo make udev
@@ -46,7 +52,7 @@ local qt5Core=$(find /usr -name Qt5Core.pc 2>/dev/null)
         git reset --hard
         git clean -dfx
         make clean
-        make
+        make -j$(sysctl -n hw.physicalcpu)
       )
   }
 # Where is my device?