2019-03-24 06:03:03 -04:00
|
|
|
|
|
|
|
# find the OS
|
|
|
|
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
|
|
|
|
|
2020-12-13 10:09:54 -05:00
|
|
|
ifeq ($(uname_S),Darwin)
|
2019-03-24 06:03:03 -04:00
|
|
|
SHOBJ_CFLAGS ?= -W -Wall -dynamic -fno-common -g -ggdb -std=c99 -O2
|
|
|
|
SHOBJ_LDFLAGS ?= -bundle -undefined dynamic_lookup
|
2020-12-13 10:09:54 -05:00
|
|
|
else # Linux, others
|
|
|
|
SHOBJ_CFLAGS ?= -W -Wall -fno-common -g -ggdb -std=c99 -O2
|
|
|
|
SHOBJ_LDFLAGS ?= -shared
|
2019-03-24 06:03:03 -04:00
|
|
|
endif
|
|
|
|
|
2021-02-04 04:37:28 -05:00
|
|
|
# Needed to satisfy __stack_chk_fail_local on Linux with -m32, due to gcc
|
|
|
|
# -fstack-protector by default. Breaks on FreeBSD so we exclude it.
|
|
|
|
ifneq ($(uname_S),FreeBSD)
|
|
|
|
LIBS = -lc
|
|
|
|
endif
|
|
|
|
|
2019-10-23 12:32:35 -04:00
|
|
|
TEST_MODULES = \
|
|
|
|
commandfilter.so \
|
2021-06-22 05:26:48 -04:00
|
|
|
basics.so \
|
2019-10-23 12:32:35 -04:00
|
|
|
testrdb.so \
|
|
|
|
fork.so \
|
|
|
|
infotest.so \
|
|
|
|
propagate.so \
|
2019-10-24 02:38:52 -04:00
|
|
|
misc.so \
|
2018-03-29 06:46:13 -04:00
|
|
|
hooks.so \
|
2019-10-17 08:37:01 -04:00
|
|
|
blockonkeys.so \
|
2021-01-29 08:38:30 -05:00
|
|
|
blockonbackground.so \
|
2019-11-19 05:08:02 -05:00
|
|
|
scan.so \
|
2019-02-25 20:23:11 -05:00
|
|
|
datatype.so \
|
2021-06-16 02:45:49 -04:00
|
|
|
datatype2.so \
|
2020-07-23 05:38:51 -04:00
|
|
|
auth.so \
|
2020-09-09 09:01:16 -04:00
|
|
|
keyspace_events.so \
|
2020-10-05 10:06:35 -04:00
|
|
|
blockedclient.so \
|
2020-11-11 15:57:33 -05:00
|
|
|
getkeys.so \
|
2020-11-16 03:34:04 -05:00
|
|
|
test_lazyfree.so \
|
|
|
|
timer.so \
|
2021-01-28 09:19:43 -05:00
|
|
|
defragtest.so \
|
2021-02-15 04:40:05 -05:00
|
|
|
hash.so \
|
2021-02-05 12:54:01 -05:00
|
|
|
zset.so \
|
2021-06-16 02:45:49 -04:00
|
|
|
stream.so \
|
2020-09-09 09:01:16 -04:00
|
|
|
|
2019-03-24 06:03:03 -04:00
|
|
|
|
2019-10-23 12:32:35 -04:00
|
|
|
.PHONY: all
|
2019-03-24 06:03:03 -04:00
|
|
|
|
2019-10-23 12:32:35 -04:00
|
|
|
all: $(TEST_MODULES)
|
2019-09-27 05:24:06 -04:00
|
|
|
|
2020-05-27 11:09:09 -04:00
|
|
|
32bit:
|
|
|
|
$(MAKE) CFLAGS="-m32" LDFLAGS="-melf_i386"
|
|
|
|
|
2019-10-23 12:32:35 -04:00
|
|
|
%.xo: %.c ../../src/redismodule.h
|
|
|
|
$(CC) -I../../src $(CFLAGS) $(SHOBJ_CFLAGS) -fPIC -c $< -o $@
|
2019-09-30 13:47:35 -04:00
|
|
|
|
2019-10-23 12:32:35 -04:00
|
|
|
%.so: %.xo
|
2021-02-03 10:35:28 -05:00
|
|
|
$(LD) -o $@ $< $(SHOBJ_LDFLAGS) $(LDFLAGS) $(LIBS)
|
2019-07-24 05:58:15 -04:00
|
|
|
|
2019-10-23 12:32:35 -04:00
|
|
|
.PHONY: clean
|
2019-10-23 12:38:30 -04:00
|
|
|
|
2019-10-23 12:32:35 -04:00
|
|
|
clean:
|
|
|
|
rm -f $(TEST_MODULES) $(TEST_MODULES:.so=.xo)
|