-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
59 lines (41 loc) · 1.71 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
all: libgevent.a
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
ifdef MSVC
uname_S := MINGW
endif
CPPFLAGS += -Ilibuv/include -Ilibuv/include/uv-private -I. -fPIC
ifeq (Darwin,$(uname_S))
SOEXT = dylib
else
SOEXT = so
endif
ifneq (,$(findstring MINGW,$(uname_S)))
include libuv/config-mingw.mk
else
include libuv/config-unix.mk
endif
libuv/libuv.a:
cd libuv && make libuv.a
gevent.o: gevent.c gevent.h
$(CC) $(CSTDFLAG) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
libgevent.a: gevent.o libuv/libuv.a
$(AR) rcs $@ $^
HELPERS=libuv/test/test-stdio-over-pipes.c libuv/test/test-ipc.c libuv/test/test-ipc-send-recv.c libuv/test/test-platform-output.c
TESTS=libuv/test/blackhole-server.c libuv/test/echo-server.c test/test-*.c $(HELPERS)
BENCHMARKS=libuv/test/blackhole-server.c libuv/test/echo-server.c test/benchmark-*.c $(HELPERS)
test/run-tests$(E): CPPFLAGS += -Ilibuv/test
test/run-tests$(E): libuv/test/run-tests.c libuv/test/runner.c libuv/$(RUNNER_SRC) $(TESTS) libgevent.a libuv/libuv.a
mv -f libuv/test/test-list.h libuv/test/test-list.h.saved 2> /dev/null || true
$(CC) $(CPPFLAGS) $(RUNNER_CFLAGS) -o $@ $^ -Llibuv $(RUNNER_LIBS) $(LDFLAGS)
test/run-benchmarks$(E): CPPFLAGS += -Ilibuv/test
test/run-benchmarks$(E): libuv/test/run-benchmarks.c libuv/test/runner.c libuv/$(RUNNER_SRC) $(BENCHMARKS) libgevent.a libuv/libuv.a
mv -f libuv/test/benchmark-list.h libuv/test/benchmark-list.h.saved 2> /dev/null || true
$(CC) $(CPPFLAGS) $(RUNNER_CFLAGS) -o $@ $^ -Llibuv $(RUNNER_LIBS) $(LDFLAGS)
.PHONY: clean clean-platform distclean distclean-platform test bench
test: test/run-tests$(E)
$<
bench: test/run-benchmarks$(E)
$<
clean:
$(RM) *.o *.a test/run-tests$(E) test/run-benchmarks$(E)
cd libuv && make clean