build.mk 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. # Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  2. #
  3. # Permission is hereby granted, free of charge, to any person obtaining a copy
  4. # of this software and associated documentation files (the "Software"), to
  5. # deal in the Software without restriction, including without limitation the
  6. # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  7. # sell copies of the Software, and to permit persons to whom the Software is
  8. # furnished to do so, subject to the following conditions:
  9. #
  10. # The above copyright notice and this permission notice shall be included in
  11. # all copies or substantial portions of the Software.
  12. #
  13. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  18. # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  19. # IN THE SOFTWARE.
  20. ifdef PLATFORM
  21. override PLATFORM := $(shell echo $(PLATFORM) | tr "[A-Z]" "[a-z]")
  22. else
  23. PLATFORM = $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"')
  24. endif
  25. CPPFLAGS += -I$(SRCDIR)/include -I$(SRCDIR)/include/uv-private
  26. ifeq (darwin,$(PLATFORM))
  27. SOEXT = dylib
  28. else
  29. SOEXT = so
  30. endif
  31. ifneq (,$(findstring mingw,$(PLATFORM)))
  32. include $(SRCDIR)/config-mingw.mk
  33. else
  34. include $(SRCDIR)/config-unix.mk
  35. endif
  36. BENCHMARKS= \
  37. test/benchmark-async-pummel.o \
  38. test/benchmark-async.o \
  39. test/benchmark-fs-stat.o \
  40. test/benchmark-getaddrinfo.o \
  41. test/benchmark-loop-count.o \
  42. test/benchmark-million-async.o \
  43. test/benchmark-million-timers.o \
  44. test/benchmark-multi-accept.o \
  45. test/benchmark-ping-pongs.o \
  46. test/benchmark-pound.o \
  47. test/benchmark-pump.o \
  48. test/benchmark-sizes.o \
  49. test/benchmark-spawn.o \
  50. test/benchmark-tcp-write-batch.o \
  51. test/benchmark-thread.o \
  52. test/benchmark-udp-pummel.o \
  53. test/blackhole-server.o \
  54. test/dns-server.o \
  55. test/echo-server.o \
  56. TESTS= \
  57. test/blackhole-server.o \
  58. test/dns-server.o \
  59. test/echo-server.o \
  60. test/test-active.o \
  61. test/test-async.o \
  62. test/test-barrier.o \
  63. test/test-callback-order.o \
  64. test/test-callback-stack.o \
  65. test/test-condvar.o \
  66. test/test-connection-fail.o \
  67. test/test-cwd-and-chdir.o \
  68. test/test-delayed-accept.o \
  69. test/test-dlerror.o \
  70. test/test-embed.o \
  71. test/test-error.o \
  72. test/test-fail-always.o \
  73. test/test-fs.o \
  74. test/test-fs-event.o \
  75. test/test-fs-poll.o \
  76. test/test-getaddrinfo.o \
  77. test/test-get-currentexe.o \
  78. test/test-get-loadavg.o \
  79. test/test-get-memory.o \
  80. test/test-getsockname.o \
  81. test/test-hrtime.o \
  82. test/test-idle.o \
  83. test/test-ipc.o \
  84. test/test-ipc-send-recv.o \
  85. test/test-loop-handles.o \
  86. test/test-loop-stop.o \
  87. test/test-multiple-listen.o \
  88. test/test-mutexes.o \
  89. test/test-osx-select.o \
  90. test/test-pass-always.o \
  91. test/test-ping-pong.o \
  92. test/test-pipe-bind-error.o \
  93. test/test-pipe-connect-error.o \
  94. test/test-platform-output.o \
  95. test/test-poll.o \
  96. test/test-poll-close.o \
  97. test/test-process-title.o \
  98. test/test-ref.o \
  99. test/test-run-nowait.o \
  100. test/test-run-once.o \
  101. test/test-semaphore.o \
  102. test/test-shutdown-close.o \
  103. test/test-shutdown-eof.o \
  104. test/test-signal.o \
  105. test/test-signal-multiple-loops.o \
  106. test/test-spawn.o \
  107. test/test-stdio-over-pipes.o \
  108. test/test-tcp-bind6-error.o \
  109. test/test-tcp-bind-error.o \
  110. test/test-tcp-close.o \
  111. test/test-tcp-close-while-connecting.o \
  112. test/test-tcp-connect6-error.o \
  113. test/test-tcp-connect-error-after-write.o \
  114. test/test-tcp-connect-error.o \
  115. test/test-tcp-connect-timeout.o \
  116. test/test-tcp-flags.o \
  117. test/test-tcp-open.o \
  118. test/test-tcp-read-stop.o \
  119. test/test-tcp-shutdown-after-write.o \
  120. test/test-tcp-unexpected-read.o \
  121. test/test-tcp-writealot.o \
  122. test/test-tcp-write-to-half-open-connection.o \
  123. test/test-thread.o \
  124. test/test-threadpool.o \
  125. test/test-threadpool-cancel.o \
  126. test/test-timer-again.o \
  127. test/test-timer.o \
  128. test/test-tty.o \
  129. test/test-udp-dgram-too-big.o \
  130. test/test-udp-ipv6.o \
  131. test/test-udp-multicast-join.o \
  132. test/test-udp-multicast-ttl.o \
  133. test/test-udp-open.o \
  134. test/test-udp-options.o \
  135. test/test-udp-send-and-recv.o \
  136. test/test-util.o \
  137. test/test-walk-handles.o \
  138. all: libuv.a
  139. run-tests$(E): test/run-tests.o test/runner.o $(RUNNER_SRC) $(TESTS) libuv.a
  140. $(CC) $(CPPFLAGS) $(RUNNER_CFLAGS) -o $@ $^ $(RUNNER_LIBS) $(RUNNER_LDFLAGS)
  141. run-benchmarks$(E): test/run-benchmarks.o test/runner.o $(RUNNER_SRC) $(BENCHMARKS) libuv.a
  142. $(CC) $(CPPFLAGS) $(RUNNER_CFLAGS) -o $@ $^ $(RUNNER_LIBS) $(RUNNER_LDFLAGS)
  143. test/echo.o: test/echo.c test/echo.h
  144. .PHONY: clean clean-platform distclean test bench
  145. test: run-tests$(E)
  146. $(CURDIR)/$<
  147. bench: run-benchmarks$(E)
  148. $(CURDIR)/$<
  149. clean distclean: clean-platform
  150. $(RM) libuv.a libuv.$(SOEXT) \
  151. test/run-tests.o test/run-benchmarks.o \
  152. test/run-tests$(E) test/run-benchmarks$(E) \
  153. $(BENCHMARKS) $(TESTS) $(RUNNER_LIBS)