-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
47 lines (34 loc) · 1.35 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
# used to mainly build dependencies
PROJECT_ROOT_DIR := $(shell readlink -f .)
DEPS_INSTALL_DIR = $(PROJECT_ROOT_DIR)/deps/install
LIBUV_DIR = $(PROJECT_ROOT_DIR)/deps/libuv
LLHTTP_DIR = $(PROJECT_ROOT_DIR)/deps/llhttp
RATLS_DIR = $(PROJECT_ROOT_DIR)/deps/ratls
.PHONY: all deps mrproper preparation
preparation:
git submodule update --init --recursive
# make sure ra_tls_options.c is already created
ratls_deps:
cd $(RATLS_DIR) && make clean \
&& make option/ra_tls_options.c && mkdir -p deps && make -j4 deps \
&& make ratls_libs \
&& make INSTALL_PREFIX=$(PROJECT_ROOT_DIR)/deps/install/ratls install \
&& cd $(PROJECT_ROOT_DIR)
ratls_deps_clean:
make -C $(RATLS_DIR) mrproper
server_deps:
mkdir -p $(DEPS_INSTALL_DIR)
cd $(LIBUV_DIR) && mkdir -p build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=$(DEPS_INSTALL_DIR)/libuv && make && make install && cd $(PROJECT_ROOT_DIR)
mkdir -p $(DEPS_INSTALL_DIR)/llhttp/include && mkdir -p $(DEPS_INSTALL_DIR)/llhttp/lib
npm --version
cd $(LLHTTP_DIR) && npm install && make && PREFIX=$(DEPS_INSTALL_DIR)/llhttp make install && cd $(PROJECT_ROOT_DIR)
server_deps_clean:
make -C $(LLHTTP_DIR) clean
rm -rf $(LLHTTP_DIR)/node_modules
rm -rf $(LIBUV_DIR)/build
deps: ratls_deps server_deps
all: preparation deps
clean:
@echo "nothing"
mrproper: clean server_deps_clean
rm -rf ${PROJECT_ROOT_DIR}/deps/install