-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
112 lines (85 loc) · 2.92 KB
/
Makefile
File metadata and controls
112 lines (85 loc) · 2.92 KB
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
# $Id$
#
# Makefile for building objectID-chunk indexing test programs.
#
# 20151026 Michael Kelsey
# 20151103 Use $(pkg-config) to test for Memcached support
# 20151106 Add XRootD support
# 20151110 Reduce number of intermediate files by using lib(obj) dependences
# 20151124 Add RocksDB support, need to require C++11
# 20160119 Add MysqlDB support
# 20160216 Add test job to exercise bulk updating of MySQL
# Source and header files
LIBSRC := UsageTimer.cc IndexTester.cc ArrayIndex.cc BlockArrays.cc \
MapIndex.cc FileIndex.cc
BINSRC := index-performance.cc simple-array.cc block-array.cc flat-file.cc
# Incorporate /usr/local in building
CXXFLAGS += -std=c++11 -g
CPPFLAGS += -I/usr/local/include
LDFLAGS += -L. -L/usr/local/lib
LDLIBS += -lindextest
# Check local platform for Memcached API library
HASMEMCACHED := $(shell pkg-config --modversion --silence-errors libmemcached)
ifneq (,$(HASMEMCACHED))
BINSRC += memcd-index.cc
LIBSRC += MemCDIndex.cc
CPPFLAGS += -DHAS_MEMCACHED=1
LDLIBS += -lmemcached
endif
# Check local platform for XRootD
ifneq (,$(XROOTD_DIR))
BINSRC += simple-xrd.cc query-xrd.cc
LIBSRC += XrootdSimple.cc
CPPFLAGS += -I$(XROOTD_DIR)/include/xrootd -DHAS_XROOTD=1
LDFLAGS += -L$(XROOTD_DIR)/lib
LDLIBS += -lXrdCl
endif
# Check local platform for RocksDB (NOTE: Not registered with pkg-config)
HASROCKSDB := $(shell ls -d /usr/local/include/rocksdb 2> /dev/null)
ifneq (,$(HASROCKSDB))
BINSRC += rocksdb-index.cc
LIBSRC += RocksIndex.cc
CPPFLAGS += -DHAS_ROCKSDB=1
LDLIBS += -lrocksdb
endif
# Check for LSST installation of MYSQL
# NOTE: After 2016_01 tag, MariaDB hijacks the MySQL path stuff
ifneq (,$(MYSQL_INCLUDE_PATH))
BINSRC += mysql-index.cc mysql-update.cc
LIBSRC += MysqlIndex.cc MysqlUpdate.cc
CPPFLAGS += -DHAS_MYSQL=1 -I$(MYSQL_INCLUDE_PATH)/..
LDFLAGS += -L$(MYSQL_INCLUDE_PATH)/../../lib
LDLIBS += -lmysqlclient
endif
# Derivatives of source files
LIB := libindextest.a
LIBO := $(LIBSRC:.cc=.o)
BIN := $(BINSRC:.cc=)
# User targets
all : lib bin
bin : $(BIN)
lib : $(LIB)
clean :
/bin/rm -f $(LIBO) *~
veryclean : clean
/bin/rm -f $(BIN) $(LIB)
# Dependencies
simple-array.cc index-performance.cc : ArrayIndex.hh
block-array.cc index-performance.cc : BlockArrays.hh
flat-file.cc index-performance.cc : FileIndex.hh
memcd-index.cc index-performance.cc : MemCDIndex.hh
simple-xrd.cc index-performance.cc : XrootdSimple.hh
rocksdb-index.cc index-performance.cc : RocksIndex.hh
mysql-index.cc index-performance.cc : MysqlIndex.hh
mysql-update.cc : MysqlIndex.hh
index-performance.cc : MapIndex.hh
IndexTester.hh : UsageTimer.hh
MysqlUpdate.hh : MysqlIndex.hh
ArrayIndex.hh BlockArrays.hh \
MapIndex.hh FileIndex.hh \
MemCDIndex.hh XrootdSimple.hh \
RocksIndex.hh MysqlIndex.hh : IndexTester.hh
$(BINSRC) : IndexTester.hh UsageTimer.hh
$(LIBSRC) : %.cc:%.hh
$(BIN) : $(LIB)
$(LIB) : $(patsubst %,$(LIB)(%),$(LIBO))