diff options
Diffstat (limited to 'examples/redis-unstable/tests/modules/Makefile')
| -rw-r--r-- | examples/redis-unstable/tests/modules/Makefile | 106 |
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 | ||
| 3 | uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') | ||
| 4 | |||
| 5 | warning_cflags = -W -Wall -Wno-missing-field-initializers | ||
| 6 | ifeq ($(uname_S),Darwin) | ||
| 7 | SHOBJ_CFLAGS ?= $(warning_cflags) -dynamic -fno-common -g -ggdb -std=gnu11 -O2 | ||
| 8 | SHOBJ_LDFLAGS ?= -bundle -undefined dynamic_lookup | ||
| 9 | else # Linux, others | ||
| 10 | SHOBJ_CFLAGS ?= $(warning_cflags) -fno-common -g -ggdb -std=gnu11 -O2 | ||
| 11 | SHOBJ_LDFLAGS ?= -shared | ||
| 12 | endif | ||
| 13 | |||
| 14 | CLANG := $(findstring clang,$(shell sh -c '$(CC) --version | head -1')) | ||
| 15 | |||
| 16 | ifeq ($(SANITIZER),memory) | ||
| 17 | ifeq (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 | ||
| 22 | else | ||
| 23 | $(error "MemorySanitizer needs to be compiled and linked with clang. Please use CC=clang") | ||
| 24 | endif | ||
| 25 | endif | ||
| 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 | ||
| 30 | ifeq ($(uname_S),Linux) | ||
| 31 | ifneq ($(SANITIZER),memory) | ||
| 32 | LD = gcc | ||
| 33 | CC = gcc | ||
| 34 | endif | ||
| 35 | endif | ||
| 36 | |||
| 37 | # OS X 11.x doesn't have /usr/lib/libSystem.dylib and needs an explicit setting. | ||
| 38 | ifeq ($(uname_S),Darwin) | ||
| 39 | ifeq ("$(wildcard /usr/lib/libSystem.dylib)","") | ||
| 40 | LIBS = -L /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -lsystem | ||
| 41 | endif | ||
| 42 | endif | ||
| 43 | |||
| 44 | TEST_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 | |||
| 92 | all: $(TEST_MODULES) | ||
| 93 | |||
| 94 | 32bit: | ||
| 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 | |||
| 105 | clean: | ||
| 106 | rm -f $(TEST_MODULES) $(TEST_MODULES:.so=.xo) | ||
