summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile19
-rw-r--r--adapters/libev.h (renamed from extra/hiredis/libev.h)4
-rw-r--r--adapters/libevent.h (renamed from extra/hiredis/libevent.h)4
-rw-r--r--example-libev.c (renamed from libev-example.c)5
-rw-r--r--example-libevent.c (renamed from libevent-example.c)5
5 files changed, 20 insertions, 17 deletions
diff --git a/Makefile b/Makefile
index a445fd6..c52d7fe 100644
--- a/Makefile
+++ b/Makefile
@@ -37,11 +37,12 @@ all: ${DYLIBNAME} ${BINS}
# Deps (use make dep to generate this)
anet.o: anet.c fmacros.h anet.h
async.o: async.c async.h hiredis.h sds.h util.h
+example-libev.o: example-libev.c hiredis.h async.h adapters/libev.h
+example-libevent.o: example-libevent.c hiredis.h async.h adapters/libevent.h
example.o: example.c hiredis.h
hiredis.o: hiredis.c hiredis.h anet.h sds.h util.h
sds.o: sds.c sds.h
test.o: test.c hiredis.h
-
${DYLIBNAME}: ${OBJ}
${DYLIB_MAKE_CMD}
@@ -52,23 +53,23 @@ dynamic: ${DYLIBNAME}
static: ${STLIBNAME}
# Binaries:
+hiredis-example-libevent: ${DYLIBNAME}
+ $(CC) -o $@ $(CCOPT) $(DEBUG) -L. -lhiredis -levent -Wl,-rpath,. example-libevent.c
+
+hiredis-example-libev: ${DYLIBNAME}
+ $(CC) -o $@ $(CCOPT) $(DEBUG) -L. -lhiredis -lev -Wl,-rpath,. example-libev.c
+
hiredis-%: %.o ${DYLIBNAME}
- $(CC) -o $@ $(CCOPT) $(DEBUG) -L. -l hiredis -Wl,-rpath,. $<
+ $(CC) -o $@ $(CCOPT) $(DEBUG) -L. -lhiredis -Wl,-rpath,. $<
test: hiredis-test
./hiredis-test
-libevent-example: extra/hiredis/libevent.h libevent-example.c ${DYLIBNAME}
- $(CC) -o $@ $(CCOPT) $(DEBUG) -I. -Iextra -L. -lhiredis -levent libevent-example.c
-
-libev-example: extra/hiredis/libev.h libev-example.c ${DYLIBNAME}
- $(CC) -o $@ $(CCOPT) $(DEBUG) -I. -Iextra -L. -lhiredis -lev libev-example.c
-
.c.o:
$(CC) -c $(CFLAGS) $(DEBUG) $(COMPILE_TIME) $<
clean:
- rm -rf ${DYLIBNAME} ${STLIBNAME} $(BINS) *-example *.o *.gcda *.gcno *.gcov
+ rm -rf ${DYLIBNAME} ${STLIBNAME} $(BINS) hiredis-example* *.o *.gcda *.gcno *.gcov
dep:
$(CC) -MM *.c
diff --git a/extra/hiredis/libev.h b/adapters/libev.h
index fcb7c24..79c069d 100644
--- a/extra/hiredis/libev.h
+++ b/adapters/libev.h
@@ -1,7 +1,7 @@
#include <sys/types.h>
#include <ev.h>
-#include <hiredis.h>
-#include <async.h>
+#include "../hiredis.h"
+#include "../async.h"
typedef struct redisLibevEvents {
redisAsyncContext *context;
diff --git a/extra/hiredis/libevent.h b/adapters/libevent.h
index f2851f9..1b759c1 100644
--- a/extra/hiredis/libevent.h
+++ b/adapters/libevent.h
@@ -1,7 +1,7 @@
#include <sys/types.h>
#include <event.h>
-#include <hiredis.h>
-#include <async.h>
+#include "../hiredis.h"
+#include "../async.h"
typedef struct redisLibeventEvents {
redisAsyncContext *context;
diff --git a/libev-example.c b/example-libev.c
index 2d0bc8b..3495b2f 100644
--- a/libev-example.c
+++ b/example-libev.c
@@ -1,9 +1,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <hiredis/libev.h>
-#include <async.h>
#include <signal.h>
+#include "hiredis.h"
+#include "async.h"
+#include "adapters/libev.h"
void getCallback(redisAsyncContext *c, redisReply *reply, void *privdata) {
printf("argv[%s]: %s\n", (char*)privdata, reply->str);
diff --git a/libevent-example.c b/example-libevent.c
index a5a24b5..101fa71 100644
--- a/libevent-example.c
+++ b/example-libevent.c
@@ -1,9 +1,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <hiredis/libevent.h>
-#include <async.h>
#include <signal.h>
+#include "hiredis.h"
+#include "async.h"
+#include "adapters/libevent.h"
void getCallback(redisAsyncContext *c, redisReply *reply, void *privdata) {
printf("argv[%s]: %s\n", (char*)privdata, reply->str);