build.sh
author Ryan C. Gordon <icculus@icculus.org>
Sun, 18 Jun 2017 01:57:23 -0400
changeset 55 0aaf56a96d21
parent 23 a5c3269e6d99
permissions -rwxr-xr-x
Added initial code for producing time-based One Time Passwords.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
23
a5c3269e6d99 Make build.sh a bit more robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 21
diff changeset
     1
#!/bin/bash
21
9884f4078c68 Build on Ubuntu 12.04, fix some crash problems
Robbie Vanbrabant <robbie.vanbrabant@gmail.com>
parents:
diff changeset
     2
#
9884f4078c68 Build on Ubuntu 12.04, fix some crash problems
Robbie Vanbrabant <robbie.vanbrabant@gmail.com>
parents:
diff changeset
     3
# Need to install the following on Ubuntu 12.04:
9884f4078c68 Build on Ubuntu 12.04, fix some crash problems
Robbie Vanbrabant <robbie.vanbrabant@gmail.com>
parents:
diff changeset
     4
# - cmake
9884f4078c68 Build on Ubuntu 12.04, fix some crash problems
Robbie Vanbrabant <robbie.vanbrabant@gmail.com>
parents:
diff changeset
     5
# - libgtk2.0-dev
9884f4078c68 Build on Ubuntu 12.04, fix some crash problems
Robbie Vanbrabant <robbie.vanbrabant@gmail.com>
parents:
diff changeset
     6
# - libxtst-dev
9884f4078c68 Build on Ubuntu 12.04, fix some crash problems
Robbie Vanbrabant <robbie.vanbrabant@gmail.com>
parents:
diff changeset
     7
#
9884f4078c68 Build on Ubuntu 12.04, fix some crash problems
Robbie Vanbrabant <robbie.vanbrabant@gmail.com>
parents:
diff changeset
     8
# If you find other deps, add them here
9884f4078c68 Build on Ubuntu 12.04, fix some crash problems
Robbie Vanbrabant <robbie.vanbrabant@gmail.com>
parents:
diff changeset
     9
23
a5c3269e6d99 Make build.sh a bit more robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 21
diff changeset
    10
NCPU=`cat /proc/cpuinfo |grep vendor_id |wc -l`
a5c3269e6d99 Make build.sh a bit more robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 21
diff changeset
    11
let NCPU=$NCPU+2
a5c3269e6d99 Make build.sh a bit more robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 21
diff changeset
    12
echo "Will build with 'make -j$NCPU' ... please edit this script if incorrect."
a5c3269e6d99 Make build.sh a bit more robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 21
diff changeset
    13
a5c3269e6d99 Make build.sh a bit more robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 21
diff changeset
    14
set -x
a5c3269e6d99 Make build.sh a bit more robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 21
diff changeset
    15
rm -rf cmake-build
a5c3269e6d99 Make build.sh a bit more robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 21
diff changeset
    16
mkdir -p cmake-build
a5c3269e6d99 Make build.sh a bit more robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 21
diff changeset
    17
cd $_
a5c3269e6d99 Make build.sh a bit more robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 21
diff changeset
    18
cmake -DCMAKE_BUILD_TYPE=Release ..
a5c3269e6d99 Make build.sh a bit more robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 21
diff changeset
    19
make -j$NCPU && cp -a 1pass ..
a5c3269e6d99 Make build.sh a bit more robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 21
diff changeset
    20
cd ..
a5c3269e6d99 Make build.sh a bit more robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 21
diff changeset
    21