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 \
|
|
|
|
blockonkeys.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
|
|
|
|
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
|
2019-07-24 09:58:15 +00:00
|
|
|
$(LD) -o $@ $< $(SHOBJ_LDFLAGS) $(LIBS) -lc
|
|
|
|
|
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)
|