2019-03-24 10:03:03 +00:00
|
|
|
|
|
|
|
# find the OS
|
|
|
|
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
|
|
|
|
|
|
|
|
# Compile flags for linux / osx
|
|
|
|
ifeq ($(uname_S),Linux)
|
|
|
|
SHOBJ_CFLAGS ?= -W -Wall -fno-common -g -ggdb -std=c99 -O2
|
|
|
|
SHOBJ_LDFLAGS ?= -shared
|
|
|
|
else
|
|
|
|
SHOBJ_CFLAGS ?= -W -Wall -dynamic -fno-common -g -ggdb -std=c99 -O2
|
|
|
|
SHOBJ_LDFLAGS ?= -bundle -undefined dynamic_lookup
|
|
|
|
endif
|
|
|
|
|
2019-10-23 16:32:35 +00:00
|
|
|
TEST_MODULES = \
|
|
|
|
commandfilter.so \
|
|
|
|
testrdb.so \
|
|
|
|
fork.so \
|
|
|
|
infotest.so \
|
|
|
|
propagate.so \
|
2019-10-24 06:38:52 +00:00
|
|
|
misc.so \
|
2018-03-29 10:46:13 +00:00
|
|
|
hooks.so \
|
2019-10-17 12:37:01 +00:00
|
|
|
blockonkeys.so \
|
2019-11-19 10:08:02 +00:00
|
|
|
scan.so \
|
2019-02-26 01:23:11 +00:00
|
|
|
datatype.so \
|
|
|
|
auth.so
|
2019-03-24 10:03:03 +00:00
|
|
|
|
2019-10-23 16:32:35 +00:00
|
|
|
.PHONY: all
|
2019-03-24 10:03:03 +00:00
|
|
|
|
2019-10-23 16:32:35 +00:00
|
|
|
all: $(TEST_MODULES)
|
2019-09-27 09:24:06 +00:00
|
|
|
|
2020-05-27 15:09:09 +00:00
|
|
|
32bit:
|
|
|
|
$(MAKE) CFLAGS="-m32" LDFLAGS="-melf_i386"
|
|
|
|
|
2019-10-23 16:32:35 +00:00
|
|
|
%.xo: %.c ../../src/redismodule.h
|
|
|
|
$(CC) -I../../src $(CFLAGS) $(SHOBJ_CFLAGS) -fPIC -c $< -o $@
|
2019-09-30 17:47:35 +00:00
|
|
|
|
2019-10-23 16:32:35 +00:00
|
|
|
%.so: %.xo
|
2020-05-27 15:09:09 +00:00
|
|
|
$(LD) -o $@ $< $(SHOBJ_LDFLAGS) $(LDFLAGS) $(LIBS) -lc
|
2019-07-24 09:58:15 +00:00
|
|
|
|
2019-10-23 16:32:35 +00:00
|
|
|
.PHONY: clean
|
2019-10-23 16:38:30 +00:00
|
|
|
|
2019-10-23 16:32:35 +00:00
|
|
|
clean:
|
|
|
|
rm -f $(TEST_MODULES) $(TEST_MODULES:.so=.xo)
|