forked from rstudio/httpuv
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makevars
41 lines (29 loc) · 1.04 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
## Use the R_HOME indirection to support installations of multiple R version
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
FRAMEWORK = -framework CoreServices
endif
PKG_LIBS = `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"` ./libuv/libuv.a ./http-parser/http_parser.o ./sha1/sha1.o ./base64/base64.o $(FRAMEWORK)
ifeq ($(UNAME), SunOS)
PKG_LIBS += -lkstat -lsendfile
endif
ifeq ($(UNAME), FreeBSD)
PKG_LIBS += -lkvm
endif
PKG_CPPFLAGS = -I./libuv/include -I./http-parser -I./sha1 -I./base64
.PHONY: all libuv.a http-parser.o
all: $(SHLIB)
$(SHLIB): libuv.a http-parser.o sha1.o base64.o
libuv.a:
$(MAKE) --directory=libuv \
CC="$(CC)" CFLAGS="$(CFLAGS) -D__USE_MISC $(CPICFLAGS)" AR="$(AR)" RANLIB="$(RANLIB)" \
HAVE_DTRACE=0 \
libuv.a
http-parser.o:
$(MAKE) --directory=http-parser \
CC="$(CC)" CFLAGS="$(CFLAGS) $(CPICFLAGS)" AR="$(AR)" RANLIB="$(RANLIB)" \
http_parser.o
sha1.o:
(cd sha1 && $(CC) $(CFLAGS) $(CPICFLAGS) -c sha1.c -o sha1.o)
base64.o:
(cd base64 && $(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -c base64.cpp -o base64.o)