2017-01-27 02:53:40 +00:00
|
|
|
DHT_DIR = dht
|
|
|
|
CC = gcc
|
2017-03-16 08:45:44 +00:00
|
|
|
CFLAGS = -O0 -I../include -I../../c-multiaddr/include -I$(DHT_DIR) -g3
|
2017-01-27 02:53:40 +00:00
|
|
|
LFLAGS =
|
|
|
|
DEPS = $(DHT_DIR)/dht.h
|
|
|
|
OBJS = kademlia.o dht.o
|
|
|
|
|
|
|
|
%.o: %.c $(DEPS)
|
|
|
|
$(CC) -c -o $@ $< $(CFLAGS)
|
|
|
|
|
|
|
|
all: $(OBJS)
|
|
|
|
|
|
|
|
$(DHT_DIR)/dht.h:
|
|
|
|
git clone https://github.com/jech/dht.git $(DHT_DIR)
|
|
|
|
|
|
|
|
dht.c: $(DEPS)
|
|
|
|
ln -s $(DHT_DIR)/dht.c .
|
|
|
|
|
2017-03-16 12:54:36 +00:00
|
|
|
kademlia_test: $(OBJS)
|
|
|
|
$(CC) -o kademlia_test kademlia_test.c kademlia.o dht.o $(CFLAGS) -pthread ../libp2p.a ../../c-multiaddr/libmultiaddr.a -lm
|
|
|
|
|
2017-01-27 02:53:40 +00:00
|
|
|
clean:
|
2017-03-16 12:54:36 +00:00
|
|
|
rm -f kademlia_test $(OBJS) dht.c
|
2017-01-27 02:53:40 +00:00
|
|
|
rm -rf $(DHT_DIR)
|