-
Notifications
You must be signed in to change notification settings - Fork 13
/
yosys.sh
executable file
·51 lines (40 loc) · 1.03 KB
/
yosys.sh
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
49
50
51
#!/usr/bin/env bash
PYTHONVERSION=$(python3 --version 2>&1 | egrep -o '3\.[0-9]+')
pushd `dirname $0` > /dev/null
DIR=`pwd -P`
popd > /dev/null
UNAME_STR=`uname`
if [ ! -d $DIR/yosys ]; then
echo "Checking out yosys..."
git clone https://github.com/cliffordwolf/yosys.git $DIR/yosys
else
cd $DIR/yosys
echo "Updating yosys..."
git pull origin master || exit 1
fi
cd $DIR/yosys
if [[ "$UNAME_STR" == "Darwin" ]]; then
OLDPATH=$PATH
PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"
fi
make clean
if [[ ! `uname -a` == *"raspberrypi"* ]]; then
echo "Building yosys-abc..."
uname -a
make yosys-abc
fi
echo "Building yosys..."
if [[ "$UNAME_STR" == "Darwin" ]] && hash brew 2>/dev/null; then
PYTHONPATH=$(brew --prefix)/lib/python$PYTHONVERSION/site-packages/ make
else
make
fi
echo "Installing yosys..."
if [[ "$UNAME_STR" == "Darwin" ]] && hash brew 2>/dev/null; then
PYTHONPATH=$(brew --prefix)/lib/python$PYTHONVERSION/site-packages/ make install
else
sudo make install
fi
if [[ "$UNAME_STR" == "Darwin" ]]; then
PATH=$OLDPATH
fi