Makefile.am 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. # Copyright (c) 2013, Ben Noordhuis <info@bnoordhuis.nl>
  2. #
  3. # Permission to use, copy, modify, and/or distribute this software for any
  4. # purpose with or without fee is hereby granted, provided that the above
  5. # copyright notice and this permission notice appear in all copies.
  6. #
  7. # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  8. # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  9. # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  10. # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  11. # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  12. # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  13. # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  14. ACLOCAL_AMFLAGS = -I m4
  15. AM_CPPFLAGS = -I$(top_srcdir)/include \
  16. -I$(top_srcdir)/src
  17. include_HEADERS=include/uv.h include/uv-errno.h
  18. CLEANFILES =
  19. lib_LTLIBRARIES = libuv.la
  20. libuv_la_CFLAGS = @CFLAGS@
  21. libuv_la_LDFLAGS = -no-undefined -version-info 11:0:0
  22. libuv_la_SOURCES = src/fs-poll.c \
  23. src/inet.c \
  24. src/queue.h \
  25. src/uv-common.c \
  26. src/uv-common.h \
  27. src/version.c
  28. if SUNOS
  29. libuv_la_CFLAGS += -pthread
  30. endif
  31. if WINNT
  32. include_HEADERS += include/uv-win.h include/tree.h
  33. AM_CPPFLAGS += -I$(top_srcdir)/src/win \
  34. -DWIN32_LEAN_AND_MEAN \
  35. -D_WIN32_WINNT=0x0600
  36. LIBS += -lws2_32 -lpsapi -liphlpapi -lshell32
  37. libuv_la_SOURCES += src/win/async.c \
  38. src/win/atomicops-inl.h \
  39. src/win/core.c \
  40. src/win/dl.c \
  41. src/win/error.c \
  42. src/win/fs-event.c \
  43. src/win/fs.c \
  44. src/win/getaddrinfo.c \
  45. src/win/handle.c \
  46. src/win/handle-inl.h \
  47. src/win/internal.h \
  48. src/win/loop-watcher.c \
  49. src/win/pipe.c \
  50. src/win/poll.c \
  51. src/win/process-stdio.c \
  52. src/win/process.c \
  53. src/win/req.c \
  54. src/win/req-inl.h \
  55. src/win/signal.c \
  56. src/win/stream.c \
  57. src/win/stream-inl.h \
  58. src/win/tcp.c \
  59. src/win/thread.c \
  60. src/win/threadpool.c \
  61. src/win/timer.c \
  62. src/win/tty.c \
  63. src/win/udp.c \
  64. src/win/util.c \
  65. src/win/winapi.c \
  66. src/win/winapi.h \
  67. src/win/winsock.c \
  68. src/win/winsock.h
  69. else # WINNT
  70. include_HEADERS += include/uv-unix.h
  71. AM_CPPFLAGS += -I$(top_srcdir)/src/unix
  72. libuv_la_SOURCES += src/unix/async.c \
  73. src/unix/atomic-ops.h \
  74. src/unix/core.c \
  75. src/unix/dl.c \
  76. src/unix/fs.c \
  77. src/unix/getaddrinfo.c \
  78. src/unix/internal.h \
  79. src/unix/loop-watcher.c \
  80. src/unix/loop.c \
  81. src/unix/pipe.c \
  82. src/unix/poll.c \
  83. src/unix/process.c \
  84. src/unix/signal.c \
  85. src/unix/spinlock.h \
  86. src/unix/stream.c \
  87. src/unix/tcp.c \
  88. src/unix/thread.c \
  89. src/unix/threadpool.c \
  90. src/unix/timer.c \
  91. src/unix/tty.c \
  92. src/unix/udp.c
  93. endif # WINNT
  94. TESTS = test/run-tests
  95. check_PROGRAMS = test/run-tests
  96. test_run_tests_SOURCES = test/blackhole-server.c \
  97. test/dns-server.c \
  98. test/echo-server.c \
  99. test/run-tests.c \
  100. test/runner.c \
  101. test/runner.h \
  102. test/task.h \
  103. test/test-active.c \
  104. test/test-async.c \
  105. test/test-async-null-cb.c \
  106. test/test-barrier.c \
  107. test/test-callback-order.c \
  108. test/test-callback-stack.c \
  109. test/test-close-fd.c \
  110. test/test-close-order.c \
  111. test/test-condvar.c \
  112. test/test-connection-fail.c \
  113. test/test-cwd-and-chdir.c \
  114. test/test-delayed-accept.c \
  115. test/test-dlerror.c \
  116. test/test-embed.c \
  117. test/test-emfile.c \
  118. test/test-error.c \
  119. test/test-fail-always.c \
  120. test/test-fs-event.c \
  121. test/test-fs-poll.c \
  122. test/test-fs.c \
  123. test/test-get-currentexe.c \
  124. test/test-get-loadavg.c \
  125. test/test-get-memory.c \
  126. test/test-getaddrinfo.c \
  127. test/test-getsockname.c \
  128. test/test-hrtime.c \
  129. test/test-idle.c \
  130. test/test-ip4-addr.c \
  131. test/test-ip6-addr.c \
  132. test/test-ipc-send-recv.c \
  133. test/test-ipc.c \
  134. test/test-list.h \
  135. test/test-loop-handles.c \
  136. test/test-loop-alive.c \
  137. test/test-loop-stop.c \
  138. test/test-loop-time.c \
  139. test/test-multiple-listen.c \
  140. test/test-mutexes.c \
  141. test/test-osx-select.c \
  142. test/test-pass-always.c \
  143. test/test-ping-pong.c \
  144. test/test-pipe-bind-error.c \
  145. test/test-pipe-connect-error.c \
  146. test/test-pipe-server-close.c \
  147. test/test-platform-output.c \
  148. test/test-poll-close.c \
  149. test/test-poll.c \
  150. test/test-process-title.c \
  151. test/test-ref.c \
  152. test/test-run-nowait.c \
  153. test/test-run-once.c \
  154. test/test-semaphore.c \
  155. test/test-shutdown-close.c \
  156. test/test-shutdown-eof.c \
  157. test/test-signal-multiple-loops.c \
  158. test/test-signal.c \
  159. test/test-spawn.c \
  160. test/test-stdio-over-pipes.c \
  161. test/test-tcp-bind-error.c \
  162. test/test-tcp-bind6-error.c \
  163. test/test-tcp-close-accept.c \
  164. test/test-tcp-close-while-connecting.c \
  165. test/test-tcp-close.c \
  166. test/test-tcp-connect-error-after-write.c \
  167. test/test-tcp-connect-error.c \
  168. test/test-tcp-connect-timeout.c \
  169. test/test-tcp-connect6-error.c \
  170. test/test-tcp-flags.c \
  171. test/test-tcp-open.c \
  172. test/test-tcp-read-stop.c \
  173. test/test-tcp-shutdown-after-write.c \
  174. test/test-tcp-unexpected-read.c \
  175. test/test-tcp-write-to-half-open-connection.c \
  176. test/test-tcp-writealot.c \
  177. test/test-tcp-try-write.c \
  178. test/test-thread.c \
  179. test/test-threadpool-cancel.c \
  180. test/test-threadpool.c \
  181. test/test-timer-again.c \
  182. test/test-timer-from-check.c \
  183. test/test-timer.c \
  184. test/test-tty.c \
  185. test/test-udp-dgram-too-big.c \
  186. test/test-udp-ipv6.c \
  187. test/test-udp-multicast-join.c \
  188. test/test-udp-multicast-ttl.c \
  189. test/test-udp-open.c \
  190. test/test-udp-options.c \
  191. test/test-udp-send-and-recv.c \
  192. test/test-walk-handles.c \
  193. test/test-watcher-cross-stop.c
  194. test_run_tests_LDADD = libuv.la
  195. if WINNT
  196. test_run_tests_SOURCES += test/runner-win.c \
  197. test/runner-win.h
  198. else
  199. test_run_tests_SOURCES += test/runner-unix.c \
  200. test/runner-unix.h
  201. endif
  202. if AIX
  203. libuv_la_CFLAGS += -D_ALL_SOURCE -D_XOPEN_SOURCE=500
  204. libuv_la_SOURCES += src/unix/aix.c
  205. endif
  206. if DARWIN
  207. include_HEADERS += include/uv-darwin.h
  208. libuv_la_CFLAGS += -D_DARWIN_USE_64_BIT_INODE=1
  209. libuv_la_SOURCES += src/unix/darwin.c \
  210. src/unix/darwin-proctitle.c \
  211. src/unix/fsevents.c \
  212. src/unix/kqueue.c \
  213. src/unix/proctitle.c
  214. endif
  215. if FREEBSD
  216. include_HEADERS += include/uv-bsd.h
  217. libuv_la_SOURCES += src/unix/freebsd.c src/unix/kqueue.c
  218. endif
  219. if LINUX
  220. include_HEADERS += include/uv-linux.h
  221. libuv_la_SOURCES += src/unix/linux-core.c \
  222. src/unix/linux-inotify.c \
  223. src/unix/linux-syscalls.c \
  224. src/unix/linux-syscalls.h \
  225. src/unix/proctitle.c
  226. endif
  227. if NETBSD
  228. include_HEADERS += include/uv-bsd.h
  229. libuv_la_SOURCES += src/unix/kqueue.c src/unix/netbsd.c
  230. endif
  231. if OPENBSD
  232. include_HEADERS += include/uv-bsd.h
  233. libuv_la_SOURCES += src/unix/kqueue.c src/unix/openbsd.c
  234. endif
  235. if SUNOS
  236. include_HEADERS += include/uv-sunos.h
  237. libuv_la_CFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=500
  238. libuv_la_SOURCES += src/unix/sunos.c
  239. endif
  240. if HAVE_DTRACE
  241. BUILT_SOURCES = include/uv-dtrace.h
  242. CLEANFILES += include/uv-dtrace.h
  243. endif
  244. if DTRACE_NEEDS_OBJECTS
  245. libuv_la_SOURCES += src/unix/uv-dtrace.d
  246. libuv_la_DEPENDENCIES = src/unix/uv-dtrace.o
  247. libuv_la_LIBADD = uv-dtrace.lo
  248. CLEANFILES += src/unix/uv-dtrace.o src/unix/uv-dtrace.lo
  249. endif
  250. if HAVE_PKG_CONFIG
  251. pkgconfigdir = $(libdir)/pkgconfig
  252. pkgconfig_DATA = @PACKAGE_NAME@.pc
  253. endif
  254. if HAVE_DTRACE
  255. include/uv-dtrace.h: src/unix/uv-dtrace.d
  256. $(AM_V_GEN)$(DTRACE) $(DTRACEFLAGS) -h -xnolibs -s $< -o $(top_srcdir)/$@
  257. endif
  258. if DTRACE_NEEDS_OBJECTS
  259. SUFFIXES = .d
  260. src/unix/uv-dtrace.o: src/unix/uv-dtrace.d ${libuv_la_OBJECTS}
  261. # It's ok to specify the output here, because we have 1 .d file, and we process
  262. # every created .o, most projects don't need to include more than one .d
  263. .d.o:
  264. $(AM_V_GEN)$(DTRACE) $(DTRACEFLAGS) -G -o $(top_builddir)/uv-dtrace.o -s $< \
  265. `find ${top_builddir}/src -name "*.o"`
  266. $(AM_V_GEN)printf %s\\n \
  267. '# ${top_builddir}/uv-dtrace.lo - a libtool object file' \
  268. '# Generated by libtool (GNU libtool) 2.4' \
  269. '# libtool wants a .lo not a .o' \
  270. "pic_object='uv-dtrace.o'" \
  271. "non_pic_object='uv-dtrace.o'" \
  272. > ${top_builddir}/uv-dtrace.lo
  273. endif