forked from r-lib/fs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makevars
49 lines (37 loc) · 1.09 KB
/
Makevars
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
UNAME := $(shell uname)
HOST :=
UNAMEO := $(shell uname -o)
LIBUV := libuv-1.38.1
PKG_LIBS = ./$(LIBUV)/.libs/libuv.a -pthread
SOURCES = $(wildcard *.cc unix/*.cc)
OBJECTS = $(SOURCES:.cc=.o)
ifeq ($(UNAME), SunOS)
PKG_LIBS += -lkstat -lsendfile -lsocket -lxnet
OBJECTS += bsd/setmode.o bsd/strmode.o bsd/reallocarray.o
endif
ifeq ($(UNAME), FreeBSD)
PKG_LIBS += -lkvm
endif
ifeq ($(UNAME), OpenBSD)
PKG_LIBS += -lkvm
endif
ifeq ($(UNAME), Linux)
ifeq ($(UNAMEO), Android)
HOST = --host=$(shell clang -print-target-triple)
endif
OBJECTS += bsd/setmode.o bsd/strmode.o bsd/reallocarray.o
endif
PKG_CPPFLAGS = -I./$(LIBUV)/include -I. -pthread
all: $(SHLIB)
$(SHLIB): $(LIBUV)/.libs/libuv.a
$(LIBUV)/Makefile:
(cd $(LIBUV) \
&& CC="$(CC)" CFLAGS="$(CFLAGS) $(CPPFLAGS) $(CPICFLAGS) $(C_VISIBILITY)" AR="$(AR)" RANLIB="$(RANLIB)" LDFLAGS="$(LDFLAGS)" ./configure --quiet $(HOST) --disable-shared)
$(LIBUV)/.libs/libuv.a: $(LIBUV)/Makefile
$(MAKE) --directory=$(LIBUV) \
HAVE_DTRACE=0
.PHONY: shlib-clean clean
# shlib-clean: clean
clean:
$(MAKE) --directory=$(LIBUV) distclean
rm -f $(OBJECTS)