-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuildIoc
executable file
·30 lines (23 loc) · 1.2 KB
/
buildIoc
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
#!/bin/bash -e
PROJECT_BINARY_DIR="`pwd`"
EPICS_BASE="$1"
# Determine architecture of the build
EPICS_ARCH=`grep "^ARCH=" "${EPICS_BASE}/lib/pkgconfig/epics-base.pc" | sed -e 's/^ARCH=//'`
# Switch to subfolder to build ioc
echo "Creating IOC template..."
mkdir -p "${PROJECT_BINARY_DIR}/ioc"
cd "${PROJECT_BINARY_DIR}/ioc"
# Run makeBaseApp script to generate IOC Template
"${EPICS_BASE}/bin/${EPICS_ARCH}/makeBaseApp.pl" -t ioc ChimeraTK
"${EPICS_BASE}/bin/${EPICS_ARCH}/makeBaseApp.pl" -i -t ioc -p ChimeraTK Linux
# Copy script generated RELEASE, CONFIG and source file to their aprobiate subfolders
cp "${PROJECT_BINARY_DIR}/iocRELEASE" "${PROJECT_BINARY_DIR}/ioc/configure/RELEASE"
cp "${PROJECT_BINARY_DIR}/iocCONFIG_SITE" "${PROJECT_BINARY_DIR}/ioc/configure/CONFIG_SITE"
cp "${PROJECT_BINARY_DIR}/iocSrcMakefile" "${PROJECT_BINARY_DIR}/ioc/ChimeraTKApp/src/Makefile"
echo "Generate IOC sources..."
make
# Copy resulting source files to project/src directory
mkdir -p "${PROJECT_BINARY_DIR}/src"
cp "${PROJECT_BINARY_DIR}/ioc/ChimeraTKApp/src/"*.cpp "${PROJECT_BINARY_DIR}/src"
cp "${PROJECT_BINARY_DIR}/ioc/ChimeraTKApp/src/O.${EPICS_ARCH}/"*.cpp "${PROJECT_BINARY_DIR}/src"
chmod u+w -R "${PROJECT_BINARY_DIR}/src"