diff options
Diffstat (limited to 'examples/redis-unstable/modules/vector-sets/Makefile')
| -rw-r--r-- | examples/redis-unstable/modules/vector-sets/Makefile | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/examples/redis-unstable/modules/vector-sets/Makefile b/examples/redis-unstable/modules/vector-sets/Makefile deleted file mode 100644 index f8c05c9..0000000 --- a/examples/redis-unstable/modules/vector-sets/Makefile +++ /dev/null | |||
| @@ -1,87 +0,0 @@ | |||
| 1 | # Compiler settings | ||
| 2 | CC = cc | ||
| 3 | |||
| 4 | ifdef SANITIZER | ||
| 5 | ifeq ($(SANITIZER),address) | ||
| 6 | SAN=-fsanitize=address | ||
| 7 | else | ||
| 8 | ifeq ($(SANITIZER),undefined) | ||
| 9 | SAN=-fsanitize=undefined | ||
| 10 | else | ||
| 11 | ifeq ($(SANITIZER),thread) | ||
| 12 | SAN=-fsanitize=thread | ||
| 13 | else | ||
| 14 | $(error "unknown sanitizer=${SANITIZER}") | ||
| 15 | endif | ||
| 16 | endif | ||
| 17 | endif | ||
| 18 | endif | ||
| 19 | |||
| 20 | CFLAGS = -O2 -Wall -Wextra -g $(SAN) -std=c11 | ||
| 21 | LDFLAGS = -lm $(SAN) | ||
| 22 | |||
| 23 | # Detect OS | ||
| 24 | uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') | ||
| 25 | uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not') | ||
| 26 | |||
| 27 | # Shared library compile flags for linux / osx | ||
| 28 | ifeq ($(uname_S),Linux) | ||
| 29 | SHOBJ_CFLAGS ?= -W -Wall -fno-common -g -ggdb -std=c11 -O2 | ||
| 30 | SHOBJ_LDFLAGS ?= -shared | ||
| 31 | ifneq (,$(findstring armv,$(uname_M))) | ||
| 32 | SHOBJ_LDFLAGS += -latomic | ||
| 33 | endif | ||
| 34 | ifneq (,$(findstring aarch64,$(uname_M))) | ||
| 35 | SHOBJ_LDFLAGS += -latomic | ||
| 36 | endif | ||
| 37 | else | ||
| 38 | SHOBJ_CFLAGS ?= -W -Wall -dynamic -fno-common -g -ggdb -std=c11 -O3 | ||
| 39 | SHOBJ_LDFLAGS ?= -bundle -undefined dynamic_lookup | ||
| 40 | endif | ||
| 41 | |||
| 42 | # OS X 11.x doesn't have /usr/lib/libSystem.dylib and needs an explicit setting. | ||
| 43 | ifeq ($(uname_S),Darwin) | ||
| 44 | ifeq ("$(wildcard /usr/lib/libSystem.dylib)","") | ||
| 45 | LIBS = -L /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -lsystem | ||
| 46 | endif | ||
| 47 | endif | ||
| 48 | |||
| 49 | .SUFFIXES: .c .so .xo .o | ||
| 50 | |||
| 51 | all: vset.so | ||
| 52 | |||
| 53 | .c.xo: | ||
| 54 | $(CC) -I. $(CFLAGS) $(SHOBJ_CFLAGS) -fPIC -c $< -o $@ | ||
| 55 | |||
| 56 | vset.xo: ../../src/redismodule.h expr.c | ||
| 57 | |||
| 58 | vset.so: vset.xo hnsw.xo vset_config.xo | ||
| 59 | $(CC) -o $@ $^ $(SHOBJ_LDFLAGS) $(LIBS) $(SAN) -lc | ||
| 60 | |||
| 61 | # Example sources / objects | ||
| 62 | SRCS = hnsw.c w2v.c vset_config.c | ||
| 63 | OBJS = $(SRCS:.c=.o) | ||
| 64 | |||
| 65 | TARGET = w2v | ||
| 66 | MODULE = vset.so | ||
| 67 | |||
| 68 | # Default target | ||
| 69 | all: $(TARGET) $(MODULE) | ||
| 70 | |||
| 71 | # Example linking rule | ||
| 72 | $(TARGET): $(OBJS) | ||
| 73 | $(CC) $(OBJS) $(LDFLAGS) -o $(TARGET) | ||
| 74 | |||
| 75 | # Compilation rule for object files | ||
| 76 | %.o: %.c | ||
| 77 | $(CC) $(CFLAGS) -c $< -o $@ | ||
| 78 | |||
| 79 | expr-test: expr.c fastjson.c fastjson_test.c | ||
| 80 | $(CC) $(CFLAGS) expr.c -o expr-test -DTEST_MAIN -lm | ||
| 81 | |||
| 82 | # Clean rule | ||
| 83 | clean: | ||
| 84 | rm -f $(TARGET) $(OBJS) *.xo *.so | ||
| 85 | |||
| 86 | # Declare phony targets | ||
| 87 | .PHONY: all clean | ||
