-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (40 loc) · 1.33 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
TARGET=mongo_bench
SRC = mongo_bench.cpp
MONGO_VERSION=2.4.3
CPPFLAGS= -O3 -pthread -I mongo-cxx-driver-v2.4/src/
LDFLAGS = -L mongo-cxx-driver-v2.4/build/ -l mongoclient -lboost_thread-mt -lboost_filesystem
all:${TARGET}
install:all
uninstall:
clean:
rm -f *.o
rm -f ${TARGET}
/usr/local/mongo/logs/mongod.pid:
/usr/local/mongo/mongoctrl start
sleep 10
test:all /usr/local/mongo/logs/mongod.pid
nice ./mongo_bench 127.0.0.1:27017 test.TEST `cat /usr/local/mongo/logs/mongod.pid` 4000 100000 10
/usr/include/boost: /usr/lib64/libboost_thread-mt.so /usr/lib64/libboost_filesystem.so
sudo yum install boost-devel.x86_64
mongo-cxx-driver-v2.4:
wget http://downloads.mongodb.org/cxx-driver/mongodb-linux-x86_64-${MONGO_VERSION}.tgz
tar xzf mongodb-linux-x86_64-${MONGO_VERSION}.tgz
rm mongodb-linux-x86_64-${MONGO_VERSION}.tgz
pushd mongo-cxx-driver-v2.4
scons
popd
/usr/local/mongo:
sudo mkdir -p $@
sudo chmod 777 $@
mkdir -p $@/conf
mkdir -p $@/logs
mkdir -p $@/data
cp mongoctrl $@/
cp mongod.conf $@/conf
wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.4.3.tgz
tar xzf mongodb-linux-x86_64-2.4.3.tgz
rm mongodb-linux-x86_64-${MONGO_VERSION}.tgz
mv mongodb-linux-x86_64-2.4.3/bin $@/
prepare: /usr/include/boost mongo-cxx-driver-v2.4 /usr/local/mongo
${TARGET}: $(SRC)
${CXX} $< -o $@ ${CPPFLAGS} ${LDFLAGS}