Permalink
Browse files

First commit

  • Loading branch information...
0 parents commit 88f63836a963b173bccdb88fe0b5003361811018 @winton committed Oct 11, 2011
Showing with 25,029 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +55 −0 Makefile
  3. +25 −0 README.md
  4. +6 −0 hiredis/.gitignore
  5. +16 −0 hiredis/CHANGELOG.md
  6. +29 −0 hiredis/COPYING
  7. +148 −0 hiredis/Makefile
  8. +351 −0 hiredis/README.md
  9. +97 −0 hiredis/adapters/ae.h
  10. +117 −0 hiredis/adapters/libev.h
  11. +78 −0 hiredis/adapters/libevent.h
  12. +604 −0 hiredis/async.c
  13. +125 −0 hiredis/async.h
  14. +338 −0 hiredis/dict.c
  15. +126 −0 hiredis/dict.h
  16. +56 −0 hiredis/example-ae.c
  17. +51 −0 hiredis/example-libev.c
  18. +52 −0 hiredis/example-libevent.c
  19. +68 −0 hiredis/example.c
  20. +16 −0 hiredis/fmacros.h
  21. +1,283 −0 hiredis/hiredis.c
  22. +204 −0 hiredis/hiredis.h
  23. +279 −0 hiredis/net.c
  24. +47 −0 hiredis/net.h
  25. +605 −0 hiredis/sds.c
  26. +88 −0 hiredis/sds.h
  27. +652 −0 hiredis/test.c
  28. +343 −0 redis_parse.c
  29. +21 −0 uthash/LICENSE
  30. +41 −0 uthash/README
  31. +43 −0 uthash/doc/Makefile
  32. +44 −0 uthash/doc/NOTES
  33. +1,076 −0 uthash/doc/html/ChangeLog.html
  34. BIN uthash/doc/html/img/banner.png
  35. +451 −0 uthash/doc/html/img/banner.svg
  36. BIN uthash/doc/html/img/grad_blue.png
  37. +103 −0 uthash/doc/html/img/grad_blue.svg
  38. BIN uthash/doc/html/img/rss.png
  39. BIN uthash/doc/html/img/uthash-mini.png
  40. +288 −0 uthash/doc/html/img/uthash-mini.svg
  41. BIN uthash/doc/html/img/uthash.png
  42. +131 −0 uthash/doc/html/index.html
  43. +59 −0 uthash/doc/html/license.html
  44. +130 −0 uthash/doc/html/styles.css
  45. +41 −0 uthash/doc/html/tdh-quirks.css
  46. +402 −0 uthash/doc/html/tdh.css
  47. +35 −0 uthash/doc/html/toc.css
  48. +2,024 −0 uthash/doc/html/userguide.html
  49. +1 −0 uthash/doc/html/userguide.pdf
  50. +549 −0 uthash/doc/html/utarray.html
  51. +443 −0 uthash/doc/html/utlist.html
  52. +316 −0 uthash/doc/html/utstring.html
  53. BIN uthash/doc/pdf/userguide.pdf
  54. +187 −0 uthash/doc/txt/ChangeLog.txt
  55. +5 −0 uthash/doc/txt/sflogo.txt
  56. +85 −0 uthash/doc/txt/toc.txt
  57. +10 −0 uthash/doc/txt/topnav.txt
  58. +8 −0 uthash/doc/txt/topnav_utarray.txt
  59. +8 −0 uthash/doc/txt/topnav_utlist.txt
  60. +8 −0 uthash/doc/txt/topnav_utstring.txt
  61. +1,604 −0 uthash/doc/txt/userguide.txt
  62. +379 −0 uthash/doc/txt/utarray.txt
  63. +219 −0 uthash/doc/txt/utlist.txt
  64. +178 −0 uthash/doc/txt/utstring.txt
  65. +226 −0 uthash/src/utarray.h
  66. +904 −0 uthash/src/uthash.h
  67. +522 −0 uthash/src/utlist.h
  68. +148 −0 uthash/src/utstring.h
  69. +111 −0 uthash/tests/Makefile
  70. +95 −0 uthash/tests/README
  71. +14 −0 uthash/tests/all_funcs
  72. +64 −0 uthash/tests/bloom_perf.c
  73. +17 −0 uthash/tests/bloom_perf.sh
  74. +21 −0 uthash/tests/do_tests
  75. +22 −0 uthash/tests/do_tests.cygwin
  76. +20 −0 uthash/tests/do_tests.mingw
  77. +16 −0 uthash/tests/do_tests_win32.cmd
  78. +44 −0 uthash/tests/emit_keys.c
  79. +118 −0 uthash/tests/example.c
  80. +588 −0 uthash/tests/hashscan.c
  81. +219 −0 uthash/tests/keystat.c
  82. +40 −0 uthash/tests/keystats
  83. +21 −0 uthash/tests/mexpand
  84. +28 −0 uthash/tests/simkeys.pl
  85. +29 −0 uthash/tests/sleep_test.c
  86. +34 −0 uthash/tests/tdiff.cpp
  87. +10 −0 uthash/tests/test1.ans
  88. +27 −0 uthash/tests/test1.c
  89. +4 −0 uthash/tests/test10.ans
  90. +45 −0 uthash/tests/test10.c
  91. +51 −0 uthash/tests/test11.ans
  92. +50 −0 uthash/tests/test11.c
  93. +51 −0 uthash/tests/test11.dat
  94. +20 −0 uthash/tests/test12.ans
  95. +34 −0 uthash/tests/test12.c
  96. +5 −0 uthash/tests/test13.ans
  97. +42 −0 uthash/tests/test13.c
  98. +1 −0 uthash/tests/test14.ans
  99. +46 −0 uthash/tests/test14.c
  100. +1,219 −0 uthash/tests/test14.dat
  101. +1 −0 uthash/tests/test15.ans
  102. +28 −0 uthash/tests/test15.c
  103. +1 −0 uthash/tests/test16.ans
  104. +46 −0 uthash/tests/test16.c
  105. +134 −0 uthash/tests/test17.ans
  106. +55 −0 uthash/tests/test17.c
  107. +20 −0 uthash/tests/test18.ans
  108. +33 −0 uthash/tests/test18.c
  109. +1,012 −0 uthash/tests/test19.ans
  110. +52 −0 uthash/tests/test19.c
  111. +5 −0 uthash/tests/test2.ans
  112. +31 −0 uthash/tests/test2.c
  113. +1 −0 uthash/tests/test20.ans
  114. +28 −0 uthash/tests/test20.c
  115. +1 −0 uthash/tests/test21.ans
  116. +33 −0 uthash/tests/test21.c
  117. +1 −0 uthash/tests/test22.ans
  118. +54 −0 uthash/tests/test22.c
  119. +6 −0 uthash/tests/test23.ans
  120. +44 −0 uthash/tests/test23.c
  121. +1 −0 uthash/tests/test24.ans
  122. +25 −0 uthash/tests/test24.c
  123. +28 −0 uthash/tests/test25.ans
  124. +112 −0 uthash/tests/test25.c
  125. +53 −0 uthash/tests/test26.ans
  126. +52 −0 uthash/tests/test26.c
  127. +28 −0 uthash/tests/test27.ans
  128. +112 −0 uthash/tests/test27.c
  129. +34 −0 uthash/tests/test28.ans
  130. +132 −0 uthash/tests/test28.c
  131. +103 −0 uthash/tests/test29.ans
  132. +48 −0 uthash/tests/test29.c
  133. +5 −0 uthash/tests/test3.ans
  134. +38 −0 uthash/tests/test3.c
  135. +51 −0 uthash/tests/test30.ans
  136. +43 −0 uthash/tests/test30.c
  137. +51 −0 uthash/tests/test31.ans
  138. +43 −0 uthash/tests/test31.c
  139. +51 −0 uthash/tests/test32.ans
  140. +41 −0 uthash/tests/test32.c
  141. +51 −0 uthash/tests/test33.ans
  142. +43 −0 uthash/tests/test33.c
  143. +51 −0 uthash/tests/test34.ans
  144. +41 −0 uthash/tests/test34.c
  145. +30 −0 uthash/tests/test35.ans
  146. +37 −0 uthash/tests/test35.c
  147. +15 −0 uthash/tests/test36.ans
  148. +46 −0 uthash/tests/test36.c
  149. +20 −0 uthash/tests/test37.ans
  150. +51 −0 uthash/tests/test37.c
  151. +1 −0 uthash/tests/test38.ans
  152. +28 −0 uthash/tests/test38.c
  153. +7 −0 uthash/tests/test39.ans
  154. +31 −0 uthash/tests/test39.c
  155. +10 −0 uthash/tests/test4.ans
  156. +29 −0 uthash/tests/test4.c
  157. +1 −0 uthash/tests/test40.ans
  158. +28 −0 uthash/tests/test40.c
  159. +6 −0 uthash/tests/test41.ans
  160. +58 −0 uthash/tests/test41.c
  161. +14 −0 uthash/tests/test42.ans
  162. +65 −0 uthash/tests/test42.c
  163. +88 −0 uthash/tests/test43.ans
  164. +76 −0 uthash/tests/test43.c
  165. +9 −0 uthash/tests/test44.ans
  166. +44 −0 uthash/tests/test44.c
  167. +3 −0 uthash/tests/test45.ans
  168. +24 −0 uthash/tests/test45.c
  169. +11 −0 uthash/tests/test46.ans
  170. +49 −0 uthash/tests/test46.c
  171. +8 −0 uthash/tests/test47.ans
  172. +28 −0 uthash/tests/test47.c
  173. +10 −0 uthash/tests/test48.ans
  174. +20 −0 uthash/tests/test48.c
  175. +2 −0 uthash/tests/test49.ans
  176. +20 −0 uthash/tests/test49.c
  177. +5 −0 uthash/tests/test5.ans
  178. +33 −0 uthash/tests/test5.c
  179. +2 −0 uthash/tests/test50.ans
  180. +19 −0 uthash/tests/test50.c
  181. +2 −0 uthash/tests/test51.ans
  182. +28 −0 uthash/tests/test51.c
  183. +2 −0 uthash/tests/test52.ans
  184. +39 −0 uthash/tests/test52.c
  185. +1 −0 uthash/tests/test53.ans
  186. +13 −0 uthash/tests/test53.c
  187. +2 −0 uthash/tests/test54.ans
  188. +23 −0 uthash/tests/test54.c
  189. +2 −0 uthash/tests/test55.ans
  190. +18 −0 uthash/tests/test55.c
  191. +65 −0 uthash/tests/test56.ans
  192. +86 −0 uthash/tests/test56.c
  193. +1 −0 uthash/tests/test57.ans
  194. +25 −0 uthash/tests/test57.c
  195. +18 −0 uthash/tests/test58.ans
  196. +55 −0 uthash/tests/test58.c
  197. +1 −0 uthash/tests/test59.ans
  198. +41 −0 uthash/tests/test59.c
  199. +1 −0 uthash/tests/test6.ans
  200. +52 −0 uthash/tests/test6.c
  201. +1 −0 uthash/tests/test60.ans
  202. +45 −0 uthash/tests/test60.c
  203. +16 −0 uthash/tests/test61.ans
  204. +42 −0 uthash/tests/test61.c
  205. +20 −0 uthash/tests/test62.ans
  206. +61 −0 uthash/tests/test62.c
  207. +7 −0 uthash/tests/test63.ans
  208. +47 −0 uthash/tests/test63.c
  209. +7 −0 uthash/tests/test64.ans
  210. +47 −0 uthash/tests/test64.c
  211. 0 uthash/tests/test7.ans
  212. +38 −0 uthash/tests/test7.c
  213. +15 −0 uthash/tests/test8.ans
  214. +34 −0 uthash/tests/test8.c
  215. +500 −0 uthash/tests/test9.ans
  216. +31 −0 uthash/tests/test9.c
  217. +31 −0 uthash/tests/threads/Makefile
  218. +2 −0 uthash/tests/threads/README
  219. +22 −0 uthash/tests/threads/do_tests
  220. +111 −0 uthash/tests/threads/test1.c
  221. +70 −0 uthash/tests/threads/test2.c
@@ -0,0 +1,2 @@
+redis_parse
+redis_parse.o
@@ -0,0 +1,55 @@
+OBJ=hiredis/net.o hiredis/hiredis.o hiredis/sds.o hiredis/async.o
+BINS=redis_parse
+LIBNAME=hiredis/libhiredis
+
+HIREDIS_MAJOR=0
+HIREDIS_MINOR=10
+
+# Fallback to gcc when $CC is not in $PATH.
+CC:=$(shell sh -c 'type $(CC) >/dev/null 2>/dev/null && echo $(CC) || echo gcc')
+OPTIMIZATION?=-O3
+WARNINGS=-Wall -W -Wstrict-prototypes -Wwrite-strings
+DEBUG?= -g -ggdb
+REAL_CFLAGS=$(OPTIMIZATION) -fPIC $(CFLAGS) $(WARNINGS) $(DEBUG)
+REAL_LDFLAGS=$(LDFLAGS)
+
+DYLIBSUFFIX=so
+STLIBSUFFIX=a
+DYLIB_MINOR_NAME=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR).$(HIREDIS_MINOR)
+DYLIB_MAJOR_NAME=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR)
+DYLIBNAME=$(LIBNAME).$(DYLIBSUFFIX)
+DYLIB_MAKE_CMD=$(CC) -shared -Wl,-soname,$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) $(LDFLAGS)
+STLIBNAME=$(LIBNAME).$(STLIBSUFFIX)
+STLIB_MAKE_CMD=ar rcs $(STLIBNAME)
+
+# Platform-specific overrides
+uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+ifeq ($(uname_S),SunOS)
+ REAL_LDFLAGS+= -ldl -lnsl -lsocket
+ DYLIB_MAKE_CMD=$(CC) -G -o $(DYLIBNAME) -h $(DYLIB_MINOR_NAME) $(LDFLAGS)
+ INSTALL= cp -r
+endif
+ifeq ($(uname_S),Darwin)
+ DYLIBSUFFIX=dylib
+ DYLIB_MINOR_NAME=$(LIBNAME).$(HIREDIS_MAJOR).$(HIREDIS_MINOR).$(DYLIBSUFFIX)
+ DYLIB_MAJOR_NAME=$(LIBNAME).$(HIREDIS_MAJOR).$(DYLIBSUFFIX)
+ DYLIB_MAKE_CMD=$(CC) -shared -Wl,-install_name,$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) $(LDFLAGS)
+endif
+
+all: $(DYLIBNAME) $(BINS)
+
+# Deps (use make dep to generate this)
+redis_parse.o: redis_parse.c hiredis/hiredis.h
+
+$(DYLIBNAME): $(OBJ)
+ $(DYLIB_MAKE_CMD) $(OBJ)
+
+$(STLIBNAME): $(OBJ)
+ $(STLIB_MAKE_CMD) $(OBJ)
+
+dynamic: $(DYLIBNAME)
+static: $(STLIBNAME)
+
+# Binaries:
+redis_parse: redis_parse.o $(STLIBNAME)
+ $(CC) -o $@ $(REAL_LDFLAGS) $< $(STLIBNAME)
@@ -0,0 +1,25 @@
+RedisParse
+==========
+
+Reads huge amounts of pipe-delimited data from Redis, filters it, and returns counts by occurence.
+
+Usage
+-----
+
+ Usage:
+ redis_parse IP PORT 'REDIS QUERY' COUNT|GROUP START END LIMIT COLUMN 'QUERY'
+
+ IP IP address of redis server
+ PORT Port of redis server
+ REDIS QUERY http://redis.io/commands
+ COUNT|GROUP COUNT if only returning integer (number of matches),
+ GROUP if returning column and number of matches separated by comma
+ START Only works if WITHSCORES present in redis query, start range for score
+ FINISH Only works if WITHSCORES present in redis query, end range for score
+ LIMIT Only works if type GROUP, limit results
+ COLUMN Only works if type GROUP - referrer, time, tags, article_id, keywords, or type
+ QUERY Pipe delimited query string representing matches on the columns:
+ referrer|time|tags|article_id|keywords|type
+
+ Example:
+ redis_parse 127.0.0.1 6379 'ZRANGEBYSCORE hits -inf +inf' COUNT -1 -1 100 referrer 'a|b|c|d|e|f'
@@ -0,0 +1,6 @@
+/hiredis-test
+/hiredis-example*
+/*.o
+/*.so
+/*.dylib
+/*.a
@@ -0,0 +1,16 @@
+### 0.10.1
+
+* Makefile overhaul. Important to check out if you override one or more
+ variables using environment variables or via arguments to the "make" tool.
+
+* Issue #45: Fix potential memory leak for a multi bulk reply with 0 elements
+ being created by the default reply object functions.
+
+* Issue #43: Don't crash in an asynchronous context when Redis returns an error
+ reply after the connection has been made (this happens when the maximum
+ number of connections is reached).
+
+### 0.10.0
+
+* See commit log.
+
@@ -0,0 +1,29 @@
+Copyright (c) 2009-2011, Salvatore Sanfilippo <antirez at gmail dot com>
+Copyright (c) 2010-2011, Pieter Noordhuis <pcnoordhuis at gmail dot com>
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+* Neither the name of Redis nor the names of its contributors may be used
+ to endorse or promote products derived from this software without specific
+ prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,148 @@
+# Hiredis Makefile
+# Copyright (C) 2010-2011 Salvatore Sanfilippo <antirez at gmail dot com>
+# Copyright (C) 2010-2011 Pieter Noordhuis <pcnoordhuis at gmail dot com>
+# This file is released under the BSD license, see the COPYING file
+
+OBJ=net.o hiredis.o sds.o async.o
+BINS=hiredis-example hiredis-test
+LIBNAME=libhiredis
+
+HIREDIS_MAJOR=0
+HIREDIS_MINOR=10
+
+# Fallback to gcc when $CC is not in $PATH.
+CC:=$(shell sh -c 'type $(CC) >/dev/null 2>/dev/null && echo $(CC) || echo gcc')
+OPTIMIZATION?=-O3
+WARNINGS=-Wall -W -Wstrict-prototypes -Wwrite-strings
+DEBUG?= -g -ggdb
+REAL_CFLAGS=$(OPTIMIZATION) -fPIC $(CFLAGS) $(WARNINGS) $(DEBUG)
+REAL_LDFLAGS=$(LDFLAGS)
+
+DYLIBSUFFIX=so
+STLIBSUFFIX=a
+DYLIB_MINOR_NAME=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR).$(HIREDIS_MINOR)
+DYLIB_MAJOR_NAME=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR)
+DYLIBNAME=$(LIBNAME).$(DYLIBSUFFIX)
+DYLIB_MAKE_CMD=$(CC) -shared -Wl,-soname,$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) $(LDFLAGS)
+STLIBNAME=$(LIBNAME).$(STLIBSUFFIX)
+STLIB_MAKE_CMD=ar rcs $(STLIBNAME)
+
+# Platform-specific overrides
+uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+ifeq ($(uname_S),SunOS)
+ REAL_LDFLAGS+= -ldl -lnsl -lsocket
+ DYLIB_MAKE_CMD=$(CC) -G -o $(DYLIBNAME) -h $(DYLIB_MINOR_NAME) $(LDFLAGS)
+ INSTALL= cp -r
+endif
+ifeq ($(uname_S),Darwin)
+ DYLIBSUFFIX=dylib
+ DYLIB_MINOR_NAME=$(LIBNAME).$(HIREDIS_MAJOR).$(HIREDIS_MINOR).$(DYLIBSUFFIX)
+ DYLIB_MAJOR_NAME=$(LIBNAME).$(HIREDIS_MAJOR).$(DYLIBSUFFIX)
+ DYLIB_MAKE_CMD=$(CC) -shared -Wl,-install_name,$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) $(LDFLAGS)
+endif
+
+all: $(DYLIBNAME) $(BINS)
+
+# Deps (use make dep to generate this)
+net.o: net.c fmacros.h net.h hiredis.h
+async.o: async.c async.h hiredis.h sds.h dict.c dict.h
+example.o: example.c hiredis.h
+hiredis.o: hiredis.c fmacros.h hiredis.h net.h sds.h
+sds.o: sds.c sds.h
+test.o: test.c hiredis.h
+
+$(DYLIBNAME): $(OBJ)
+ $(DYLIB_MAKE_CMD) $(OBJ)
+
+$(STLIBNAME): $(OBJ)
+ $(STLIB_MAKE_CMD) $(OBJ)
+
+dynamic: $(DYLIBNAME)
+static: $(STLIBNAME)
+
+# Binaries:
+hiredis-example-libevent: example-libevent.c adapters/libevent.h $(STLIBNAME)
+ $(CC) -o $@ $(REAL_CFLAGS) $(REAL_LDFLAGS) -levent example-libevent.c $(STLIBNAME)
+
+hiredis-example-libev: example-libev.c adapters/libev.h $(STLIBNAME)
+ $(CC) -o $@ $(REAL_CFLAGS) $(REAL_LDFLAGS) -lev example-libev.c $(STLIBNAME)
+
+ifndef AE_DIR
+hiredis-example-ae:
+ @echo "Please specify AE_DIR (e.g. <redis repository>/src)"
+ @false
+else
+hiredis-example-ae: example-ae.c adapters/ae.h $(STLIBNAME)
+ $(CC) -o $@ $(REAL_CFLAGS) $(REAL_LDFLAGS) -I$(AE_DIR) $(AE_DIR)/ae.o $(AE_DIR)/zmalloc.o example-ae.c $(STLIBNAME)
+endif
+
+hiredis-%: %.o $(STLIBNAME)
+ $(CC) -o $@ $(REAL_LDFLAGS) $< $(STLIBNAME)
+
+test: hiredis-test
+ ./hiredis-test
+
+check: hiredis-test
+ echo \
+ "daemonize yes\n" \
+ "pidfile /tmp/hiredis-test-redis.pid\n" \
+ "port 56379\n" \
+ "bind 127.0.0.1\n" \
+ "unixsocket /tmp/hiredis-test-redis.sock" \
+ | redis-server -
+ ./hiredis-test -h 127.0.0.1 -p 56379 -s /tmp/hiredis-test-redis.sock || \
+ ( kill `cat /tmp/hiredis-test-redis.pid` && false )
+ kill `cat /tmp/hiredis-test-redis.pid`
+
+.c.o:
+ $(CC) -std=c99 -pedantic -c $(REAL_CFLAGS) $<
+
+clean:
+ rm -rf $(DYLIBNAME) $(STLIBNAME) $(BINS) hiredis-example* *.o *.gcda *.gcno *.gcov
+
+dep:
+ $(CC) -MM *.c
+
+# Installation related variables and target
+PREFIX?=/usr/local
+INCLUDE_PATH?=include/hiredis
+LIBRARY_PATH?=lib
+INSTALL_INCLUDE_PATH= $(PREFIX)/$(INCLUDE_PATH)
+INSTALL_LIBRARY_PATH= $(PREFIX)/$(LIBRARY_PATH)
+
+ifeq ($(uname_S),SunOS)
+ INSTALL?= cp -r
+endif
+
+INSTALL?= cp -a
+
+install: $(DYLIBNAME) $(STLIBNAME)
+ mkdir -p $(INSTALL_INCLUDE_PATH) $(INSTALL_LIBRARY_PATH)
+ $(INSTALL) hiredis.h async.h adapters $(INSTALL_INCLUDE_PATH)
+ $(INSTALL) $(DYLIBNAME) $(INSTALL_LIBRARY_PATH)/$(DYLIB_MINOR_NAME)
+ cd $(INSTALL_LIBRARY_PATH) && ln -sf $(DYLIB_MINOR_NAME) $(DYLIB_MAJOR_NAME)
+ cd $(INSTALL_LIBRARY_PATH) && ln -sf $(DYLIB_MAJOR_NAME) $(DYLIBNAME)
+ $(INSTALL) $(STLIBNAME) $(INSTALL_LIBRARY_PATH)
+
+32bit:
+ @echo ""
+ @echo "WARNING: if this fails under Linux you probably need to install libc6-dev-i386"
+ @echo ""
+ $(MAKE) CFLAGS="-m32" LDFLAGS="-m32"
+
+gprof:
+ $(MAKE) CFLAGS="-pg" LDFLAGS="-pg"
+
+gcov:
+ $(MAKE) CFLAGS="-fprofile-arcs -ftest-coverage" LDFLAGS="-fprofile-arcs"
+
+coverage: gcov
+ make check
+ mkdir -p tmp/lcov
+ lcov -d . -c -o tmp/lcov/hiredis.info
+ genhtml --legend -o tmp/lcov/report tmp/lcov/hiredis.info
+
+noopt:
+ $(MAKE) OPTIMIZATION=""
+
+.PHONY: all test check clean dep install 32bit gprof gcov noopt
Oops, something went wrong.

0 comments on commit 88f6383

Please sign in to comment.