OpenCores
URL https://opencores.org/ocsvn/usb_ft232h_avalon-mm_interface/usb_ft232h_avalon-mm_interface/trunk

Subversion Repositories usb_ft232h_avalon-mm_interface

[/] [usb_ft232h_avalon-mm_interface/] [trunk/] [testbench/] [altera_project/] [test_usb_ft232h/] [software/] [usb_ft232h/] [create-this-app] - Blame information for rev 6

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 6 melman701
#!/bin/bash
2
#
3
# This script creates the blank_project application in this directory.
4
 
5
 
6
BSP_DIR=../usb_ft232h_bsp
7
QUARTUS_PROJECT_DIR=../../
8
NIOS2_APP_GEN_ARGS="--elf-name usb_ft232h.elf --no-src --set OBJDUMP_INCLUDE_SOURCE 1"
9
 
10
 
11
# First, check to see if $SOPC_KIT_NIOS2 environmental variable is set.
12
# This variable is required for the command line tools to execute correctly.
13
if [ -z "${SOPC_KIT_NIOS2}" ]
14
then
15
    echo Required \$SOPC_KIT_NIOS2 Environmental Variable is not set!
16
    exit 1
17
fi
18
 
19
 
20
# Also make sure that the APP has not been created already.  Check for
21
# existence of Makefile in the app directory
22
if [ -f ./Makefile ]
23
then
24
    echo Application has already been created!  Delete Makefile if you want to create a new application makefile
25
    exit 1
26
fi
27
 
28
 
29
# We are selecting hal_default bsp because it supports this application.
30
# Check to see if the hal_default has already been generated by checking for
31
# existence of the public.mk file.  If not, we need to run
32
# create-this-bsp file to generate the bsp.
33
if [ ! -f ${BSP_DIR}/public.mk ]; then
34
    # Since BSP doesn't exist, create the BSP
35
    # Pass any command line arguments passed to this script to the BSP.
36
    pushd ${BSP_DIR} >> /dev/null
37
    ./create-this-bsp "$@" || {
38
        echo "create-this-bsp failed"
39
        exit 1
40
    }
41
    popd >> /dev/null
42
fi
43
 
44
 
45
# Don't run make if create-this-app script is called with --no-make arg
46
SKIP_MAKE=
47
while [ $# -gt 0 ]
48
do
49
  case "$1" in
50
      --no-make)
51
          SKIP_MAKE=1
52
          ;;
53
  esac
54
  shift
55
done
56
 
57
 
58
# Now we also need to go copy the sources for this application to the
59
# local directory.
60
find "${SOPC_KIT_NIOS2}/examples/software/blank_project/" -name '*.c' -or -name '*.h' -or -name 'hostfs*' | xargs -i cp -L {} ./ || {
61
        echo "failed during copying example source files"
62
        exit 1
63
}
64
 
65
find "${SOPC_KIT_NIOS2}/examples/software/blank_project/" -name 'readme.txt' -or -name 'Readme.txt' | xargs -i cp -L {} ./ || {
66
        echo "failed copying readme file"
67
}
68
 
69
if [ -d "${SOPC_KIT_NIOS2}/examples/software/blank_project/system" ]
70
then
71
        cp -RL "${SOPC_KIT_NIOS2}/examples/software/blank_project/system" . || {
72
                echo "failed during copying project support files"
73
                exit 1
74
        }
75
fi
76
 
77
chmod -R +w . || {
78
        echo "failed during changing file permissions"
79
        exit 1
80
}
81
 
82
cmd="nios2-app-generate-makefile --bsp-dir ${BSP_DIR} --set QUARTUS_PROJECT_DIR=${QUARTUS_PROJECT_DIR} ${NIOS2_APP_GEN_ARGS}"
83
 
84
echo "create-this-app: Running \"${cmd}\""
85
$cmd || {
86
    echo "nios2-app-generate-makefile failed"
87
    exit 1
88
}
89
 
90
if [ -z "$SKIP_MAKE" ]; then
91
        cmd="make"
92
 
93
        echo "create-this-app: Running \"$cmd\""
94
        $cmd || {
95
        echo "make failed"
96
            exit 1
97
        }
98
 
99
        echo
100
        echo "To download and run the application:"
101
        echo "    1. Make sure the board is connected to the system."
102
        echo "    2. Run 'nios2-configure-sof ' to configure the FPGA with the hardware design."
103
        echo "    3. If you have a stdio device, run 'nios2-terminal' in a different shell."
104
        echo "    4. Run 'make download-elf' from the application directory."
105
        echo
106
        echo "To debug the application:"
107
        echo "    Import the project into Nios II Software Build Tools for Eclipse."
108
        echo "    Refer to Nios II Software Build Tools for Eclipse Documentation for more information."
109
        echo
110
        echo -e ""
111
fi
112
 
113
 
114
exit 0

powered by: WebSVN 2.1.0

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