OpenCores
URL https://opencores.org/ocsvn/minsoc/minsoc/trunk

Subversion Repositories minsoc

[/] [minsoc/] [trunk/] [utils/] [contributions/] [setup/] [minsoc-install.sh] - Blame information for rev 44

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 41 rfajardo
#!/bin/bash
2
# Xanthopoulos Constantinos
3
 
4
 
5
# ===== CONFIGURATIONS =====
6
# ==========================
7
 
8
# Where should I put the dir. minsoc?
9
# ex. /home/conx/Thesis/
10 44 ConX.
DIR_TO_INSTALL=""
11 41 rfajardo
 
12 43 ConX.
# This variable should be set to trunk
13
# or to stable.
14 44 ConX.
VERSION=""
15 41 rfajardo
 
16 43 ConX.
# This variable should take one of
17
# the following values depending
18
# to your system: linux, cygwin, freebsd
19 44 ConX.
ENV=""
20 43 ConX.
 
21
# !!! DO NOT EDIT BELLOW THIS LINE !!!
22
# ===================================
23
 
24 41 rfajardo
# ===== SCRIPT ======
25
# ===================
26 43 ConX.
 
27
# Debug ?
28 41 rfajardo
export DEBUG=0;
29 43 ConX.
. beautify.sh
30
. func.sh
31 41 rfajardo
 
32 43 ConX.
# User check!
33 41 rfajardo
if [ `whoami` == "root" ];
34
then
35
        errormsg "You shouldn't be root for this script to run.";
36
fi;
37
 
38 43 ConX.
# Wizard
39
if [ $DIR_TO_INSTALL == "" ]
40
then
41
        read $DIR_TO_INSTALL;
42
fi
43
 
44
# Directory exists?
45 41 rfajardo
if [ ! -d $DIR_TO_INSTALL ]
46
then
47
        errormsg "Directory doesn't exist. Please create it";
48
fi;
49
 
50
cd $DIR_TO_INSTALL
51
 
52 43 ConX.
 
53
if [ $VERSION == "" ]
54 41 rfajardo
then
55 43 ConX.
        while [ $VERSION != "trunk" -a $VERSION != "stable"]
56
        do
57
                cecho "Which version you want to install [stable/trunk]?"
58
                read $VERSION;
59
        done
60 41 rfajardo
fi
61
 
62 43 ConX.
if [ $ENV == "" ]
63 41 rfajardo
then
64 43 ConX.
        while [ $ENV != "linux" -a $ENV != "cygwin" -a $ENV != "freebsd" ]
65
        do
66
                cecho "In which environement are you installing MinSOC [linux/cygwin/freebsd]?"
67
                read $ENV;
68
        done
69 41 rfajardo
fi
70
 
71
 
72 43 ConX.
# Checkout MinSOC
73
if [ $VERSION == "trunk" ]
74
then
75
        execcmd "Download minsoc" "svn co -q http://opencores.org/ocsvn/minsoc/minsoc/trunk/ minsoc"
76
else
77
        execcmd "Download minsoc" "svn co -q http://opencores.org/ocsvn/minsoc/minsoc/tags/release-0.9/ minsoc"
78
fi
79
 
80
cd minsoc/rtl/verilog
81
 
82
execcmd "Checkout adv_jtag_bridge" "svn co -q http://opencores.org/ocsvn/adv_debug_sys/adv_debug_sys/trunk adv_debug_sys"
83
execcmd "Checkout ethmac" "svn co -q http://opencores.org/ocsvn/ethmac/ethmac/trunk ethmac"
84
execcmd "Checkout openrisc" "svn co -q  http://opencores.org/ocsvn/openrisc/openrisc/trunk/or1200 or1200"
85
execcmd "Checkout uart" "svn co -q http://opencores.org/ocsvn/uart16550/uart16550/trunk uart16550"
86
 
87 41 rfajardo
cecho "I will now start to compile everything that's needed";
88
 
89 44 ConX.
cd $DIR_TO_INSTALL/minsoc/sw/utils
90 41 rfajardo
 
91 44 ConX.
echo $PWD
92
 
93 41 rfajardo
execcmd "Make utils" "make"
94
 
95
cd ../support
96
 
97
execcmd "Make support tools" "make"
98
 
99
cd ../drivers
100
 
101
execcmd "Make drivers" "make"
102
 
103
 
104
cd ../uart
105
 
106
execcmd "Make UART" "make"
107
 
108 43 ConX.
# adv_jtag_bridge install
109 41 rfajardo
cd ${DIR_TO_INSTALL}/minsoc/rtl/verilog/adv_debug_sys/Software/adv_jtag_bridge
110
 
111 44 ConX.
cecho "Installing FTDI headers! You will be asked to give root pass"
112 41 rfajardo
 
113 44 ConX.
execcmd "Install FTDI headers" "su -c \"aptitude install libftdi-dev\""; #FIXME
114 41 rfajardo
 
115 43 ConX.
if [ `grep "INCLUDE_JSP_SERVER=true" Makefile` != "" ]
116
then
117
        cecho "Switching off the adv_jtag_bridge JSP_SERVER option";
118
        sed 's/INCLUDE_JSP_SERVER=true/INCLUDE_JSP_SERVER=false/' Makefile > TMPFILE && mv TMPFILE Makefile
119
fi
120
 
121
if [ $ENV != "cygwin" ]
122
then
123
        cecho "Setting the right build environment";
124
        sed "s/BUILD_ENVIRONMENT=cygwin/BUILD_ENVIRONMENT=${ENV}/" Makefile > TMPFILE && mv TMPFILE Makefile
125
fi
126
 
127 41 rfajardo
execcmd "Make adv_jtag_bridge" "make"
128
 
129
cecho "Installation Finised"

powered by: WebSVN 2.1.0

© copyright 1999-2020 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.