forked from ehb54/ultrascan3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makesomo.sh
executable file
·143 lines (127 loc) · 3.58 KB
/
makesomo.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#!/bin/bash
MKARGS="$@"
if [ $# -eq 0 ]; then
MKARGS="-j 7"
if [ `uname -s|grep -ci "mingw"` -ne 0 ]; then
MKARGS="-j 2"
fi
fi
export MAKE="make ${MKARGS}"
if [ -z "$ULTRASCAN" ]; then
ULTRASCAN="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
echo "Notice: the ULTRASCAN environment variable was not set, so using $ULTRASCAN"
fi
if [ ! -d "$ULTRASCAN/us_somo" ]; then
echo "Error: $ULTRASCAN/us_somo is not a directory"
exit -1;
fi
ISMAC=0
FIXMAC=""
if [ "`uname -s`" = "Darwin" ]; then
ISMAC=1
FIXMAC=./fix-mac-make.sh
fi
ISWIN=0
if [ `uname -s|grep -ci "msys"` -ne 0 ]; then
ISWIN=1
fi
if [ `uname -s|grep -ci "mingw"` -ne 0 ]; then
ISWIN=1
fi
if [ `uname -s|grep -ci "cygwin"` -ne 0 ]; then
ISWIN=2
fi
DIR=$(pwd)
NBERR=0
##SOMO3=`(cd $ULTRASCAN/../ULTRASCAN_somo;pwd)`
SOMO3=`(cd $ULTRASCAN/us_somo;pwd)`
if [ $ISWIN -eq 2 ]; then
# Run revision and qmake in Cygwin window
cd $SOMO3/develop
pwd
./version.sh
qmake us_somo.pro
cp Makefile Makefile-all
cp Makefile.Release Makefile.R-all
cp Makefile.Debug Makefile.D-all
qmake libus_somo.pro
cp Makefile Makefile-lib
cp Makefile.Release Makefile.R-lib
cp Makefile.Debug Makefile.D-lib
cd $SOMO3
ls -l Make*
echo "QMAKE complete. Rerun $0 in MSYS (MINGW32) window"
exit 0
fi
if [ $ISWIN -eq 1 ]; then
# Run makes for lib,all in MSYS window
cd $SOMO3/develop
echo current path for somo compiling is `pwd`
qmake libus_somo.pro
# cp Makefile-lib Makefile
# cp Makefile.R-lib Makefile.Release
# cp Makefile.D-lib Makefile.Debug
make
# cp Makefile-all Makefile
# cp Makefile.R-all Makefile.Release
# cp Makefile.D-all Makefile.Debug
qmake us_somo.pro
make
echo "MAKE of somo complete"
cd ../
ls -l ./bin
echo cp -p bin/* $ULTRASCAN/bin/
cp -p bin/* $ULTRASCAN/bin/
echo cp -p add_to_bin/* $ULTRASCAN/bin/
cp -p add_to_bin/* $ULTRASCAN/bin/
echo cp -rp etc $ULTRASCAN
cp -rp etc $ULTRASCAN
exit 0
fi
# Do makes for Linux,Mac
echo "rsync -av --exclude .svn $SOMO3/etc $ULTRASCAN"
rsync -av --exclude .svn $SOMO3/etc $ULTRASCAN
cd $SOMO3/develop
sh version.sh
qmake us_somo.pro
cp -p Makefile Makefile-all
qmake libus_somo.pro
cp -p Makefile Makefile-lib
${MAKE} -f Makefile-lib
${MAKE} -f Makefile-all
cd $SOMO3
if [ $ISMAC -ne 0 ]; then
echo "RUN libnames, appnames"
./somo_libnames.sh
./somo_appnames.sh
fi
# symlink bin64 to bin util somo is updated to drop bin64
if [ "`uname -s`" = "Linux" ]; then
SOMOBIN64="$ULTRASCAN/bin64"
SOMOBIN="$ULTRASCAN/bin"
if [ -L ${SOMOBIN64} ] ; then
if [ -e ${SOMOBIN64} ] ; then
echo "${SOMOBIN64} - symlink ok"
else
echo "ERROR: ${SOMOBIN64} is a broken link, manually fix"
fi
elif [ -e ${SOMOBIN64} ] ; then
echo "ERROR: ${SOMOBIN64} - not a symlink, manually fix"
else
echo "creating ${SOMOBIN64} symlink"
ln -s ${SOMOBIN} ${SOMOBIN64}
fi
fi
ls -lrt ./lib ./bin64
echo ""
echo "rsync -av --exclude .svn $SOMO3/lib/ $ULTRASCAN/lib"
rsync -av --exclude .svn $SOMO3/lib/ $ULTRASCAN/lib
echo "rsync -av --exclude .svn $SOMO3/bin64/ $ULTRASCAN/bin"
rsync -av --exclude .svn $SOMO3/bin64/ $ULTRASCAN/bin
echo rsync -av --exclude .svn $SOMO3/add_to_bin/ $ULTRASCAN/bin
rsync -av --exclude .svn $SOMO3/add_to_bin/ $ULTRASCAN/bin
echo rsync -av --exclude .svn $SOMO3/etc/ $ULTRASCAN/etc
rsync -av --exclude .svn $SOMO3/etc/ $ULTRASCAN/etc
echo ""
echo "MAKE of somo complete"
exit 0