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