1 # Copyright Joyent, Inc. and other Node contributors. All rights reserved.
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:
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
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
22 override PLATFORM := $(shell echo $(PLATFORM) | tr "[A-Z]" "[a-z]")
24 PLATFORM = $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"')
27 CPPFLAGS += -I$(SRCDIR)/include -I$(SRCDIR)/include/uv-private
29 ifeq (darwin,$(PLATFORM))
35 ifneq (,$(findstring mingw,$(PLATFORM)))
36 include $(SRCDIR)/config-mingw.mk
38 include $(SRCDIR)/config-unix.mk
42 test/benchmark-async-pummel.o \
43 test/benchmark-async.o \
44 test/benchmark-fs-stat.o \
45 test/benchmark-getaddrinfo.o \
46 test/benchmark-loop-count.o \
47 test/benchmark-million-async.o \
48 test/benchmark-million-timers.o \
49 test/benchmark-multi-accept.o \
50 test/benchmark-ping-pongs.o \
51 test/benchmark-pound.o \
52 test/benchmark-pump.o \
53 test/benchmark-sizes.o \
54 test/benchmark-spawn.o \
55 test/benchmark-tcp-write-batch.o \
56 test/benchmark-thread.o \
57 test/benchmark-udp-pummel.o \
58 test/blackhole-server.o \
63 test/blackhole-server.o \
69 test/test-callback-order.o \
70 test/test-callback-stack.o \
72 test/test-connection-fail.o \
73 test/test-cwd-and-chdir.o \
74 test/test-delayed-accept.o \
78 test/test-fail-always.o \
80 test/test-fs-event.o \
82 test/test-getaddrinfo.o \
83 test/test-get-currentexe.o \
84 test/test-get-loadavg.o \
85 test/test-get-memory.o \
86 test/test-getsockname.o \
90 test/test-ipc-send-recv.o \
91 test/test-loop-handles.o \
92 test/test-loop-stop.o \
93 test/test-multiple-listen.o \
95 test/test-osx-select.o \
96 test/test-pass-always.o \
97 test/test-ping-pong.o \
98 test/test-pipe-bind-error.o \
99 test/test-pipe-connect-error.o \
100 test/test-platform-output.o \
102 test/test-poll-close.o \
103 test/test-process-title.o \
105 test/test-run-nowait.o \
106 test/test-run-once.o \
107 test/test-semaphore.o \
108 test/test-shutdown-close.o \
109 test/test-shutdown-eof.o \
111 test/test-signal-multiple-loops.o \
113 test/test-stdio-over-pipes.o \
114 test/test-tcp-bind6-error.o \
115 test/test-tcp-bind-error.o \
116 test/test-tcp-close.o \
117 test/test-tcp-close-accept.o \
118 test/test-tcp-close-while-connecting.o \
119 test/test-tcp-connect6-error.o \
120 test/test-tcp-connect-error-after-write.o \
121 test/test-tcp-connect-error.o \
122 test/test-tcp-connect-timeout.o \
123 test/test-tcp-flags.o \
124 test/test-tcp-open.o \
125 test/test-tcp-read-stop.o \
126 test/test-tcp-shutdown-after-write.o \
127 test/test-tcp-unexpected-read.o \
128 test/test-tcp-writealot.o \
129 test/test-tcp-write-to-half-open-connection.o \
131 test/test-threadpool.o \
132 test/test-threadpool-cancel.o \
133 test/test-timer-again.o \
134 test/test-timer-from-check.o \
137 test/test-udp-dgram-too-big.o \
138 test/test-udp-ipv6.o \
139 test/test-udp-multicast-join.o \
140 test/test-udp-multicast-ttl.o \
141 test/test-udp-open.o \
142 test/test-udp-options.o \
143 test/test-udp-send-and-recv.o \
145 test/test-walk-handles.o \
146 test/test-watcher-cross-stop.o \
148 .PHONY: all bench clean clean-platform distclean test
150 run-tests$(E): test/run-tests.o test/runner.o $(RUNNER_SRC) $(TESTS) libuv.a
151 $(CC) $(CPPFLAGS) $(RUNNER_CFLAGS) -o $@ $^ $(RUNNER_LIBS) $(RUNNER_LDFLAGS)
153 run-benchmarks$(E): test/run-benchmarks.o test/runner.o $(RUNNER_SRC) $(BENCHMARKS) libuv.a
154 $(CC) $(CPPFLAGS) $(RUNNER_CFLAGS) -o $@ $^ $(RUNNER_LIBS) $(RUNNER_LDFLAGS)
156 test/echo.o: test/echo.c test/echo.h
161 bench: run-benchmarks$(E)
164 clean distclean: clean-platform
165 $(RM) libuv.a libuv.$(SOEXT) \
166 test/run-tests.o test/run-benchmarks.o \
167 test/run-tests$(E) test/run-benchmarks$(E) \
168 $(BENCHMARKS) $(TESTS) $(RUNNER_LIBS)