2.12.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit 8bcb3dfb authored by Michael Ott's avatar Michael Ott
Browse files

Add snap7 library as dependency

parent 87ef2d25
......@@ -21,6 +21,7 @@ FULL_CC = $(shell which $(CC))
FULL_CXX = $(shell which $(CXX))
OS = $(shell uname -s)
ARCH = $(shell uname -m)
MAKETHREADS ?= $(if $(findstring $(shell uname),Darwin),$(shell sysctl machdep.cpu.thread_count | cut -b 27-),\
$(if $(findstring $(shell uname),Linux),$(shell cat /proc/cpuinfo | grep processor | wc -l),4))
......
......@@ -13,6 +13,7 @@ OPENCV_VERSION = 4.1.0
MARIADBCONNECTOR_VERSION = 3.1.3
OPASTACK_VERSION = 10.10.0.0.445
LIBOPA_VERSION = 0.4.0
SNAP7_VERSION = 1.4.2
BOOST_VERSION_U = $(subst .,_,$(BOOST_VERSION))
OPASTACK_VERSION_H = $(subst .4,-4,$(OPASTACK_VERSION))
......@@ -30,7 +31,8 @@ DISTFILES = apache-cassandra-$(CASSANDRA_VERSION).tar.gz;http://archive.apache.o
net-snmp-$(NET-SNMP_VERSION).tar.gz;https://sourceforge.net/projects/net-snmp/files/net-snmp/$(NET-SNMP_VERSION)/net-snmp-$(NET-SNMP_VERSION).tar.gz/download \
opencv-$(OPENCV_VERSION).tar.gz;https://github.com/opencv/opencv/archive/$(OPENCV_VERSION).tar.gz \
mariadb-connector-c-$(MARIADBCONNECTOR_VERSION)-src.tar.gz;https://downloads.mariadb.com/Connectors/c/connector-c-$(MARIADBCONNECTOR_VERSION)/mariadb-connector-c-$(MARIADBCONNECTOR_VERSION)-src.tar.gz \
IntelOPA-Basic.SLES124-x86_64.$(OPASTACK_VERSION).tgz;https://downloadmirror.intel.com/29107/eng/IntelOPA-Basic.SLES124-x86_64.$(OPASTACK_VERSION).tgz
IntelOPA-Basic.SLES124-x86_64.$(OPASTACK_VERSION).tgz;https://downloadmirror.intel.com/29107/eng/IntelOPA-Basic.SLES124-x86_64.$(OPASTACK_VERSION).tgz \
snap7-full-$(SNAP7_VERSION).7z;https://sourceforge.net/projects/snap7/files/1.4.2/snap7-full-1.4.2.7z/download
DISTFILES_HASHES = apache-cassandra-3.11.5.tar.gz|9428d8cd8bf8880d6536142e4b837412;\
mosquitto-1.5.5.tar.gz|a17dffc6f63b2a4ab2eb5c51139e60e9;\
......@@ -45,7 +47,8 @@ DISTFILES_HASHES = apache-cassandra-3.11.5.tar.gz|9428d8cd8bf8880d6536142e4b8374
net-snmp-5.8.tar.gz|63bfc65fbb86cdb616598df1aff6458a; \
opencv-4.1.0.tar.gz|b80c59c7e4feee6a00608315e02b0b73; \
IntelOPA-Basic.SLES124-x86_64.10.10.0.0.445.tgz|124e16f44ad7ba6dce6b15f4b2d364c3; \
mariadb-connector-c-3.1.3-src.tar.gz|384817d60cd890f83c5c9673bfa11a8b;
mariadb-connector-c-3.1.3-src.tar.gz|384817d60cd890f83c5c9673bfa11a8b; \
snap7-full-$(SNAP7_VERSION).7z|b7b439b837ead196a63c194b74ca9d33;
CASSANDRA_CLUSTER_NAME = Datacenter Monitor Database
CASSANDRA_FLUSH_LARGEST_MEMTABLES_AT = 0.5
......@@ -62,6 +65,7 @@ MD5 = $(if $(shell which md5 2>/dev/null),md5,$(if $(shell md5sum --tag Makefile
DISTFILESNAMES = $(foreach f,$(DISTFILES),$(shell echo "$(f)" | sed 's/;.*//'))
DISTFILESPATHS_FULL = $(foreach f,$(DISTFILES),$(shell echo "$(f)" | sed 's/.tar.gz;.*//; s/.tgz;.*//; s/.zip;.*//' ))
DISTFILESPATHS = apache-cassandra-$(CASSANDRA_VERSION) mosquitto-$(MOSQUITTO_VERSION) boost_$(BOOST_VERSION_U) openssl-$(OPENSSL_VERSION) libuv-v$(LIBUV_VERSION) cpp-driver-$(CPPDRV_VERSION) opencv-$(OPENCV_VERSION) mariadb-connector-c-$(MARIADBCONNECTOR_VERSION)-src
ifneq (,$(findstring bacnet,$(PLUGINS)))
DISTFILESPATHS += bacnet-stack-$(BACNET-STACK_VERSION)
endif
......@@ -76,15 +80,19 @@ ifneq (,$(findstring opa,$(PLUGINS)))
DISTFILESPATHS += IntelOPA-Basic.SLES124-x86_64.$(OPASTACK_VERSION)
endif
endif
ifneq (,$(findstring s7plc,$(PLUGINS)))
DISTFILESPATHS += snap7-full-$(SNAP7_VERSION)
endif
# If cross-compiling for ARM, adjust the build settings
ifeq ("$(ARCH)", "arm")
OPENSSL_TARGET = "linux-generic32"
ifeq ("$(OS)", "Darwin")
OPENSSL_TARGET = "darwin64-x86_64-cc"
SNAP7_OS = osx
else
OPENSSL_TARGET = $(if $(findstring $(shell uname),Darwin),"darwin64-x86_64-cc","linux-x86_64")
OPENSSL_TARGET = $(OS)-$(ARCH)
SNAP7_OS = unix
endif
.PRECIOUS: $(DCDBDEPSPATH)/distfiles/% $(DCDBDEPSPATH)/%/.extracted $(DCDBDEPSPATH)/%/.patched
.SECONDEXPANSION:
......@@ -127,6 +135,8 @@ $(DCDBDEPSPATH)/%/.extracted: | $(DCDBDEPSPATH)/distfiles/$$(call getarchive,%)
echo Extracting: $(F); \
if [ "$(suffix $(F))" = "zip" ]; then \
cd $(DCDBDEPSPATH) && unzip distfiles/$(F); \
elif [ "$(suffix $(F))" = ".7z" ]; then \
cd $(DCDBDEPSPATH) && 7z x distfiles/$(F); \
else \
cd $(DCDBDEPSPATH) && tar xf distfiles/$(F) > /dev/null; \
fi; \
......@@ -336,3 +346,16 @@ $(DCDBDEPSPATH)/mariadb-connector-c-$(MARIADBCONNECTOR_VERSION)-src/.installed:
@echo "Installing Maria DB Connector library..."
cd $(@D)/build && make install && touch $(@)
$(DCDBDEPSPATH)/snap7-full-$(SNAP7_VERSION)/.built: $(DCDBDEPSPATH)/snap7-full-$(SNAP7_VERSION)/.patched
@echo ""
@echo "Building Snap7...";
cd $(DCDBDEPSPATH)/snap7-full-$(SNAP7_VERSION)/build/$(SNAP7_OS) && \
make -f $(ARCH)_$(SNAP7_OS).mk all && \
touch $(@)
$(DCDBDEPSPATH)/snap7-full-$(SNAP7_VERSION)/.installed: $(DCDBDEPSPATH)/snap7-full-$(SNAP7_VERSION)/.built
@echo ""
@echo "Installing Snap7...";
install $(DCDBDEPSPATH)/snap7-full-$(SNAP7_VERSION)/build/bin/$(ARCH)-$(SNAP7_OS)/* $(DCDBDEPLOYPATH)/lib && \
install $(DCDBDEPSPATH)/snap7-full-$(SNAP7_VERSION)/release/Wrappers/c-cpp/snap7.h $(DCDBDEPLOYPATH)/include && \
touch $(@)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment