diff options
Diffstat (limited to 'examples/redis-unstable/src/modules/Makefile')
| -rw-r--r-- | examples/redis-unstable/src/modules/Makefile | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/examples/redis-unstable/src/modules/Makefile b/examples/redis-unstable/src/modules/Makefile new file mode 100644 index 0000000..b9ef578 --- /dev/null +++ b/examples/redis-unstable/src/modules/Makefile | |||
| @@ -0,0 +1,69 @@ | |||
| 1 | |||
| 2 | # find the OS | ||
| 3 | uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') | ||
| 4 | |||
| 5 | # Compile flags for linux / osx | ||
| 6 | ifeq ($(uname_S),Linux) | ||
| 7 | SHOBJ_CFLAGS ?= -W -Wall -fno-common -g -ggdb -std=c99 -O2 | ||
| 8 | SHOBJ_LDFLAGS ?= -shared | ||
| 9 | else | ||
| 10 | SHOBJ_CFLAGS ?= -W -Wall -dynamic -fno-common -g -ggdb -std=c99 -O2 | ||
| 11 | SHOBJ_LDFLAGS ?= -bundle -undefined dynamic_lookup | ||
| 12 | endif | ||
| 13 | |||
| 14 | # OS X 11.x doesn't have /usr/lib/libSystem.dylib and needs an explicit setting. | ||
| 15 | ifeq ($(uname_S),Darwin) | ||
| 16 | ifeq ("$(wildcard /usr/lib/libSystem.dylib)","") | ||
| 17 | LIBS = -L /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -lsystem | ||
| 18 | endif | ||
| 19 | endif | ||
| 20 | |||
| 21 | .SUFFIXES: .c .so .xo .o | ||
| 22 | |||
| 23 | all: helloworld.so hellotype.so helloblock.so hellocluster.so hellotimer.so hellodict.so hellohook.so helloacl.so | ||
| 24 | |||
| 25 | .c.xo: | ||
| 26 | $(CC) -I. $(CFLAGS) $(SHOBJ_CFLAGS) -fPIC -c $< -o $@ | ||
| 27 | |||
| 28 | helloworld.xo: ../redismodule.h | ||
| 29 | |||
| 30 | helloworld.so: helloworld.xo | ||
| 31 | $(LD) -o $@ $^ $(SHOBJ_LDFLAGS) $(LIBS) -lc | ||
| 32 | |||
| 33 | hellotype.xo: ../redismodule.h | ||
| 34 | |||
| 35 | hellotype.so: hellotype.xo | ||
| 36 | $(LD) -o $@ $^ $(SHOBJ_LDFLAGS) $(LIBS) -lc | ||
| 37 | |||
| 38 | helloblock.xo: ../redismodule.h | ||
| 39 | |||
| 40 | helloblock.so: helloblock.xo | ||
| 41 | $(LD) -o $@ $^ $(SHOBJ_LDFLAGS) $(LIBS) -lpthread -lc | ||
| 42 | |||
| 43 | hellocluster.xo: ../redismodule.h | ||
| 44 | |||
| 45 | hellocluster.so: hellocluster.xo | ||
| 46 | $(LD) -o $@ $^ $(SHOBJ_LDFLAGS) $(LIBS) -lc | ||
| 47 | |||
| 48 | hellotimer.xo: ../redismodule.h | ||
| 49 | |||
| 50 | hellotimer.so: hellotimer.xo | ||
| 51 | $(LD) -o $@ $^ $(SHOBJ_LDFLAGS) $(LIBS) -lc | ||
| 52 | |||
| 53 | hellodict.xo: ../redismodule.h | ||
| 54 | |||
| 55 | hellodict.so: hellodict.xo | ||
| 56 | $(LD) -o $@ $^ $(SHOBJ_LDFLAGS) $(LIBS) -lc | ||
| 57 | |||
| 58 | hellohook.xo: ../redismodule.h | ||
| 59 | |||
| 60 | hellohook.so: hellohook.xo | ||
| 61 | $(LD) -o $@ $^ $(SHOBJ_LDFLAGS) $(LIBS) -lc | ||
| 62 | |||
| 63 | helloacl.xo: ../redismodule.h | ||
| 64 | |||
| 65 | helloacl.so: helloacl.xo | ||
| 66 | $(LD) -o $@ $^ $(SHOBJ_LDFLAGS) $(LIBS) -lc | ||
| 67 | |||
| 68 | clean: | ||
| 69 | rm -rf *.xo *.so | ||
