2016-03-31 16:17:33 +03: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)
|
2016-10-07 13:07:13 +02:00
|
|
|
SHOBJ_CFLAGS ?= -W -Wall -fno-common -g -ggdb -std=c99 -O2
|
2016-03-31 16:17:33 +03:00
|
|
|
SHOBJ_LDFLAGS ?= -shared
|
|
|
|
else
|
2016-10-07 13:07:13 +02:00
|
|
|
SHOBJ_CFLAGS ?= -W -Wall -dynamic -fno-common -g -ggdb -std=c99 -O2
|
2016-03-31 16:17:33 +03:00
|
|
|
SHOBJ_LDFLAGS ?= -bundle -undefined dynamic_lookup
|
|
|
|
endif
|
2016-03-06 13:44:24 +01:00
|
|
|
|
|
|
|
.SUFFIXES: .c .so .xo .o
|
|
|
|
|
2019-02-26 01:23:11 +00:00
|
|
|
all: helloworld.so hellotype.so helloblock.so testmodule.so hellocluster.so hellotimer.so hellodict.so hellohook.so helloacl.so
|
2016-03-06 13:44:24 +01:00
|
|
|
|
|
|
|
.c.xo:
|
|
|
|
$(CC) -I. $(CFLAGS) $(SHOBJ_CFLAGS) -fPIC -c $< -o $@
|
|
|
|
|
|
|
|
helloworld.xo: ../redismodule.h
|
|
|
|
|
|
|
|
helloworld.so: helloworld.xo
|
|
|
|
$(LD) -o $@ $< $(SHOBJ_LDFLAGS) $(LIBS) -lc
|
|
|
|
|
2016-05-18 11:45:40 +02:00
|
|
|
hellotype.xo: ../redismodule.h
|
|
|
|
|
|
|
|
hellotype.so: hellotype.xo
|
|
|
|
$(LD) -o $@ $< $(SHOBJ_LDFLAGS) $(LIBS) -lc
|
|
|
|
|
2016-10-07 13:48:05 +02:00
|
|
|
helloblock.xo: ../redismodule.h
|
|
|
|
|
|
|
|
helloblock.so: helloblock.xo
|
|
|
|
$(LD) -o $@ $< $(SHOBJ_LDFLAGS) $(LIBS) -lpthread -lc
|
|
|
|
|
2018-03-30 12:49:39 +02:00
|
|
|
hellocluster.xo: ../redismodule.h
|
|
|
|
|
|
|
|
hellocluster.so: hellocluster.xo
|
|
|
|
$(LD) -o $@ $< $(SHOBJ_LDFLAGS) $(LIBS) -lc
|
|
|
|
|
2018-03-31 00:44:46 +02:00
|
|
|
hellotimer.xo: ../redismodule.h
|
|
|
|
|
|
|
|
hellotimer.so: hellotimer.xo
|
|
|
|
$(LD) -o $@ $< $(SHOBJ_LDFLAGS) $(LIBS) -lc
|
|
|
|
|
2018-09-26 17:42:00 +02:00
|
|
|
hellodict.xo: ../redismodule.h
|
|
|
|
|
|
|
|
hellodict.so: hellodict.xo
|
2019-10-22 13:26:29 +02:00
|
|
|
$(LD) -o $@ $< $(SHOBJ_LDFLAGS) $(LIBS) -lc
|
|
|
|
|
|
|
|
hellohook.xo: ../redismodule.h
|
|
|
|
|
|
|
|
hellohook.so: hellohook.xo
|
|
|
|
$(LD) -o $@ $< $(SHOBJ_LDFLAGS) $(LIBS) -lc
|
2018-02-23 16:19:37 +02:00
|
|
|
|
2019-02-26 01:23:11 +00:00
|
|
|
helloacl.xo: ../redismodule.h
|
|
|
|
|
|
|
|
helloacl.so: helloacl.xo
|
|
|
|
$(LD) -o $@ $< $(SHOBJ_LDFLAGS) $(LIBS) -lc
|
|
|
|
|
2016-08-02 15:29:04 +02:00
|
|
|
testmodule.xo: ../redismodule.h
|
|
|
|
|
|
|
|
testmodule.so: testmodule.xo
|
|
|
|
$(LD) -o $@ $< $(SHOBJ_LDFLAGS) $(LIBS) -lc
|
|
|
|
|
2016-03-06 13:44:24 +01:00
|
|
|
clean:
|
|
|
|
rm -rf *.xo *.so
|