Skip to content
Snippets Groups Projects
Commit ed4beb91 authored by al.schwinn's avatar al.schwinn
Browse files

Updated and automated snap7 build

parent 3fbf61e0
No related branches found
No related tags found
No related merge requests found
snap7-full/
/snap7-full-1.4.0.tar.gz
/snap7-ful*
#!/bin/sh
set -e
SNAP7_VERSION=1.4.0
# First argument has to be the desired snap7 version
SNAP7_VERSION=$1
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT") # path where this script is located in
SNAP7_FOLDER=snap7-full-${SNAP7_VERSION}
SNAP7_PATH=${SCRIPTPATH}/${SNAP7_FOLDER}
echo ${SNAP7_PATH}
# If there is no snap7 folder yet, we download the required version and build it
if [ -d ${SNAP7_PATH} ]; then
echo "Some snap7 version is already available. No need to download/build it"
#TODO Check if the version matches
else
archiveFile=${SNAP7_FOLDER}.tar.gz
archiveFilePath=${SCRIPTPATH}/${SNAP7_FOLDER}.tar.gz
echo "Cleanup"
rm -rf snap7-ful*
if [ ! -f "$archiveFilePath" ]
then
echo "Downloading snap7"
cd ${SCRIPTPATH}
wget http://downloads.sourceforge.net/project/snap7/${SNAP7_VERSION}/${archiveFile}
fi
archiveFile=${SNAP7_FOLDER}.tar.gz
if [ ! -f "$archiveFile" ]
then
rm -rf snap7-full*
wget http://downloads.sourceforge.net/project/snap7/${SNAP7_VERSION}/${archiveFile}
tar -vxzf ${archiveFile}
mv ${SNAP7_FOLDER} snap7-full
if [ ! -d ${SNAP7_PATH} ]
then
echo "Extracting snap7"
tar -vxzf ${archiveFilePath}
rm ${archiveFilePath}
fi
if [ ! -d ${SCRIPTPATH}/snap7-full ]
then
echo "Creating symlink"
ln -s ${SNAP7_PATH} ${SCRIPTPATH}/snap7-full
fi
echo "Building snap7"
cd ${SNAP7_FOLDER}/build/unix
make -f x86_64_linux.mk
fi
cd snap7-full/build/unix
make -f x86_64_linux.mk
......@@ -4,7 +4,7 @@ set -e
RELEASE_DIR_BASE=$1
SILECS_VERSION=$2
SNAP7_VERSION=1.4.2
SNAP7_VERSION=1.4.0
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT") # path where this script is located in
......@@ -15,6 +15,9 @@ if [ -d ${RELEASE_DIR} ]; then
exit 1
fi
# Download and build snap7 if required
${SCRIPTPATH}/build.sh ${SNAP7_VERSION}
mkdir -p ${RELEASE_DIR}
cp -r ${SCRIPTPATH}/snap7-full/build/bin/x86_64-linux ${RELEASE_DIR}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment