Skip to content

Commit

Permalink
new pika
Browse files Browse the repository at this point in the history
  • Loading branch information
songzhao committed Jul 8, 2015
1 parent 21e67a0 commit 5c339fd
Show file tree
Hide file tree
Showing 217 changed files with 3,124 additions and 184,641 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,5 @@ log/


# third party
third/*
gdb.txt
tags
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "third/leveldb"]
path = third/leveldb
url = https://github.com/google/leveldb.git
[submodule "third/glog"]
path = third/glog
url = https://github.com/google/glog.git
18 changes: 10 additions & 8 deletions Makefile
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,24 @@ CXX = g++
CXXFLAGS = -Wall -W -DDEBUG -g -O0 -D__XDEBUG__ -fPIC -Wno-unused-function
OBJECT = pika
SRC_DIR = ./src
THIRD_PATH = ./third/
THIRD_PATH = ./third
OUTPUT = ./output


INCLUDE_PATH = -I./include/ \
-I./src/ \
-I$(THIRD_PATH)/glog-0.3.3/src/ \
-I$(THIRD_PATH)/glog/src/ \
-I$(THIRD_PATH)/leveldb/include/

LIB_PATH = -L./ \
-L$(THIRD_PATH)/glog-0.3.3/ \
-L/usr/local/lib/ \
-L$(THIRD_PATH)/leveldb/


LIBS = -lpthread \
-lprotobuf \
-lglog \
-lleveldb

DYNAMIC_LIBS = -lglog
GLOG = /usr/local/lib/libglog.a

.PHONY: all clean

Expand All @@ -45,8 +43,12 @@ all: $(OBJECT)
@echo "Success, go, go, go..."


$(OBJECT): $(OBJS)
$(CXX) $(CXXFLAGS) -o $@ $^ $(INCLUDE_PATH) $(LIB_PATH) -Wl,-Bdynamic $(LIBS) $(DYNAMIC_LIBS)
$(OBJECT): $(GLOG) $(OBJS)
make -C $(THIRD_PATH)/leveldb/
$(CXX) $(CXXFLAGS) -o $@ $(OBJS) $(INCLUDE_PATH) $(LIB_PATH) -Wl,-Bdynamic $(LIBS)

$(GLOG):
cd $(THIRD_PATH)/glog; ./configure; make; echo '*' > $(CURDIR)/third/glog/.gitignore; sudo make install;

$(OBJS): %.o : %.cc
$(CXX) $(CXXFLAGS) -c $< -o $@ $(INCLUDE_PATH)
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ Pika

Pika is a simple nosql database.
Pika used leveldb as storage engine.
The protocol used to contact with Pika is defined in google's proto buffer, The
proto buffer file is bada_sdk.proto
The protocol used to contact with Pika is redis protocol

### Thread Model
Pika used multi threads model. The main thread accept the request and then send
Expand Down
Loading

0 comments on commit 5c339fd

Please sign in to comment.