Skip to content
Snippets Groups Projects
Commit 5ba0b13a authored by Pawel Szostek's avatar Pawel Szostek
Browse files

Added automatic conversion from relative to absolute paths

parent c323c631
Branches
Tags
No related merge requests found
#!/bin/bash
#script should be run by make
function usage() {
echo "Usage: $0 hdl_path scripts_path"
}
function abs_path() {
local cur_dir=$(pwd)
local D=$(dirname $1)
local B=$(basename $1)
(cd $D && echo $(pwd)"/$B") || exit 1
cd $cur_dir
}
##$1 is expected to be project path
if [ $# -lt 1 ]; then
echo "$0"': Argument expected'
echo "Usage: $0 project_path hdl_path"
if [ $# -ne 2 ]; then
echo "$0"': Exactly two arguments expected'
usage
exit 1
fi
if [ ! -d $1 ]; then
echo "$0"':'"$1"'is not a directory'
echo "Usage: $0 project_path hdl_path"
if [ ! -d $1 -o ! -d $2 ]; then
echo "$0: $1 or $2 is not a directory"
usage
exit 1
fi
hdl_path=$1
scripts_path=$2
hdl_path=$(abs_path $1)
scripts_path=$(abs_path $2)
##modules file is obligatory for each simulation
if [ ! -f $(pwd)/modules ]; then
echo "$0: Modules file does not exist"
......
......@@ -4,6 +4,15 @@
function usage() {
echo "Usage: $0 hdl_path scripts_path"
}
function abs_path() {
local cur_dir=$(pwd)
local D=$(dirname $1)
local B=$(basename $1)
(cd $D && echo $(pwd)"/$B") || exit 1
cd $cur_dir
}
##$1 is expected to be project path
if [ $# -ne 2 ]; then
echo "$0"': two arguments expected'
......@@ -16,8 +25,8 @@ if [ ! -d $1 ]; then
usage
exit 1
fi
hdl_path=$1
scripts_path=$2
hdl_path=$(abs_path $1)
scripts_path=$(abs_path $2)
##modules file is obligatory for each simulation
if [ ! -f $(pwd)/modules ]; then
......
#!/bin/bash
#script should be run by make
function abs_path() {
local cur_dir=$(pwd)
local D=$(dirname $1)
local B=$(basename $1)
(cd $D && echo $(pwd)"/$B") || exit 1
cd $cur_dir
}
##associative array declaration
if [ $# -lt 2 ]; then
echo "$0"': Argument expected'
......@@ -14,7 +22,7 @@ if [ ! -d "$1" ]; then
exit 1
fi
scripts_path=$1
scripts_path=$(abs_path $1)
vhd_comp=$2
number=0
......@@ -67,9 +75,9 @@ for i in $(seq 0 $(($number-1))); do ##for each source file
fi
done
uniq_libs=$(echo $all_libs | tr " " "\n" | sort -u | tr "\n" " ")
for lib in $uniq_libs; do
uniq_libs_long="$uniq_libs_long $(pwd)/$lib"
done
#for lib in $uniq_libs; do
# uniq_libs_long="$uniq_libs_long $(pwd)/$lib"
#done
echo ''
echo 'VHDL_OBJ:='"$obj"
echo ''
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment