aboutsummaryrefslogtreecommitdiff
path: root/examples/redis-unstable/tests/modules/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'examples/redis-unstable/tests/modules/Makefile')
-rw-r--r--examples/redis-unstable/tests/modules/Makefile106
1 files changed, 106 insertions, 0 deletions
diff --git a/examples/redis-unstable/tests/modules/Makefile b/examples/redis-unstable/tests/modules/Makefile
new file mode 100644
index 0000000..f141234
--- /dev/null
+++ b/examples/redis-unstable/tests/modules/Makefile
@@ -0,0 +1,106 @@
1
2# find the OS
3uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
4
5warning_cflags = -W -Wall -Wno-missing-field-initializers
6ifeq ($(uname_S),Darwin)
7 SHOBJ_CFLAGS ?= $(warning_cflags) -dynamic -fno-common -g -ggdb -std=gnu11 -O2
8 SHOBJ_LDFLAGS ?= -bundle -undefined dynamic_lookup
9else # Linux, others
10 SHOBJ_CFLAGS ?= $(warning_cflags) -fno-common -g -ggdb -std=gnu11 -O2
11 SHOBJ_LDFLAGS ?= -shared
12endif
13
14CLANG := $(findstring clang,$(shell sh -c '$(CC) --version | head -1'))
15
16ifeq ($(SANITIZER),memory)
17ifeq (clang, $(CLANG))
18 LD=clang
19 MALLOC=libc
20 CFLAGS+=-fsanitize=memory -fsanitize-memory-track-origins=2 -fno-sanitize-recover=all -fno-omit-frame-pointer
21 LDFLAGS+=-fsanitize=memory
22else
23 $(error "MemorySanitizer needs to be compiled and linked with clang. Please use CC=clang")
24endif
25endif
26
27
28# This is a hack to override the default CC. When running with SANITIZER=memory
29# tough we want to keep the compiler as clang as MSan is not supported for gcc
30ifeq ($(uname_S),Linux)
31ifneq ($(SANITIZER),memory)
32 LD = gcc
33 CC = gcc
34endif
35endif
36
37# OS X 11.x doesn't have /usr/lib/libSystem.dylib and needs an explicit setting.
38ifeq ($(uname_S),Darwin)
39ifeq ("$(wildcard /usr/lib/libSystem.dylib)","")
40LIBS = -L /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -lsystem
41endif
42endif
43
44TEST_MODULES = \
45 commandfilter.so \
46 basics.so \
47 testrdb.so \
48 fork.so \
49 infotest.so \
50 propagate.so \
51 misc.so \
52 hooks.so \
53 blockonkeys.so \
54 blockonbackground.so \
55 scan.so \
56 datatype.so \
57 datatype2.so \
58 auth.so \
59 keyspace_events.so \
60 blockedclient.so \
61 getkeys.so \
62 getchannels.so \
63 test_lazyfree.so \
64 timer.so \
65 defragtest.so \
66 keyspecs.so \
67 hash.so \
68 zset.so \
69 stream.so \
70 mallocsize.so \
71 aclcheck.so \
72 list.so \
73 subcommands.so \
74 reply.so \
75 cmdintrospection.so \
76 eventloop.so \
77 moduleconfigs.so \
78 moduleconfigstwo.so \
79 publish.so \
80 usercall.so \
81 postnotifications.so \
82 moduleauthtwo.so \
83 rdbloadsave.so \
84 crash.so \
85 internalsecret.so \
86 configaccess.so \
87 test_keymeta.so \
88 atomicslotmigration.so
89
90.PHONY: all
91
92all: $(TEST_MODULES)
93
9432bit:
95 $(MAKE) CFLAGS="-m32" LDFLAGS="-m32"
96
97%.xo: %.c ../../src/redismodule.h
98 $(CC) -I../../src $(CFLAGS) $(SHOBJ_CFLAGS) -fPIC -c $< -o $@
99
100%.so: %.xo
101 $(LD) -o $@ $^ $(SHOBJ_LDFLAGS) $(LDFLAGS) $(LIBS)
102
103.PHONY: clean
104
105clean:
106 rm -f $(TEST_MODULES) $(TEST_MODULES:.so=.xo)