-
Notifications
You must be signed in to change notification settings - Fork 2
/
target-change.sh
executable file
·96 lines (91 loc) · 1.53 KB
/
target-change.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
#################################################################################
#
#script for changing the patmos target to patmos-unkwnown-rtems
#
#################################################################################
list=(addr2line\
llc\
llvm-readobj\
ar\
lli\
llvm-rtdyld\
arcmt-test\
llvm-ar\
llvm-size\
bugpoint\
llvm-as\
llvm-as\
llvm-stress\
c-arcmt-test\
llvm-bcanalyzer\
llvm-tblgen\
c++filt\
llvm-config\
macho-dump\
c-index-test\
llvm-cov\
nm\
clang\
llvm-diff\
not\
clang++\
llvm-dis\
obj2yaml\
clang-3.4\
llvm-dwarfdump\
objcopy\
clang-check\
llvm-extract\
objdump\
clang-tblgen\
llvm-link\
opt\
count\
llvm-lit\
ranlib\
diagtool\
llvm-mc\
readelf\
elfedit\
llvm-mcmarkup\
size\
FileCheck\
llvm-nm\
strings\
FileUpdate\
llvm-objdump\
strip\
ld\
llvm-prof\
yaml2obj\
ld.gold\
llvm-ranlib\
yaml-bench)
pwd=$(pwd)
if [[ $1 == "" || $1 == "-help" || $1 == "--help" ]]; then
echo "Usage : "$0" <ROOT DIR>"
elif [[ ! -d $1 ]]; then
echo "Error: $1 not found..."
else
echo 'Changing names of executables...'
cd $1
bindir=$(pwd)/local/bin
cd $pwd
for cmd in "${list[@]}"
do
ofile=$bindir/patmos-$cmd
lfile=$bindir/patmos-unknown-rtems-$cmd
if [[ -f $ofile ]]; then
if [[ -f $lfile ]]; then
echo 'Warning: '$(basename $ofile)' -> '$(basename $lfile)': link already exists...'
else
echo $(basename $ofile)' -> '$(basename $lfile)
ln -s $ofile $lfile
fi
else
echo 'Warning: '$ofile' not found...'
fi
done
echo '...finished'
fi