Makefile 2 KB
Newer Older
1
# Linux switches
2
CFLAGS= -Ofast -Wall -pedantic -Wextra
3
4
5
6
7
8

# Mac OS: We don't use pedantic as Mac OS version of MySQL (5.5.24) does use long long (not part of ISO C++)
#CFLAGS=-g -O0 -Wall -Wextra -I/opt/local/include

# Mac OS does not require -lrt
# Linux requires -lrt
9
LDFLAGS=-lrt
10

11
12
13
MEMFILE_CFLAGS=
MEMFILE_LDFLAGS=

14
15
16
17
18
# It is mysql_config on most Linux systems and mysql_config5 on Mac OS
MYSQL_CONFIG=mysql_config

MYSQL_CFLAGS=`$(MYSQL_CONFIG) --cflags`
MYSQL_LDFLAGS=`$(MYSQL_CONFIG) --libs`
19
20

SQLITE_CFLAGS=`pkg-config sqlite3 --cflags`
21
22
SQLITE_LDFLAGS=`pkg-config sqlite3 --libs`

23
all: mysql_ubench sqlite_ubench memfile_ubench
24

25
26
doc: dhcp-perf-guide.html dhcp-perf-guide.pdf

Tomek Mrugalski's avatar
Tomek Mrugalski committed
27
mysql_ubench.o: mysql_ubench.cc mysql_ubench.h benchmark.h
28
29
30
31
32
33
	$(CXX) $< -c $(CFLAGS) $(MYSQL_CFLAGS)

benchmark.o: benchmark.cc benchmark.h
	$(CXX) $< -c $(CFLAGS) $(MYSQL_CFLAGS)

mysql_ubench: mysql_ubench.o benchmark.o
34
	$(CXX) $< benchmark.o -o mysql_ubench $(CFLAGS) $(MYSQL_CFLAGS) $(LDFLAGS) $(MYSQL_LDFLAGS)
35

Tomek Mrugalski's avatar
Tomek Mrugalski committed
36
sqlite_ubench.o: sqlite_ubench.cc sqlite_ubench.h benchmark.h
37
38
39
	$(CXX) $< -c $(CFLAGS) $(SQLLITE_CFLAGS)

sqlite_ubench: sqlite_ubench.o benchmark.o
40
	$(CXX) $< benchmark.o -o sqlite_ubench $(CFLAGS) $(SQLITE_CFLAGS) $(LDFLAGS) $(SQLITE_LDFLAGS)
41

Tomek Mrugalski's avatar
Tomek Mrugalski committed
42
memfile_ubench.o: memfile_ubench.cc memfile_ubench.h benchmark.h
43
	$(CXX) $< -c $(CFLAGS) $(MEMFILE_CFLAGS)
44
45

memfile_ubench: memfile_ubench.o benchmark.o
46
	$(CXX) $< benchmark.o -o memfile_ubench $(LDFLAGS) $(MEMFILE_LDFLAGS)
47

48
clean:
49
	rm -f mysql_ubench sqlite_ubench memfile_ubench *.o
50

51
52
53
54
version.ent:
	ln -s ../../../doc/version.ent

dhcp-perf-guide.html: dhcp-perf-guide.xml version.ent
55
56
57
58
59
60
61
62
63
64
	xsltproc --novalid --xinclude --nonet \
		-o $@ \
		--path ../../../doc \
		--stringparam section.autolabel 1 \
		--stringparam section.label.includes.component.label 1 \
		--stringparam html.stylesheet bind10-guide.css \
		http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl \
		dhcp-perf-guide.xml

dhcp-perf-guide.pdf: dhcp-perf-guide.xml
65
	dblatex -P doc.collab.show=0 -P latex.output.revhistory=0 $<