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

Subversion Repositories minsoc

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

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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