check-in the first batch of files
This commit is contained in:
parent
a9bbc8c401
commit
5aeb3b53c0
|
|
@ -92,7 +92,6 @@ CMakeCache.txt
|
|||
CMakeFiles
|
||||
CMakeScripts
|
||||
Testing
|
||||
Makefile
|
||||
cmake_install.cmake
|
||||
install_manifest.txt
|
||||
compile_commands.json
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
# set environment variable RM_INCLUDE_DIR to the location of redismodule.h
|
||||
ifndef RM_INCLUDE_DIR
|
||||
RM_INCLUDE_DIR=../include/
|
||||
endif
|
||||
|
||||
CFLAGS ?= -g -fPIC -O3 -std=gnu99 -Wall -Wno-unused-function
|
||||
CFLAGS += -I$(RM_INCLUDE_DIR)
|
||||
CC=gcc
|
||||
|
||||
OBJS=util.o strings.o sds.o vector.o alloc.o periodic.o
|
||||
|
||||
all: librmutil.a
|
||||
|
||||
clean:
|
||||
rm -rf *.o *.a
|
||||
|
||||
librmutil.a: $(OBJS)
|
||||
ar rcs $@ $^
|
||||
|
||||
test_vector: test_vector.o vector.o
|
||||
$(CC) -Wall -o $@ $^ -lc -lpthread -O0
|
||||
@(sh -c ./$@)
|
||||
.PHONY: test_vector
|
||||
|
||||
test_periodic: test_periodic.o periodic.o
|
||||
$(CC) -Wall -o $@ $^ -lc -lpthread -O0
|
||||
@(sh -c ./$@)
|
||||
.PHONY: test_periodic
|
||||
|
||||
test: test_periodic test_vector
|
||||
.PHONY: test
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
#set environment variable RM_INCLUDE_DIR to the location of redismodule.h
|
||||
ifndef RM_INCLUDE_DIR
|
||||
RM_INCLUDE_DIR=../include/
|
||||
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 -std=gnu99
|
||||
CC=gcc
|
||||
|
||||
all: rmutil module.so
|
||||
|
||||
rmutil: FORCE
|
||||
$(MAKE) -C $(RMUTIL_LIBDIR)
|
||||
|
||||
module.so: module.o
|
||||
$(LD) -o $@ module.o $(SHOBJ_LDFLAGS) $(LIBS) -L$(RMUTIL_LIBDIR) -lrmutil -lc
|
||||
|
||||
clean:
|
||||
rm -rf *.xo *.so *.o
|
||||
|
||||
FORCE:
|
||||
Loading…
Reference in New Issue