From 1896ff9a646ca04db73af27ff63539fbdda352a3 Mon Sep 17 00:00:00 2001 From: Dvir Volk Date: Sun, 1 May 2016 18:40:47 +0300 Subject: [PATCH] fixed makefile paths --- example/Makefile | 12 ++++++++---- example/module.c | 7 ++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/example/Makefile b/example/Makefile index 2c2dc0b..89267b7 100644 --- a/example/Makefile +++ b/example/Makefile @@ -1,6 +1,10 @@ #set environment variable RM_INCLUDE_DIR to the location of redismodule.h ifndef RM_INCLUDE_DIR - RM_INCLUDE_DIR=../../ + RM_INCLUDE_DIR=../ +endif + +ifndef RMUTIL_LIBDIR + RMUTIL_LIBDIR=../rmutil endif # find the OS @@ -20,13 +24,13 @@ CC=gcc all: module.so -.c.xo: - $(CC) -I. $(CFLAGS) $(SHOBJ_CFLAGS) -fPIC -c $< -o $@ +#c.xo: +#$(CC) -I. $(CFLAGS) $(SHOBJ_CFLAGS) -fPIC -c $< -o $@ #mdma.xo: ./index.h module.so: module.o - $(LD) -o $@ module.o $(SHOBJ_LDFLAGS) $(LIBS) -L../ -lrmutil -lc + $(LD) -o $@ module.o $(SHOBJ_LDFLAGS) $(LIBS) -L$(RMUTIL_LIBDIR) -lrmutil -lc clean: rm -rf *.xo *.so *.o diff --git a/example/module.c b/example/module.c index 9c9a421..295c6d2 100644 --- a/example/module.c +++ b/example/module.c @@ -1,6 +1,6 @@ -#include "../../redismodule.h" -#include "../util.h" -#include "../strings.h" +#include "../redismodule.h" +#include "../rmutil/util.h" +#include "../rmutil/strings.h" /* EXAMPLE.PARSE [SUM ] | [PROD ] * Demonstrates the automatic arg parsing utility. @@ -14,6 +14,7 @@ int ParseCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) { return RedisModule_WrongArity(ctx); } + // init auto memory for created strings RedisModule_AutoMemory(ctx); long long x,y;