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

Subversion Repositories minsoc

[/] [minsoc/] [trunk/] [utils/] [contributions/] [setup/] [minsoc-install.sh] - Diff between revs 44 and 45

Show entire file | Details | Blame | View Log

Rev 44 Rev 45
Line 1... Line 1...
#!/bin/bash
#!/bin/bash
# Xanthopoulos Constantinos
# Author: Constantinos Xanthopoulos
 
# This script install MinSOC tree
 
# under a specific directory.
 
 
# ===== CONFIGURATIONS =====
# ===== CONFIGURATIONS =====
# ==========================
# ==========================
 
 
# Where should I put the dir. minsoc?
# Where should I put the dir. minsoc?
Line 25... Line 26...
# ===================
# ===================
 
 
# Debug ?
# Debug ?
export DEBUG=0;
export DEBUG=0;
. beautify.sh
. beautify.sh
. func.sh
 
 
 
# User check!
# User check!
if [ `whoami` == "root" ];
if [ `whoami` = "root" ];
then
then
        errormsg "You shouldn't be root for this script to run.";
        errormsg "You shouldn't be root for this script to run.";
fi;
fi;
 
 
# Wizard
# Wizard
if [ $DIR_TO_INSTALL == "" ]
if [ -z ${DIR_TO_INSTALL} ]
then
then
        read $DIR_TO_INSTALL;
        cnecho "Give full path (ex. /home/foo/): ";
 
        read DIR_TO_INSTALL;
fi
fi
 
 
# Directory exists?
# Directory exists?
if [ ! -d $DIR_TO_INSTALL ]
if [ ! -d ${DIR_TO_INSTALL} ]
then
then
        errormsg "Directory doesn't exist. Please create it";
        errormsg "Directory doesn't exist. Please create it";
fi;
fi;
 
 
cd $DIR_TO_INSTALL
cd ${DIR_TO_INSTALL}
 
 
 
 
if [ $VERSION == "" ]
# Which Version?
 
if [ -z ${VERSION} ]
then
then
        while [ $VERSION != "trunk" -a $VERSION != "stable"]
        while [ "$VERSION" != "trunk" -a   "$VERSION" != "stable" ]
        do
        do
                cecho "Which version you want to install [stable/trunk]?"
                cnecho "Select MinSOC Version [stable/trunk]: "
                read $VERSION;
                read VERSION;
        done
        done
fi
fi
 
 
if [ $ENV == "" ]
if [ -z ${ENV} ]
then
then
        while [ $ENV != "linux" -a $ENV != "cygwin" -a $ENV != "freebsd" ]
        while [ "$ENV" != "linux" -a "$ENV" != "cygwin" -a "$ENV" != "freebsd" ]
        do
        do
                cecho "In which environement are you installing MinSOC [linux/cygwin/freebsd]?"
                cnecho "Select build environment [linux/cygwin/freebsd]: "
                read $ENV;
                read ENV;
        done
        done
fi
fi
 
 
 
 
 
 
# Checkout MinSOC
# Checkout MinSOC
if [ $VERSION == "trunk" ]
if [ "${VERSION}" = "trunk" ]
then
then
        execcmd "Download minsoc" "svn co -q http://opencores.org/ocsvn/minsoc/minsoc/trunk/ minsoc"
        execcmd "Download minsoc" "svn co -q http://opencores.org/ocsvn/minsoc/minsoc/trunk/ minsoc"
else
else
        execcmd "Download minsoc" "svn co -q http://opencores.org/ocsvn/minsoc/minsoc/tags/release-0.9/ minsoc"
        execcmd "Download minsoc" "svn co -q http://opencores.org/ocsvn/minsoc/minsoc/tags/release-0.9/ minsoc"
fi
fi
Line 84... Line 86...
execcmd "Checkout openrisc" "svn co -q  http://opencores.org/ocsvn/openrisc/openrisc/trunk/or1200 or1200"
execcmd "Checkout openrisc" "svn co -q  http://opencores.org/ocsvn/openrisc/openrisc/trunk/or1200 or1200"
execcmd "Checkout uart" "svn co -q http://opencores.org/ocsvn/uart16550/uart16550/trunk uart16550"
execcmd "Checkout uart" "svn co -q http://opencores.org/ocsvn/uart16550/uart16550/trunk uart16550"
 
 
cecho "I will now start to compile everything that's needed";
cecho "I will now start to compile everything that's needed";
 
 
cd $DIR_TO_INSTALL/minsoc/sw/utils
cd ${DIR_TO_INSTALL}/minsoc/sw/utils
 
 
echo $PWD
echo $PWD
 
 
execcmd "Make utils" "make"
execcmd "Make utils" "make"
 
 
Line 106... Line 108...
execcmd "Make UART" "make"
execcmd "Make UART" "make"
 
 
# adv_jtag_bridge install
# adv_jtag_bridge install
cd ${DIR_TO_INSTALL}/minsoc/rtl/verilog/adv_debug_sys/Software/adv_jtag_bridge
cd ${DIR_TO_INSTALL}/minsoc/rtl/verilog/adv_debug_sys/Software/adv_jtag_bridge
 
 
cecho "Installing FTDI headers! You will be asked to give root pass"
# FIXME: install FTDI headers for all build environments
 
#cecho "Installing FTDI headers! You will be asked to give root pass"
 
 
execcmd "Install FTDI headers" "su -c \"aptitude install libftdi-dev\""; #FIXME
#execcmd "Install FTDI headers" "su -c \"aptitude install libftdi-dev\"";
 
 
if [ `grep "INCLUDE_JSP_SERVER=true" Makefile` != "" ]
if [ `grep "INCLUDE_JSP_SERVER=true" Makefile` != "" ]
then
then
        cecho "Switching off the adv_jtag_bridge JSP_SERVER option";
        cecho "Switching off the adv_jtag_bridge JSP_SERVER option";
        sed 's/INCLUDE_JSP_SERVER=true/INCLUDE_JSP_SERVER=false/' Makefile > TMPFILE && mv TMPFILE Makefile
        sed 's/INCLUDE_JSP_SERVER=true/INCLUDE_JSP_SERVER=false/' Makefile > TMPFILE && mv TMPFILE Makefile
fi
fi
 
 
if [ $ENV != "cygwin" ]
if [ "${ENV}" != "cygwin" ]
then
then
        cecho "Setting the right build environment";
        cecho "Setting the right build environment";
        sed "s/BUILD_ENVIRONMENT=cygwin/BUILD_ENVIRONMENT=${ENV}/" Makefile > TMPFILE && mv TMPFILE Makefile
        sed "s/BUILD_ENVIRONMENT=cygwin/BUILD_ENVIRONMENT=${ENV}/" Makefile > TMPFILE && mv TMPFILE Makefile
fi
fi
 
 

powered by: WebSVN 2.1.0

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