dependencies.mk 14.9 KB
Newer Older
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
SOURCEFORGE_MROR  = vorboss
CASSANDRA_VERSION = 3.0.18
MOSQUITTO_VERSION = 1.5.5
BOOST_VERSION     = 1.70.0
OPENSSL_VERSION   = 1.1.1c
CPPDRV_VERSION    = 2.10.0
LIBUV_VERSION     = 1.24.0
BACNET-STACK_VERSION = 0.8.6
FREEIPMI_VERSION = 1.6.3
GCRYPT_VERSION   = 1.8.4
GPG-ERROR_VERSION = 1.36
NET-SNMP_VERSION = 5.8
OPENCV_VERSION = 4.1.0

BOOST_VERSION_U   = $(subst .,_,$(BOOST_VERSION))

DISTFILES = apache-cassandra-$(CASSANDRA_VERSION).tar.gz;http://archive.apache.org/dist/cassandra/$(CASSANDRA_VERSION)/apache-cassandra-$(CASSANDRA_VERSION)-bin.tar.gz \
            mosquitto-$(MOSQUITTO_VERSION).tar.gz;http://mosquitto.org/files/source/mosquitto-$(MOSQUITTO_VERSION).tar.gz \
            boost_$(BOOST_VERSION_U).tar.gz;http://$(SOURCEFORGE_MROR).dl.sourceforge.net/project/boost/boost/$(BOOST_VERSION)/boost_$(BOOST_VERSION_U).tar.gz \
            openssl-$(OPENSSL_VERSION).tar.gz;https://www.openssl.org/source/openssl-$(OPENSSL_VERSION).tar.gz \
            libuv-v$(LIBUV_VERSION).tar.gz;https://dist.libuv.org/dist/v$(LIBUV_VERSION)/libuv-v$(LIBUV_VERSION).tar.gz \
            cpp-driver-$(CPPDRV_VERSION).tar.gz;https://github.com/datastax/cpp-driver/archive/$(CPPDRV_VERSION).tar.gz \
            bacnet-stack-$(BACNET-STACK_VERSION).tgz;https://downloads.sourceforge.net/project/bacnet/bacnet-stack/bacnet-stack-$(BACNET-STACK_VERSION)/bacnet-stack-$(BACNET-STACK_VERSION).tgz \
            libgpg-error-$(GPG-ERROR_VERSION).tar.gz;https://gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-$(GPG-ERROR_VERSION).tar.gz \
            libgcrypt-$(GCRYPT_VERSION).tar.gz;https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-$(GCRYPT_VERSION).tar.gz \
            freeipmi-$(FREEIPMI_VERSION).tar.gz;http://ftp.gnu.org/gnu/freeipmi/freeipmi-$(FREEIPMI_VERSION).tar.gz \
            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

DISTFILES_HASHES = apache-cassandra-3.0.18.tar.gz|94dbdaa58b366166c53f881b8e266bc8;\
                   mosquitto-1.5.5.tar.gz|a17dffc6f63b2a4ab2eb5c51139e60e9;\
                   boost_1_70_0.tar.gz|fea771fe8176828fabf9c09242ee8c26;\
                   openssl-1.1.1c.tar.gz|15e21da6efe8aa0e0768ffd8cd37a5f6;\
                   cpp-driver-2.10.0.tar.gz|6d15dd2cccd2efd1fdc86089d26971d0;\
                   libuv-v1.24.0.tar.gz|90320330757253b07404d2a97f59c66b;\
                   bacnet-stack-0.8.6.tgz|544ebd42ed959deb2213209b66bbc460;\
                   libgcrypt-1.8.4.tar.gz|433ab0a47b25994fa92b165db185f174;\
                   libgpg-error-1.36.tar.gz|f2283e22959ef71f44d8be3d0987a96b;\
                   freeipmi-1.6.3.tar.gz|b2d97e20db9b81b460ce1b9dad5bf54e;\
                   net-snmp-5.8.tar.gz|63bfc65fbb86cdb616598df1aff6458a; \
                   opencv-4.1.0.tar.gz|b80c59c7e4feee6a00608315e02b0b73;

CASSANDRA_CLUSTER_NAME                 = Datacenter Monitor Database
CASSANDRA_FLUSH_LARGEST_MEMTABLES_AT   = 0.5
CASSANDRA_REDUCE_CACHE_SIZES_AT        = 0.6
CASSANDRA_REDUCE_CACHE_CAPACITY_TO     = 0.4
CASSANDRA_PARTITIONER                  = org.apache.cassandra.dht.ByteOrderedPartitioner
CASSANDRA_COMMITLOG_TOTAL_SPACE_IN_MB  = 256
CASSANDRA_COMMITLOG_SEGMENT_SIZE_IN_MB = 16
CASSANDRA_TOMBSTONE_WARN_THRESHOLD     = 100000
CASSANDRA_TOMBSTONE_FAILURE_THRESHOLD  = 10000000

FETCH = wget -c --no-check-certificate -O 
MD5 = $(if $(shell which md5 2>/dev/null),md5,$(if $(shell md5sum --tag Makefile 2&> /dev/null || true),md5sum --tag,openssl md5))
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) 
ifneq (,$(findstring bacnet,$(PLUGINS)))
 	DISTFILESPATHS += bacnet-stack-$(BACNET-STACK_VERSION) 
endif
ifneq (,$(findstring ipmi,$(PLUGINS)))
 	DISTFILESPATHS += libgpg-error-$(GPG-ERROR_VERSION) libgcrypt-$(GCRYPT_VERSION) freeipmi-$(FREEIPMI_VERSION)
endif
ifneq (,$(findstring snmp,$(PLUGINS)))
 	DISTFILESPATHS += net-snmp-$(NET-SNMP_VERSION) 
endif

# If cross-compiling for ARM, adjust the build settings
ifeq ("$(ARCH)", "arm")
	OPENSSL_TARGET = "linux-generic32"
else
	OPENSSL_TARGET = $(if $(findstring $(shell uname),Darwin),"darwin64-x86_64-cc","linux-x86_64")
endif

.PRECIOUS: $(DCDBDEPSPATH)/distfiles/% $(DCDBDEPSPATH)/%/.extracted $(DCDBDEPSPATH)/%/.patched
.SECONDEXPANSION:

getarchive = $(filter $1%,$(DISTFILESNAMES))
gethash = $(subst $(1)|,,$(filter $(1)%,$(subst ;, ,$(DISTFILES_HASHES))))

$(DCDBDEPSPATH):
	@mkdir -p $(DCDBDEPSPATH)

$(DCDBDEPSPATH)/distfiles: | $(DCDBDEPSPATH)
	@mkdir -p $(DCDBDEPSPATH)/distfiles

$(DCDBDEPLOYPATH):
	@mkdir -p $(DCDBDEPLOYPATH)/bin
	@mkdir -p $(DCDBDEPLOYPATH)/include
	@mkdir -p $(DCDBDEPLOYPATH)/lib

$(DCDBDEPSPATH)/distfiles/%: | $(DCDBDEPSPATH)/distfiles
	@echo "Check for $(*)"
	$(eval U := $(shell echo "$(DISTFILES)" | sed 's/.*$(*);//' | sed 's/ .*//'))
	@if [ -e $(@) ]; then \
		if [ `$(MD5) $(@)|sed -e 's/.*\ //'` != $(call gethash,$(*)) ]; then \
			rm $(@); \
		fi; \
	fi
	@if [ ! -e $(@) ]; then \
		$(FETCH) $(@) $(U); \
	fi

$(DCDBDEPSPATH)/%/.extracted: | $(DCDBDEPSPATH)/distfiles/$$(call getarchive,%)
	$(eval F := $(notdir $(|)))
	@if [ ! -e $(@) ]; then \
		printf "Verifying checksum: $(F) "; \
		if [ `$(MD5) $(|)|sed -e 's/.*\ //'` = $(call gethash,$(F)) ]; then \
			echo " => OK!"; \
		else \
			echo " => FAIL!"; \
			exit 2; \
		fi; \
		echo Extracting: $(F); \
		if [ "$(suffix $(F))" = "zip" ]; then \
			cd $(DCDBDEPSPATH) && unzip distfiles/$(F); \
		else \
			cd $(DCDBDEPSPATH) && tar xf distfiles/$(F) > /dev/null; \
		fi; \
	fi 
	@touch $@

$(DCDBDEPSPATH)/%/.patched: $(DCDBDEPSPATH)/%/.extracted
	$(eval P := $(realpath patches))
	if [ ! -e $(@) ] && [ -e $(P)/$(*).patch ]; then \
		echo Patching: $(*); \
		cd $(@D) && (patch -N -p1 < $(P)/$(*).patch); \
	fi
	@touch $@

$(DCDBDEPSPATH)/openssl-$(OPENSSL_VERSION)/.built: $(DCDBDEPSPATH)/openssl-$(OPENSSL_VERSION)/.patched
	@echo "Building OpenSSL library..."
	cd $(@D) && ./Configure shared --prefix=$(DCDBDEPLOYPATH) $(OPENSSL_TARGET)
	cd $(@D) && make && touch $(@)

$(DCDBDEPSPATH)/openssl-$(OPENSSL_VERSION)/.installed: $(DCDBDEPSPATH)/openssl-$(OPENSSL_VERSION)/.built | $(DCDBDEPLOYPATH)
	@echo "Installing OpenSSL library..."
	cd $(@D) && make install_sw && touch $(@)

$(DCDBDEPSPATH)/mosquitto-$(MOSQUITTO_VERSION)/.built: $(DCDBDEPSPATH)/mosquitto-$(MOSQUITTO_VERSION)/.patched
	@echo "Building Mosquitto library...";
	mkdir -p $(@D)/build;
	cd $(@D)/build && \
	CC=$(FULL_CC) CXX=$(FULL_CXX) cmake $(CMAKE_CROSS_FLAGS) \
	-DWITH_SRV=no \
	-DWITH_TLS=yes \
	-DWITH_TLS_PSK=yes \
	-DDOCUMENTATION=no \
	-DCMAKE_INSTALL_PREFIX=$(DCDBDEPLOYPATH)/ \
	$(@D) && \
	make -j $(MAKETHREADS) && \
	touch $(@)

$(DCDBDEPSPATH)/mosquitto-$(MOSQUITTO_VERSION)/.installed: $(DCDBDEPSPATH)/mosquitto-$(MOSQUITTO_VERSION)/.built | $(DCDBDEPLOYPATH)
	@echo "Installing Mosquitto library..."
	cd $(@D)/build && make install && touch $(@)

$(DCDBDEPSPATH)/boost_$(BOOST_VERSION_U)/.built: $(DCDBDEPSPATH)/boost_$(BOOST_VERSION_U)/.patched
	@echo "Building Boost..."
	@ if [ "$(ARCH)" = "arm" ]; then \
		echo " using gcc : arm : $(CROSS_COMPILE)g++ ; " > $(@D)/tools/build/src/user-config.jam; \
	fi
	cd $(@D) && ./bootstrap.sh --prefix=$(DCDBDEPLOYPATH) --with-libraries=atomic,chrono,date_time,exception,filesystem,log,program_options,random,regex,system,thread,timer && \
	./b2 stage && touch $(@)
		

$(DCDBDEPSPATH)/boost_$(BOOST_VERSION_U)/.installed: $(DCDBDEPSPATH)/boost_$(BOOST_VERSION_U)/.built
	cd $(@D) && ./b2 -j $(MAKETHREADS) --no-cmake-config install && touch $(@)

$(DCDBDEPSPATH)/libuv-v$(LIBUV_VERSION)/.built: $(DCDBDEPSPATH)/libuv-v$(LIBUV_VERSION)/.patched
	@echo "Building libuv..."
	mkdir -p $(@D)/build
	cd $(@D)/build && \
	CC=$(FULL_CC) CXX=$(FULL_CXX) cmake $(CMAKE_CROSS_FLAGS) \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_INSTALL_PREFIX=$(DCDBDEPLOYPATH)/ \
		.. && \
		make -j $(MAKETHREADS) && touch $(@)

$(DCDBDEPSPATH)/libuv-v$(LIBUV_VERSION)/.installed: $(DCDBDEPSPATH)/libuv-v$(LIBUV_VERSION)/.built | $(DCDBDEPLOYPATH)
	@echo "Installing libuv..."
	cd $(@D)/build && make install && touch $(@)

$(DCDBDEPSPATH)/cpp-driver-$(CPPDRV_VERSION)/.built: $(DCDBDEPSPATH)/cpp-driver-$(CPPDRV_VERSION)/.patched $(DCDBDEPSPATH)/openssl-$(OPENSSL_VERSION)/.built $(DCDBDEPSPATH)/libuv-v$(LIBUV_VERSION)/.built
	@echo "Building cpp-driver..."
	mkdir -p $(@D)/build
	cd $(@D)/build && \
	CC=$(FULL_CC) CXX=$(FULL_CXX) cmake $(CMAKE_CROSS_FLAGS) \
		-DOPENSSL_ROOT_DIR=$(DCDBDEPSPATH)/openssl-$(OPENSSL_VERSION) \
		-DLIBUV_ROOT_DIR=$(DCDBDEPSPATH)/libuv-v$(LIBUV_VERSION) \
		-DCASS_BUILD_EXAMPLES=NO \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_INSTALL_PREFIX=$(DCDBDEPLOYPATH)/ \
		-DCMAKE_EXE_LINKER_FLAGS="-L$(DCDBDEPSPATH)/boost_$(BOOST_VERSION_U)/stage/lib -lboost_random" \
		-DCMAKE_SHARED_LINKER_FLAGS="-L$(DCDBDEPSPATH)/boost_$(BOOST_VERSION_U)/stage/lib -lboost_random" \
		.. && \
		make -j $(MAKETHREADS) && touch $(@)

$(DCDBDEPSPATH)/cpp-driver-$(CPPDRV_VERSION)/.installed: $(DCDBDEPSPATH)/cpp-driver-$(CPPDRV_VERSION)/.built | $(DCDBDEPLOYPATH)
	@echo "Installing cpp-driver..."
	cd $(@D)/build && make install && touch $(@)
	
$(DCDBDEPSPATH)/apache-cassandra-$(CASSANDRA_VERSION)/.built: $(DCDBDEPSPATH)/apache-cassandra-$(CASSANDRA_VERSION)/.patched
	@touch $(DCDBDEPSPATH)/apache-cassandra-$(CASSANDRA_VERSION)/.built

$(DCDBDEPSPATH)/apache-cassandra-$(CASSANDRA_VERSION)/.installed: $(DCDBDEPSPATH)/apache-cassandra-$(CASSANDRA_VERSION)/.built | $(DCDBDEPLOYPATH)
	@echo ""
	@echo "Staging and configuring Cassandra..."
	@rsync -rlptD $(@D)/ $(DCDBDEPLOYPATH)/cassandra
	@$(eval P := $(shell echo "$(DCDBDEPLOYPATH)" | sed 's/\//\\\//g'))
	@sed -i.original -e 's/\/var\/lib\/cassandra/$(P)\/var\/lib\/cassandra/g' $(DCDBDEPLOYPATH)/cassandra/conf/cassandra.yaml
	@sed -i -e 's/.*cluster_name:.*/cluster_name:\ '\''$(CASSANDRA_CLUSTER_NAME)'\''/' $(DCDBDEPLOYPATH)/cassandra/conf/cassandra.yaml
	@sed -i -e 's/.*flush_largest_memtables_at:.*/flush_largest_memtables_at:\ $(CASSANDRA_FLUSH_LARGEST_MEMTABLES_AT)/' $(DCDBDEPLOYPATH)/cassandra/conf/cassandra.yaml
	@sed -i -e 's/.*reduce_cache_sizes_at:.*/reduce_cache_sizes_at:\ $(CASSANDRA_REDUCE_CACHE_SIZES_AT)/' $(DCDBDEPLOYPATH)/cassandra/conf/cassandra.yaml
	@sed -i -e 's/.*reduce_cache_capacity_to:.*/reduce_cache_capacity_to:\ $(CASSANDRA_REDUCE_CACHE_CAPACITY_TO)/' $(DCDBDEPLOYPATH)/cassandra/conf/cassandra.yaml
	@sed -i -e 's/.*partitioner:.*/partitioner:\ $(CASSANDRA_PARTITIONER)/' $(DCDBDEPLOYPATH)/cassandra/conf/cassandra.yaml
	@sed -i -e 's/.*commitlog_total_space_in_mb:.*/commitlog_total_space_in_mb: $(CASSANDRA_COMMITLOG_TOTAL_SPACE_IN_MB)/' $(DCDBDEPLOYPATH)/cassandra/conf/cassandra.yaml
	@sed -i -e 's/.*commitlog_segment_size_in_mb:.*/commitlog_segment_size_in_mb: $(CASSANDRA_COMMITLOG_SEGMENT_SIZE_IN_MB)/' $(DCDBDEPLOYPATH)/cassandra/conf/cassandra.yaml
	@sed -i -e 's/.*tombstone_warn_threshold:.*/tombstone_warn_threshold: $(CASSANDRA_TOMBSTONE_WARN_THRESHOLD)/' $(DCDBDEPLOYPATH)/cassandra/conf/cassandra.yaml
	@sed -i -e 's/.*tombstone_failure_threshold:.*/tombstone_failure_threshold: $(CASSANDRA_TOMBSTONE_FAILURE_THRESHOLD)/' $(DCDBDEPLOYPATH)/cassandra/conf/cassandra.yaml
	@touch $@

$(DCDBDEPSPATH)/bacnet-stack-$(BACNET-STACK_VERSION)/.built: $(DCDBDEPSPATH)/bacnet-stack-$(BACNET-STACK_VERSION)/.patched
	@echo ""
	@echo "Building BACNet-Stack..."
	$(eval BACNET_PORT:= $(if $(filter $(OS),Darwin),bsd,linux))
	cd $(@D) && BACNET_PORT=$(BACNET_PORT) MAKE_DEFINE=-fpic make -j $(MAKETHREADS) library
	touch $(@)

$(DCDBDEPSPATH)/bacnet-stack-$(BACNET-STACK_VERSION)/.installed: $(DCDBDEPSPATH)/bacnet-stack-$(BACNET-STACK_VERSION)/.built | $(DCDBDEPLOYPATH)
	@echo "Installing BACNet-Stack..."
	mkdir   $(DCDBDEPLOYPATH)/include/bacnet && \
	install $(DCDBDEPSPATH)/bacnet-stack-$(BACNET-STACK_VERSION)/include/* /$(DCDBDEPLOYPATH)/include/bacnet && \
	install $(DCDBDEPSPATH)/bacnet-stack-$(BACNET-STACK_VERSION)/lib/libbacnet.a /$(DCDBDEPLOYPATH)/lib/ && touch $(@)

$(DCDBDEPSPATH)/libgpg-error-$(GPG-ERROR_VERSION)/.built: $(DCDBDEPSPATH)/libgpg-error-$(GPG-ERROR_VERSION)/.patched
	@echo ""
	@echo "Building gpg-error library..."
	cd $(@D) && ./configure --prefix=$(DCDBDEPLOYPATH)
	cd $(@D) && make -j $(MAKETHREADS) && touch $(@)

$(DCDBDEPSPATH)/libgpg-error-$(GPG-ERROR_VERSION)/.installed: $(DCDBDEPSPATH)/libgpg-error-$(GPG-ERROR_VERSION)/.built
	@echo "Installing gpg-error library..."
	cd $(@D) && make install && touch $(@)

$(DCDBDEPSPATH)/libgcrypt-$(GCRYPT_VERSION)/.built: $(DCDBDEPSPATH)/libgcrypt-$(GCRYPT_VERSION)/.patched
	@echo ""
	@echo "Building gcrypt library..."
	cd $(@D) && ./configure --prefix=$(DCDBDEPLOYPATH) --with-libgpg-error-prefix=$(DCDBDEPLOYPATH)
	cd $(@D) && make -j $(MAKETHREADS) && touch $(@)

$(DCDBDEPSPATH)/libgcrypt-$(GCRYPT_VERSION)/.installed: $(DCDBDEPSPATH)/libgcrypt-$(GCRYPT_VERSION)/.built
	@echo "Installing gcrypt library..."
	cd $(@D) && make install && touch $(@)

$(DCDBDEPSPATH)/freeipmi-$(FREEIPMI_VERSION)/.built: $(DCDBDEPSPATH)/freeipmi-$(FREEIPMI_VERSION)/.patched
	@echo ""
	@echo "Building FreeIPMI library..."
	cd $(@D) && ./configure --prefix=$(DCDBDEPLOYPATH) --without-argp
	cd $(@D) && make -j $(MAKETHREADS) && touch $(@)

$(DCDBDEPSPATH)/freeipmi-$(FREEIPMI_VERSION)/.installed: $(DCDBDEPSPATH)/freeipmi-$(FREEIPMI_VERSION)/.built | $(DCDBDEPLOYPATH)
	@echo "Installing FreeIPMI library..."
	cd $(@D) && make install && touch $(@)

$(DCDBDEPSPATH)/net-snmp-$(NET-SNMP_VERSION)/.built: $(DCDBDEPSPATH)/net-snmp-$(NET-SNMP_VERSION)/.patched
	@echo ""
	@echo "Building net-SNMP library..."
	cd $(@D) && ./configure --prefix=$(DCDBDEPLOYPATH) --with-default-snmp-version=3 --with-defaults --with-logfile=none --with-persistent-directory=$(DCDBDEPLOYPATH)/var/net-snmp --disable-embedded-perl --disable-perl-cc-checks --without-perl-modules --disable-agent --disable-applications --disable-manuals --disable-scripts --disable-mibs
	cd $(@D) && make -j $(MAKETHREADS) && touch $(@)

$(DCDBDEPSPATH)/net-snmp-$(NET-SNMP_VERSION)/.installed: $(DCDBDEPSPATH)/net-snmp-$(NET-SNMP_VERSION)/.built | $(DCDBDEPLOYPATH)
	@echo ""
	@echo "Installing net-SNMP library..."
	cd $(@D) && make install && touch $(@)
	
$(DCDBDEPSPATH)/opencv-$(OPENCV_VERSION)/.built: $(DCDBDEPSPATH)/opencv-$(OPENCV_VERSION)/.patched
	@echo ""
	@echo "Building OpenCV library..."
	cd $(@D) && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(DCDBDEPLOYPATH) -DCMAKE_INSTALL_LIBDIR=lib -DINSTALL_C_EXAMPLES=OFF -DBUILD_EXAMPLES=OFF -DBUILD_LIST=core,dnn,features2d,flann,gapi,ml ..
	cd $(@D) && cd build && make -j $(MAKETHREADS) && touch $(@)
	
$(DCDBDEPSPATH)/opencv-$(OPENCV_VERSION)/.installed: $(DCDBDEPSPATH)/opencv-$(OPENCV_VERSION)/.built | $(DCDBDEPLOYPATH)
	@echo ""
	@echo "Installing OpenCV library..."
	cd $(@D) && cd build && make install && touch $(@)