forked from shaygalon/memcache-perf
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
63 lines (50 loc) · 1.87 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
VERSION=0.3
LIBS=-lzmq -levent -lpthread -lrt
CXXFLAGS= $(XFLAGS) -g -std=c++0x -D_GNU_SOURCE -O3 $(INCPATHFLAG)
HEADERS= AdaptiveSampler.h barrier.h cmdline.h Connection.h ConnectionStats.h \
Generator.h log.h mcperf.h util.h AgentStats.h binary_protocol.h \
config.h ConnectionOptions.h distributions.h KeyGenerator.h \
HistogramSampler.h LogHistogramSampler.h Operation.h cpu_stat_thread.h
CFILES= barrier.cc cmdline.cc Connection.cc distributions.cc \
Generator.cc log.cc mcperf.cc TestGenerator.cc util.cc cpu_stat_thread.cc
SRCS=$(HEADERS) $(CFILES)
OBJS=mcperf.o cmdline.o log.o distributions.o util.o Connection.o Generator.o cpu_stat_thread.o
DEPFILES=$(CFILES:.cc=.d)
ifdef GNUPLOT
CXXFLAGS += -DGNUPLOT
OBJS += gnuplot_i.o
HEADERS += gnuplot_i.h
SRCS += gnuplot_i.c gnuplot_i.h
endif
ifdef STATIC
LIBS += -lpgm -luuid -ldl
XFLAGS += -static
endif
mcperf: Makefile $(OBJS)
export LD_RUN_PATH=$(LIBPATH) && g++ -o mcperf $(XFLAGS) $(OBJS) $(LIBPATHFLAG) $(LIBS)
.PHONY: clean apt-get zip cmdline
clean:
rm -f *.o *.d mcperf
apt-get:
-apt install -y uuid uuid-dev libpgm-dev libevent-dev gengetopt
-apt install -y libzmq libzmq-dev
-apt install -y libzmq5 libzmq5-dev
cmdline:
gengetopt --input=cmdline.ggo --show-required
gengetopt --input=cmdline.ggo --show-required --show-help > README.help
sed -e '/Command/,$$d' README.md > README.base
grep "Command" README.md >> README.base
echo "==================" >> README.base
cat README.help >> README.md
rm README.help README.base
zip: memcache-perf.tgz
release: memcache-perf.tgz
memcache-perf.tgz: $(SRCS)
tar --transform=s,^,memcache-perf-$(VERSION)/, -cvzf memcache-perf-$(VERSION).tgz $(SRCS) *.h Makefile COPYING README.md
%.d: %.cc
@set -e; rm -f $@; \
$(CC) -MM $(CXXFLAGS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
dep: $(DEPFILES)
-include $(DEPFILES)