-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuildCalc
executable file
·43 lines (36 loc) · 1.27 KB
/
buildCalc
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
#!/bin/bash -e
CALC_SOURCE="$1"
PROJECT_BINARY_DIR="`pwd`"
TARGET_DIR="$2"
# Function links file, generating subfolder if necessary
makeLink() {
mkdir -p `dirname "${PROJECT_BINARY_DIR}/calc/$1"`
ln -sfn "${CALC_SOURCE}/$1" "${PROJECT_BINARY_DIR}/calc/$1"
}
export -f makeLink
export PROJECT_BINARY_DIR
export CALC_SOURCE
# "find" generates a list of paths to any regular file below the source directory
# and calls the makeLink function for every entry.
# NOTE:Semikolon needs to be escaped
if [ ! -f "${PROJECT_BINARY_DIR}/CalcSourceLinked" ]; then
cd "${CALC_SOURCE}/"
echo "Symlinking calc source..."
find -type f -exec bash -c "makeLink {}" \;
touch "${PROJECT_BINARY_DIR}/CalcSourceLinked"
fi
# Replacing the Symlink of the top level RELEASE file with a modified copy
rm "${PROJECT_BINARY_DIR}/calc/configure/RELEASE"
sed \
-e 's:EPICS_BASE=.\+:EPICS_BASE='${TARGET_DIR}':' \
-e 's:^[^#]*SSCAN=:#&:' \
-e 's/^SUPPORT=/#SUPPORT=/' \
"${CALC_SOURCE}/configure/RELEASE" > "${PROJECT_BINARY_DIR}/calc/configure/RELEASE"
# create local site config
cat > ${PROJECT_BINARY_DIR}/calc/configure/CONFIG_SITE.local <<EOF
INSTALL_LOCATION=${TARGET_DIR}
EOF
# Build library
echo "Build synApps calc library..."
cd "${PROJECT_BINARY_DIR}/calc"
make -j5 USR_CFLAGS=-w USR_CXXFLAGS=-w