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

Subversion Repositories minsoc

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

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 43 ConX.
DIR_TO_INSTALL="/home/conx/Thesis/tmp/"
11 41 rfajardo
 
12 43 ConX.
# This variable should be set to trunk
13
# or to stable.
14
VERSION="trunk"
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
ENV="linux"
20
 
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 43 ConX.
cd ../../sw/utils
90 41 rfajardo
 
91
execcmd "Make utils" "make"
92
 
93
cd ../support
94
 
95
execcmd "Make support tools" "make"
96
 
97
cd ../drivers
98
 
99
execcmd "Make drivers" "make"
100
 
101
cd ../gpio
102
 
103
execcmd "Make GPIO" "make"
104
 
105
cd ../uart
106
 
107
execcmd "Make UART" "make"
108
 
109 43 ConX.
# adv_jtag_bridge install
110 41 rfajardo
cd ${DIR_TO_INSTALL}/minsoc/rtl/verilog/adv_debug_sys/Software/adv_jtag_bridge
111
 
112 43 ConX.
#cecho "Installing FTDI headers! You will be asked to give root pass"
113 41 rfajardo
 
114 43 ConX.
#execcmd "Install FTDI headers" "su -c \"aptitude install libftdi-dev\""; #FIXME
115 41 rfajardo
 
116 43 ConX.
if [ `grep "INCLUDE_JSP_SERVER=true" Makefile` != "" ]
117
then
118
        cecho "Switching off the adv_jtag_bridge JSP_SERVER option";
119
        sed 's/INCLUDE_JSP_SERVER=true/INCLUDE_JSP_SERVER=false/' Makefile > TMPFILE && mv TMPFILE Makefile
120
fi
121
 
122
if [ $ENV != "cygwin" ]
123
then
124
        cecho "Setting the right build environment";
125
        sed "s/BUILD_ENVIRONMENT=cygwin/BUILD_ENVIRONMENT=${ENV}/" Makefile > TMPFILE && mv TMPFILE Makefile
126
fi
127
 
128 41 rfajardo
execcmd "Make adv_jtag_bridge" "make"
129
 
130
cecho "Installation Finised"

powered by: WebSVN 2.1.0

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