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

Subversion Repositories minsoc

[/] [minsoc/] [branches/] [rc-1.0/] [prj/] [scripts/] [xilinxprj.sh] - Blame information for rev 127

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

Line No. Rev Author Line
1 85 rfajardo
#!/bin/bash
2
 
3
#system workings
4
MINSOC_DIR=`pwd`/..
5
 
6
PROJECT=$1
7
SRC_OUTPUT=$2
8
TOP_MODULE=$3
9
 
10 108 rfajardo
ENV=`uname -o`
11
 
12
function adaptpath
13
{
14
    if [ "$ENV" == "Cygwin" ]
15
    then
16
        local cygpath=`cygpath -w $1`
17
        echo "$cygpath"
18
    else
19
        echo "$1"
20
    fi
21
}
22
 
23 85 rfajardo
if [ ! -f $PROJECT ]
24
then
25
    echo "Unexistent project file."
26
    exit 1
27
fi
28
 
29
if [ -z "$SRC_OUTPUT" ]
30
then
31
    echo "Third argument should be the destintion file for the source inclusions."
32
    exit 1
33
fi
34 88 rfajardo
echo -n "" > $SRC_OUTPUT
35 85 rfajardo
 
36
source $PROJECT
37
 
38
for file in "${PROJECT_SRC[@]}"
39
do
40
    FOUND=0
41
 
42
    for dir in "${PROJECT_DIR[@]}"
43
    do
44
        if [ -f $MINSOC_DIR/$dir/$file ]
45
        then
46 108 rfajardo
            adapted_file=`adaptpath $MINSOC_DIR/$dir/$file`
47 85 rfajardo
            echo -n '`include "' >> $SRC_OUTPUT
48 108 rfajardo
            echo -n "$adapted_file" >> $SRC_OUTPUT
49 85 rfajardo
            echo '"' >> $SRC_OUTPUT
50
            FOUND=1
51 91 rfajardo
            break
52 85 rfajardo
        fi
53
    done
54
 
55
    if [ $FOUND != 1 ]
56
    then
57 110 rfajardo
        echo "FILE NOT FOUND: $file"
58 85 rfajardo
        exit 1
59
    fi
60
done
61
 
62
if [ -n "$TOP_MODULE" ]
63
then
64
    for file in src/blackboxes/*.v
65
    do
66 108 rfajardo
        dir=`pwd`
67
        adapted_file=`adaptpath $dir/$file`
68 85 rfajardo
        echo -n '`include "' >> $SRC_OUTPUT
69 108 rfajardo
        echo -n "$adapted_file" >> $SRC_OUTPUT
70 85 rfajardo
        echo '"' >> $SRC_OUTPUT
71
    done
72
fi

powered by: WebSVN 2.1.0

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