forked from AlterCodex/nxppy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_nxpRdLib.sh
More file actions
executable file
·49 lines (40 loc) · 851 Bytes
/
get_nxpRdLib.sh
File metadata and controls
executable file
·49 lines (40 loc) · 851 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
blue='\033[0;34m'
NC='\033[0m' # No Color
prereq() {
PREREQS="build-essential cmake $1"
if dpkg -s $PREREQS > /dev/null 2>&1; then
echo -e "Prerequisites already installed: $PREREQS"
else
echo -e "[${blue}Installing prerequisites${NC}]"
sudo apt-get update
sudo apt-get -y install $PREREQS
fi
}
nxp() {
if [[ -d "nxp" ]]; then
echo -e "NXP Reader Library found, skipping download"
else
echo -e "[${blue}Downloading NXP Reader Library${NC}]"
wget https://nxp.box.com/shared/static/xxuwpzh2ztl63b8ujsclg5wqsmlxfmw1.zip -O nxp.zip
unzip -q -o -d nxp nxp.zip
rm nxp.zip
fi
pushd nxp/build > /dev/null
cmake ..
make NxpRdLibLinuxPN512
popd > /dev/null
}
cleanup() {
rm -rf *.zip *.gz *.deb
}
all() {
prereq $@
nxp
cleanup
}
if [[ $# -eq 0 ]]; then
all
else
$@
fi