Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@

TARGETS = zht_c_binding.exe zht_benchmark.exe zht_server.exe
TARGETS = zht_c_binding zht_benchmark zht_server
CC = gcc
CCFLAGS = -g
LIBFLAGS = -lstdc++ -lrt -lpthread -lm -lc -lprotobuf -lprotobuf-c

LIBFLAGS = -lstdc++ -lrt -lpthread -lm -lc -lprotobuf


server: zht_server
all: $(TARGETS)



zht_c_binding.exe: c_zhtclient_main.o c_zhtclient.o c_zhtclientStd.o cpp_zhtclient.o meta.pb-c.o lru_cache.o meta.pb.o net_util.o novoht.o zht_util.o
$(CC) $(CCFLAGS) -o $@ $^ $(LIBFLAGS)
zht_c_binding: c_zhtclient_main.o c_zhtclient.o c_zhtclientStd.o cpp_zhtclient.o meta.pb-c.o lru_cache.o meta.pb.o net_util.o novoht.o zht_util.o
$(CC) $(CCFLAGS) -o $@ $^ $(LIBFLAGS) -lprotobuf-c


zht_benchmark.exe: benchmark_client.o cpp_zhtclient.o meta.pb-c.o lru_cache.o meta.pb.o net_util.o novoht.o zht_util.o
zht_benchmark: benchmark_client.o cpp_zhtclient.o meta.pb-c.o lru_cache.o meta.pb.o net_util.o novoht.o zht_util.o
$(CC) $(CCFLAGS) -o $@ $^ $(LIBFLAGS)



zht_server.exe: server_general.o meta.pb-c.o lru_cache.o meta.pb.o net_util.o novoht.o zht_util.o
zht_server: server_general.o lru_cache.o meta.pb.o net_util.o novoht.o zht_util.o
$(CC) $(CCFLAGS) -o $@ $^ $(LIBFLAGS)


%.o: %.c
%.o: %.cpp
$(CC) $(CCFLAGS) -c $< $^ $(LIBFLAGS)



c_zhtclient_main.o: c_zhtclient_main.c
Expand All @@ -49,6 +50,6 @@ zht_util.o: zht_util.cpp

clean:
rm *.o
rm *.exe
rm $(TARGETS)
rm *.gch*
rm *.bin*
rm *.bin*
2 changes: 2 additions & 0 deletions src/net_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include "net_util.h"
#include "zht_util.h"

#include <unistd.h>

#define SOCKET_ERROR -1

class BdRecvBase;
Expand Down
1 change: 1 addition & 0 deletions src/novoht.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/
#include <stddef.h>
#include <unistd.h>
#include <stdlib.h>
#include <new>
#include <string>
Expand Down
2 changes: 2 additions & 0 deletions src/zht_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
# include <errno.h>
#include "net_util.h"
#include "zht_util.h"

#include <unistd.h>
//struct timeval tp;
using namespace std;

Expand Down