summaryrefslogtreecommitdiff
path: root/db/makefile
blob: 59fec8d84046a0a39184c0fbf1530c26f57f3c6d (plain)
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
# makefile for our db project

FLAGS= ${CFLAGS} -fPIC -ggdb -pthread -O3  -I .. -Isrc/p -I/src/p/db -L/usr/local/lib -L/usr/lib -rdynamic

LIB_DEPS = -lpcrecpp -lpcre
LIB_BOOST = -lboost_thread -lboost_filesystem

LIBS= $(LIB_DEPS)  $(LIB_BOOST) -lstdc++

JVM_LIBS = -L/opt/java/lib/

OBJS=../stdafx.o ../util/sock.o ../grid/message.o ../util/mmap.o pdfile.o query.o jsobj.o introspect.o btree.o clientcursor.o ../util/util.o javajs.o tests.o json.o

# ../grid/protorecv.o ../grid/protosend.o

GPP = g++

#
#  get platform-specific flags and overrides
#
include makefile.$(shell uname -s).$(shell uname -m)

#
#  get any local overrides from makefile.local  Sorry about the double-negative
#
-include makefile.local

#
#  now, get the version of GPP.  Requirement is 4.2
#
_GPP_VER := $(shell $(GPP) -dumpversion 2>&1 )
_REQ_GPP_VER = 4.2

.cpp.o:
	$(GPP) -c $(FLAGS) $< -o $@

# Our convention is that passing 'quicktest' on the command line means run 
# fast regressions and then immediately exit.  That way you know immediately if you
# broke something horribly.

db: $(OBJS) db.o  
	$(GPP) $(FLAGS) -o $@ $(OBJS) db.o $(LIBS) $(JVM_LIBS)
#	-./db quicktest
    
javatest: javatest.o $(OBJS)
	$(GPP) $(FLAGS) -o $@ javatest.o $(OBJS) $(LIBS) $(JVM_LIBS)

javatest2: javatest.o javajs.o
	$(GPP) $(FLAGS) -o javatest2 javatest.o javajs.o $(LIBS) $(JVM_LIBS)

clean:
	-rm -f $(OBJS) db.o
	-rm -f db
	-rm -f *.o

cleandb:
	rm /data/db/*

/usr/local/lib/libpcrecpp.a:
	cat pcre.txt

pcre:
	curl -O ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-7.4.tar.gz
	tar -xzf pcre-7.4.tar.gz 
	cd pcre-7.4 && ./configure --enable-utf8 --with-match-limit=200000 --with-match-limit-recursion=4000 && make && make install

info:
	@echo ''
	@echo 'GPP command :' $(GPP)
	@echo 'Using version of GPP :' $(_GPP_VER)
	@echo 'Req version of GPP :' $(_REQ_GPP_VER)
	@# todo - determine if we have the right version of gcc and error if not
	@echo ''