2019-03-24 12:03:03 +02: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 19:32:35 +03:00
|
|
|
TEST_MODULES = \
|
|
|
|
commandfilter.so \
|
|
|
|
testrdb.so \
|
|
|
|
fork.so \
|
|
|
|
infotest.so \
|
|
|
|
propagate.so \
|
2019-10-24 09:38:52 +03:00
|
|
|
misc.so \
|
2018-03-29 17:46:13 +07:00
|
|
|
hooks.so \
|
2019-10-17 15:37:01 +03:00
|
|
|
blockonkeys.so \
|
2019-11-19 11:08:02 +01:00
|
|
|
scan.so \
|
2019-02-26 01:23:11 +00:00
|
|
|
datatype.so \
|
|
|
|
auth.so
|
2019-03-24 12:03:03 +02:00
|
|
|
|
2019-10-23 19:32:35 +03:00
|
|
|
.PHONY: all
|
2019-03-24 12:03:03 +02:00
|
|
|
|
2019-10-23 19:32:35 +03:00
|
|
|
all: $(TEST_MODULES)
|
2019-09-27 11:24:06 +02:00
|
|
|
|
2019-10-23 19:32:35 +03:00
|
|
|
%.xo: %.c ../../src/redismodule.h
|
|
|
|
$(CC) -I../../src $(CFLAGS) $(SHOBJ_CFLAGS) -fPIC -c $< -o $@
|
2019-09-30 20:47:35 +03:00
|
|
|
|
2019-10-23 19:32:35 +03:00
|
|
|
%.so: %.xo
|
2019-07-24 12:58:15 +03:00
|
|
|
$(LD) -o $@ $< $(SHOBJ_LDFLAGS) $(LIBS) -lc
|
|
|
|
|
2019-10-23 19:32:35 +03:00
|
|
|
.PHONY: clean
|
2019-10-23 18:38:30 +02:00
|
|
|
|
2019-10-23 19:32:35 +03:00
|
|
|
clean:
|
|
|
|
rm -f $(TEST_MODULES) $(TEST_MODULES:.so=.xo)
|