2019-03-24 06:03:03 -04: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
|
|
|
|
|
|
|
|
.SUFFIXES: .c .so .xo .o
|
|
|
|
|
2019-09-27 05:24:06 -04:00
|
|
|
all: commandfilter.so testrdb.so fork.so
|
2019-03-24 06:03:03 -04:00
|
|
|
|
|
|
|
.c.xo:
|
|
|
|
$(CC) -I../../src $(CFLAGS) $(SHOBJ_CFLAGS) -fPIC -c $< -o $@
|
|
|
|
|
|
|
|
commandfilter.xo: ../../src/redismodule.h
|
2019-07-17 01:51:02 -04:00
|
|
|
fork.xo: ../../src/redismodule.h
|
2019-07-21 10:41:03 -04:00
|
|
|
testrdb.xo: ../../src/redismodule.h
|
2019-03-24 06:03:03 -04:00
|
|
|
|
|
|
|
commandfilter.so: commandfilter.xo
|
|
|
|
$(LD) -o $@ $< $(SHOBJ_LDFLAGS) $(LIBS) -lc
|
2019-07-17 01:51:02 -04:00
|
|
|
|
|
|
|
fork.so: fork.xo
|
|
|
|
$(LD) -o $@ $< $(SHOBJ_LDFLAGS) $(LIBS) -lc
|
2019-09-27 05:24:06 -04:00
|
|
|
|
2019-07-21 10:41:03 -04:00
|
|
|
testrdb.so: testrdb.xo
|
|
|
|
$(LD) -o $@ $< $(SHOBJ_LDFLAGS) $(LIBS) -lc
|