forked from charmplusplus/charm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelink.script
executable file
·44 lines (38 loc) · 959 Bytes
/
relink.script
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
#!/bin/bash
#
# The essential directories for the proper functioning of charm++ is
# usually linked to the latest build version. For the convenience of
# users wishing to alternate between different builds of charm++,
# a simple script has been provided.
#
# Usage: relink.script <build-version-name-string>
#
# Example: relink.script netlrts-linux-i386-smp.
# by Chee Wai Lee 10/13/2003
#
# rewritten by
# Gengbin Zheng 01/15/2004
#
# modified by
# Abhinav Bhatele 11/06/2007
if test ! -d "$1"
then
echo "$0 <directory>" && exit 1
fi
subdirs="bin include lib lib_so tmp"
# remove symbolic link
# shellcheck disable=SC2086
rm -f $subdirs
for i in $subdirs
do
# skip nonexistent subdir
test ! -d "$1/$i" && continue;
echo ln -s "$1/$i" "$i"
ln -s "$1/$i" "$i"
done
rm -f charm-version.h
if test -f "$1/include/charm-version.h"
then
echo ln -s "$1/include/charm-version.h" charm-version.h
ln -s "$1/include/charm-version.h" charm-version.h
fi