1
0

Makefile 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # find the OS
  2. uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
  3. ifeq ($(uname_S),Darwin)
  4. SHOBJ_CFLAGS ?= -W -Wall -dynamic -fno-common -g -ggdb -std=c99 -O2
  5. SHOBJ_LDFLAGS ?= -bundle -undefined dynamic_lookup
  6. else # Linux, others
  7. SHOBJ_CFLAGS ?= -W -Wall -fno-common -g -ggdb -std=c99 -O2
  8. SHOBJ_LDFLAGS ?= -shared
  9. endif
  10. # Needed to satisfy __stack_chk_fail_local on Linux with -m32, due to gcc
  11. # -fstack-protector by default. Breaks on FreeBSD so we exclude it.
  12. ifneq ($(uname_S),FreeBSD)
  13. LIBS = -lc
  14. endif
  15. TEST_MODULES = \
  16. commandfilter.so \
  17. basics.so \
  18. testrdb.so \
  19. fork.so \
  20. infotest.so \
  21. propagate.so \
  22. misc.so \
  23. hooks.so \
  24. blockonkeys.so \
  25. blockonbackground.so \
  26. scan.so \
  27. datatype.so \
  28. datatype2.so \
  29. auth.so \
  30. keyspace_events.so \
  31. blockedclient.so \
  32. getkeys.so \
  33. test_lazyfree.so \
  34. timer.so \
  35. defragtest.so \
  36. hash.so \
  37. zset.so \
  38. stream.so \
  39. .PHONY: all
  40. all: $(TEST_MODULES)
  41. 32bit:
  42. $(MAKE) CFLAGS="-m32" LDFLAGS="-melf_i386"
  43. %.xo: %.c ../../src/redismodule.h
  44. $(CC) -I../../src $(CFLAGS) $(SHOBJ_CFLAGS) -fPIC -c $< -o $@
  45. %.so: %.xo
  46. $(LD) -o $@ $< $(SHOBJ_LDFLAGS) $(LDFLAGS) $(LIBS)
  47. .PHONY: clean
  48. clean:
  49. rm -f $(TEST_MODULES) $(TEST_MODULES:.so=.xo)