-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
executable file
·510 lines (379 loc) · 15.3 KB
/
Makefile
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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
THIRD_PARTY := $(shell readlink $(dir $(lastword $(MAKEFILE_LIST))) -f)
THIRD_PARTY_CENTRAL = $(THIRD_PARTY)/central
THIRD_PARTY_SRC = $(THIRD_PARTY)/src
THIRD_PARTY_INCLUDE = $(THIRD_PARTY)/include
THIRD_PARTY_LIB = $(THIRD_PARTY)/lib
THIRD_PARTY_BIN = $(THIRD_PARTY)/bin
#export?
#LD_LIBRARY_PATH=$(THIRD_PARTY_LIB):LD_LIBRARY_PATH
# where to do make check between make && make install;
# 0 means no
MAKE_CHECK = 0
all: third_party_special
# Only the third_party that are not in ubuntu 14 standard distribution are
# built in third_party_special. Get the rest with
#
# sudo apt-get -y install libgflags-dev libgoogle-glog-dev
# libgoogle-perftools-dev libsnappy-dev libyaml-cpp-dev libboost1.55-dev
# libboost-filesystem1.55-dev unzip python-setuptools autoconf
# python-zmq python-yaml
#
# sudo apt-get install libgtest-dev only gets gtest source but not binary. So
# we build here. See for details
# http://askubuntu.com/questions/145887/why-no-library-files-installed-for-google-test
third_party_special: path \
protobuf3 \
dmlc \
zeromq \
gtest
# Build needed third_party from ground up. Would take 1+hr.
third_party_core: gflags \
glog \
third_party_special \
gperftools \
snappy \
boost \
yaml-cpp \
rocksdb
third_party_all: third_party_core \
hadoop \
folly \
protobuf \
oprofile \
libconfig \
cuckoo \
leveldb \
float_compressor \
openblas \
sparsehash \
eigen \
rocksdb \
fastapprox \
double-conversion
distclean:
rm -rf $(THIRD_PARTY_INCLUDE) $(THIRD_PARTY_LIB) $(THIRD_PARTY_BIN) \
$(THIRD_PARTY_SRC) $(THIRD_PARTY)/share
# These might not build.
third_party_unused: iftop
.PHONY: third_party_core third_party_all third_party_unused distclean
path:
mkdir -p $(THIRD_PARTY_LIB)
mkdir -p $(THIRD_PARTY_INCLUDE)
mkdir -p $(THIRD_PARTY_BIN)
mkdir -p $(THIRD_PARTY_SRC)
# ==================== boost ====================
BOOST_SRC = $(THIRD_PARTY_CENTRAL)/boost_1_61_0.tar.bz2
#BOOST_INCLUDE = $(THIRD_PARTY_INCLUDE)/boost
BOOST_LIB = $(THIRD_PARTY_LIB)/libboost_program_options.so
boost: path $(BOOST_LIB)
$(BOOST_LIB): $(BOOST_SRC)
tar jxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
./bootstrap.sh \
--prefix=$(THIRD_PARTY); \
./b2 install
# ===================== cuckoo =====================
CUCKOO_SRC = $(THIRD_PARTY_CENTRAL)/libcuckoo.tar
CUCKOO_INCLUDE = $(THIRD_PARTY_INCLUDE)/libcuckoo
cuckoo: path $(CUCKOO_SRC)
tar xf $(CUCKOO_SRC) -C $(THIRD_PARTY_SRC); \
cp -r $(THIRD_PARTY_SRC)/libcuckoo/libcuckoo $(THIRD_PARTY_INCLUDE)/
$(CUCKOO_INCLUDE): $(CUCKOO_SRC)
tar xf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
autoreconf -fis; \
./configure --prefix=$(THIRD_PARTY); \
make; make install
# ==================== double-conversion ===================
DCONVERT_SRC = $(THIRD_PARTY_CENTRAL)/double-conversion-1.1.5.tar.gz
DCONVERT_LIB = $(THIRD_PARTY_LIB)/libdouble-conversion.so
double-conversion: path $(DCONVERT_LIB)
$(DCONVERT_LIB): $(DCONVERT_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
scons DESTDIR=. install; \
cp usr/local/lib/* $(THIRD_PARTY_LIB); \
mkdir -p $(THIRD_PARTY_INCLUDE)/double-conversion; \
cp src/double-conversion.h $(THIRD_PARTY_INCLUDE)/double-conversion; \
cp src/utils.h $(THIRD_PARTY_INCLUDE)/double-conversion
# ==================== eigen ====================
EIGEN_SRC = $(THIRD_PARTY_CENTRAL)/eigen-3.2.4.tar.bz2
EIGEN_INCLUDE = $(THIRD_PARTY_INCLUDE)/Eigen
eigen: path $(EIGEN_INCLUDE)
$(EIGEN_INCLUDE): $(EIGEN_SRC)
tar jxf $< -C $(THIRD_PARTY_SRC)
cp -r $(THIRD_PARTY_SRC)/eigen-eigen-10219c95fe65/Eigen \
$(THIRD_PARTY_INCLUDE)/
# ==================== fastapprox ===================
FASTAPPROX_SRC = $(THIRD_PARTY_CENTRAL)/fastapprox-0.3.2.tar.gz
FASTAPPROX_INC = $(THIRD_PARTY_INCLUDE)/fastapprox
fastapprox: path $(FASTAPPROX_INC)
$(FASTAPPROX_INC): $(FASTAPPROX_SRC)
tar xzf $< -C $(THIRD_PARTY_SRC)
mkdir $(THIRD_PARTY_INCLUDE)/fastapprox
cp $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<)))/src/*.h \
$(THIRD_PARTY_INCLUDE)/fastapprox
# ==================== float_compressor ====================
FC_SRC = $(THIRD_PARTY_CENTRAL)/float16_compressor.hpp
float_compressor: path
cp $(THIRD_PARTY_CENTRAL)/float16_compressor.hpp $(THIRD_PARTY_INCLUDE)/
# ===================== folly =====================
FOLLY_SRC = $(THIRD_PARTY_CENTRAL)/folly-0.57.0.tar.gz
FOLLY_LIB = $(THIRD_PARTY_LIB)/libfolly.so
folly: path double-conversion $(FOLLY_LIB)
$(FOLLY_LIB): $(FOLLY_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<)))/folly; \
autoreconf -ivf; \
CPPFLAGS=-I$(THIRD_PARTY_INCLUDE) LD_LIBRARY_PATH=$(THIRD_PARTY_LIB) \
LDFLAGS=-L$(THIRD_PARTY_LIB) ./configure --prefix=$(THIRD_PARTY) \
--with-boost-libdir=$(THIRD_PARTY_LIB);
make -j4 && make check && make install
# ===================== gflags ===================
GFLAGS_SRC = $(THIRD_PARTY_CENTRAL)/gflags-2.1.2.tar.gz
GFLAGS_LIB = $(THIRD_PARTY_LIB)/libgflags.so
gflags: path $(GFLAGS_LIB)
$(GFLAGS_LIB): $(GFLAGS_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
mkdir -p build && cd build; \
cmake -DBUILD_SHARED_LIBS=YES -DCMAKE_INSTALL_PREFIX=$(THIRD_PARTY) ..; \
make -j && make install
#$(GFLAGS_LIB): $(GFLAGS_SRC)
# tar zxf $< -C $(THIRD_PARTY_SRC)
# cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
# ./configure --prefix=$(THIRD_PARTY); \
# make install
# ===================== glog =====================
GLOG_SRC = $(THIRD_PARTY_CENTRAL)/glog-0.3.4.tar.gz
GLOG_LIB = $(THIRD_PARTY_LIB)/libglog.so
glog: $(GLOG_LIB)
$(GLOG_LIB): $(GLOG_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
./configure --prefix=$(THIRD_PARTY); \
make install
# ================== gperftools =================
GPERFTOOLS_SRC = $(THIRD_PARTY_CENTRAL)/gperftools-2.4.tar.gz
GPERFTOOLS_LIB = $(THIRD_PARTY_LIB)/libtcmalloc.so
gperftools: path $(GPERFTOOLS_LIB)
$(GPERFTOOLS_LIB): $(GPERFTOOLS_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
./configure --prefix=$(THIRD_PARTY) --enable-frame-pointers; \
make install
# ===================== gtest ====================
GTEST_SRC = $(THIRD_PARTY_CENTRAL)/gtest-1.7.0.zip
GTEST_LIB = $(THIRD_PARTY_LIB)/libgtest_main.a
GTEST_LIB2 = $(THIRD_PARTY_LIB)/libgtest.a
gtest: path $(GTEST_LIB)
$(GTEST_LIB): $(GTEST_SRC)
rm -rf $(THIRD_PARTY_SRC)/$(basename $(notdir $<))
rm -rf $(THIRD_PARTY_INCLUDE)/gtest
unzip $< -d $(THIRD_PARTY_SRC)
cd $(basename $(THIRD_PARTY_SRC)/$(notdir $<))/make; \
make -j; make -j gtest.a; \
./sample1_unittest; \
cp -r ../include/* $(THIRD_PARTY_INCLUDE)/; \
cp gtest_main.a $@; \
cp gtest.a $(GTEST_LIB2)
# ==================== hiredis ===================
HIREDIS_SRC = $(THIRD_PARTY_CENTRAL)/hiredis-0.13.3.tar.gz
HIREDIS_LIB = $(THIRD_PARTY_LIB)/redis.so
redis: path $(HIREDIS_LIB)
$(HIREDIS_LIB): $(HIREDIS_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
make; sudo make install
# ==================== redis ===================
REDIS_SRC = $(THIRD_PARTY_CENTRAL)/redis-stable.tar.gz
REDIS_LIB = $(THIRD_PARTY_LIB)/libhiredis.so
redis: path $(REDIS_LIB)
$(REDIS_LIB): $(REDIS_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
LIBRARY_PATH=$(THIRD_PARTY_LIB):${LIBRARY_PATH} \
make -j ; make PREFIX=$(THIRD_PARTY) install
# ==================== leveldb ===================
LEVELDB_SRC = $(THIRD_PARTY_CENTRAL)/leveldb-1.18.tar.gz
LEVELDB_LIB = $(THIRD_PARTY_LIB)/libleveldb.so
leveldb: path $(LEVELDB_LIB)
$(LEVELDB_LIB): $(LEVELDB_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
LIBRARY_PATH=$(THIRD_PARTY_LIB):${LIBRARY_PATH} \
make; \
cp ./libleveldb.* $(THIRD_PARTY_LIB)/; \
cp -r include/* $(THIRD_PARTY_INCLUDE)/
# ==================== rocksdb ===================
ROCKSDB_SRC = $(THIRD_PARTY_CENTRAL)/rocksdb-master.zip
ROCKSDB_LIB = $(THIRD_PARTY_LIB)/librocksdb.so
rocksdb: path $(ROCKSDB_LIB)
$(ROCKSDB_LIB): $(ROCKSDB_SRC)
rm -rf $(THIRD_PARTY_SRC)/rocksdb-master
unzip $< -d $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
LD_LIBRARY_PATH=$(THIRD_PARTY_LIB):${LD_LIBRARY_PATH} \
CPATH=$(THIRD_PARTY_INCLUDE):${CPATH} \
LIBRARY_PATH=$(THIRD_PARTY_LIB) \
make shared_lib -j4; \
cp ./librocksdb.* $(THIRD_PARTY_LIB)/; \
cp -r include/* $(THIRD_PARTY_INCLUDE)/
# ========= rocksdb with hdfs error fixed===========
ROCKSDB_HDFS_SRC = $(THIRD_PARTY_CENTRAL)/rocksdb-hdfs.zip
ROCKSDB_HDFS_LIB = $(THIRD_PARTY_SRC)/rocksdb-hdfs/librocksdb.so
rocksdb_hdfs: path $(ROCKSDB_HDFS_LIB)
cp -r $(THIRD_PARTY_SRC)/rocksdb-hdfs/librocksdb.* $(THIRD_PARTY_LIB)/; \
cp -r $(THIRD_PARTY_SRC)/rocksdb-hdfs/include/* $(THIRD_PARTY_INCLUDE)/
$(ROCKSDB_HDFS_LIB): $(ROCKSDB_HDFS_SRC)
rm -rf $(THIRD_PARTY_SRC)/rocksdb-hdfs
unzip $< -d $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
LD_LIBRARY_PATH=$(THIRD_PARTY_LIB):${LD_LIBRARY_PATH} \
CPATH=$(THIRD_PARTY_INCLUDE):${CPATH} \
LIBRARY_PATH=$(THIRD_PARTY_LIB) \
USE_HDFS=1 \
make shared_lib -j4;
# ==================== hadoop/hdfs ===================
HADOOP_SRC = $(THIRD_PARTY_CENTRAL)/hadoop-2.6.0.tar.gz
HADOOP_LIB = $(THIRD_PARTY_LIB)/libhadoop.so
hadoop: path $(HADOOP_LIB)
$(HADOOP_LIB): $(HADOOP_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
LIBRARY_PATH=$(THIRD_PARTY_LIB):${LIBRARY_PATH}; \
cp lib/native/* $(THIRD_PARTY_LIB)/; \
cp -r include/* $(THIRD_PARTY_INCLUDE)/
# ==================== libconfig ===================
LIBCONFIG_SRC = $(THIRD_PARTY_CENTRAL)/libconfig-1.4.9.tar.gz
LIBCONFIG_LIB = $(THIRD_PARTY_LIB)/libconfig++.so
libconfig: path $(LIBCONFIG_LIB)
$(LIBCONFIG_LIB): $(LIBCONFIG_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
./configure --prefix=$(THIRD_PARTY) --enable-frame-pointers; \
make install
# ==================== yaml-cpp ===================
YAMLCPP_SRC = $(THIRD_PARTY_CENTRAL)/yaml-cpp-release-0.5.2.tar.gz
YAMLCPP_MK = $(THIRD_PARTY_CENTRAL)/yaml-cpp.mk
YAMLCPP_LIB = $(THIRD_PARTY_LIB)/libyaml-cpp.so
# TODO(wdai): add boost dependency
yaml-cpp: $(YAMLCPP_LIB)
$(YAMLCPP_LIB): $(YAMLCPP_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
make -f $(YAMLCPP_MK) BOOST_PREFIX=$(THIRD_PARTY) TARGET=$@; \
cp -r include/* $(THIRD_PARTY_INCLUDE)
# =================== oprofile ===================
# NOTE: need libpopt-dev binutils-dev
OPROFILE_SRC = $(THIRD_PARTY_CENTRAL)/oprofile-1.1.0.tar.gz
OPROFILE_LIB = $(THIRD_PARTY_LIB)/libprofiler.so
oprofile: path $(OPROFILE_LIB)
$(OPROFILE_LIB): $(OPROFILE_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
./configure --prefix=$(THIRD_PARTY) && \
make install
# ==================== openblas ===================
# NOTE: need binutils-dev (libiberty)
OPENBLAS_SRC = $(THIRD_PARTY_CENTRAL)/open_blas-0.2.14.tar.gz
OPENBLAS_LIB = $(THIRD_PARTY_LIB)/libopenblas.so
openblas: path $(OPENBLAS_LIB)
$(OPENBLAS_LIB): $(OPENBLAS_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
make && make install PREFIX=$(THIRD_PARTY)
# =================== protobuf ===================
PROTOBUF_SRC = $(THIRD_PARTY_CENTRAL)/protobuf-2.6.1.tar.gz
PROTOBUF_LIB = $(THIRD_PARTY_LIB)/libprotobuf.so
protobuf: path $(PROTOBUF_LIB)
$(PROTOBUF_LIB): $(PROTOBUF_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
./configure --prefix=$(THIRD_PARTY) && \
make && make check && make install
# =================== protobuf3 ===================
PROTOBUF3_SRC = $(THIRD_PARTY_CENTRAL)/protobuf-3.0.0-beta-1.tar.gz
PROTOBUF3_LIB = $(THIRD_PARTY_LIB)/libprotobuf-lite.a
GMOCK_SRC = $(THIRD_PARTY_CENTRAL)/gmock-1.7.0.zip
protobuf3: path $(PROTOBUF3_LIB)
$(PROTOBUF3_LIB): $(PROTOBUF3_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
unzip -q $(GMOCK_SRC)
mv gmock-1.7.0 $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<)))/gmock
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
./autogen.sh ; \
./configure --prefix=$(THIRD_PARTY) && \
make -j && make check && make install; \
cd python && \
python setup.py build && \
cp -r build/lib*/* $(THIRD_PARTY_INCLUDE)
# ================== sparsehash ==================
SPARSEHASH_SRC = $(THIRD_PARTY_CENTRAL)/sparsehash-2.0.2.tar.gz
SPARSEHASH_INCLUDE = $(THIRD_PARTY_INCLUDE)/sparsehash
sparsehash: path $(SPARSEHASH_INCLUDE)
$(SPARSEHASH_INCLUDE): $(SPARSEHASH_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
./configure --prefix=$(THIRD_PARTY); \
make install
# ==================== snappy ===================
SNAPPY_SRC = $(THIRD_PARTY_CENTRAL)/snappy-1.1.2.tar.gz
SNAPPY_LIB = $(THIRD_PARTY_LIB)/libsnappy.so
snappy: path $(SNAPPY_LIB)
$(SNAPPY_LIB): $(SNAPPY_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
./configure --prefix=$(THIRD_PARTY); \
make install
# ==================== zeromq ====================
ZMQ_SRC = $(THIRD_PARTY_CENTRAL)/zeromq-4.2.0.tar.gz
ZMQ_LIB = $(THIRD_PARTY_LIB)/libzmq.so
zeromq: path $(ZMQ_LIB)
$(ZMQ_LIB): $(ZMQ_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
./configure --prefix=$(THIRD_PARTY) --without-libsodium; \
make -j install
cp $(THIRD_PARTY_CENTRAL)/zmq.hpp $(THIRD_PARTY_INCLUDE)
# ==================== zeromq-3.2.5 ====================
#ZMQ_SRC = $(THIRD_PARTY_CENTRAL)/zeromq-3.2.5.tar.gz
#ZMQ_LIB = $(THIRD_PARTY_LIB)/libzmq.so
#
#zeromq: path $(ZMQ_LIB)
#
#$(ZMQ_LIB): $(ZMQ_SRC)
# tar zxf $< -C $(THIRD_PARTY_SRC)
# cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
# ./configure --prefix=$(THIRD_PARTY); \
# make install
# cp $(THIRD_PARTY_CENTRAL)/zmq.hpp $(THIRD_PARTY_INCLUDE)
####################### Unused #####################
# ==================== dmlc ====================
DMLC_SRC = $(THIRD_PARTY_CENTRAL)/dmlc-core-master.zip
DMLC_LIB = $(THIRD_PARTY_LIB)/libdmlc.a
dmlc: path $(DMLC_LIB)
$(DMLC_LIB): $(DMLC_SRC)
rm -rf $(THIRD_PARTY_SRC)/dmlc-core-master
unzip $< -d $(THIRD_PARTY_SRC)
cp $(THIRD_PARTY_CENTRAL)/dmlc_config.mk \
$(THIRD_PARTY_SRC)/dmlc-core-master/make/config.mk
cp $(THIRD_PARTY_CENTRAL)/dmlc.mk \
$(THIRD_PARTY_SRC)/dmlc-core-master/make/dmlc.mk
cp $(THIRD_PARTY_CENTRAL)/dmlc_makefile \
$(THIRD_PARTY_SRC)/dmlc-core-master/Makefile
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
make -j DEPS_PATH=$(THIRD_PARTY); \
cp ./libdmlc.* $(THIRD_PARTY_LIB)/; \
cp -r include/* $(THIRD_PARTY_INCLUDE)/;
cp -r $(THIRD_PARTY_CENTRAL)/dmlc/logging.h $(THIRD_PARTY_INCLUDE)/dmlc/
# ================== iftop ==================
IFTOP_SRC = $(THIRD_PARTY_CENTRAL)/iftop-1.0pre4.tar.gz
IFTOP_BIN = $(THIRD_PARTY_BIN)/iftop
iftop: path $(IFTOP_BIN)
$(IFTOP_BIN): $(IFTOP_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $<)); \
./configure --prefix=$(THIRD_PARTY); \
make install; \
cp iftop $(IFTOP_BIN)