You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#set environment variable RM_INCLUDE_DIR to the location of redismodule.h
|
|
|
|
ifndef RM_INCLUDE_DIR
|
|
|
|
RM_INCLUDE_DIR=../
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef RMUTIL_LIBDIR
|
|
|
|
RMUTIL_LIBDIR=../rmutil
|
|
|
|
endif
|
|
|
|
|
|
|
|
# find the OS
|
|
|
|
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
|
|
|
|
|
|
|
|
# Compile flags for linux / osx
|
|
|
|
ifeq ($(uname_S),Linux)
|
|
|
|
SHOBJ_CFLAGS ?= -fno-common -g -ggdb
|
|
|
|
SHOBJ_LDFLAGS ?= -shared -Bsymbolic
|
|
|
|
else
|
|
|
|
SHOBJ_CFLAGS ?= -dynamic -fno-common -g -ggdb
|
|
|
|
SHOBJ_LDFLAGS ?= -bundle -undefined dynamic_lookup
|
|
|
|
endif
|
|
|
|
CFLAGS = -I$(RM_INCLUDE_DIR) -Wall -g -fPIC -lc -lm -Og -std=gnu99
|
|
|
|
CC=gcc
|
|
|
|
.SUFFIXES: .c .so .xo .o
|
|
|
|
|
|
|
|
all: module.so
|
|
|
|
|
|
|
|
#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$(RMUTIL_LIBDIR) -lrmutil -lc
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf *.xo *.so *.o
|
|
|
|
|