-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (49 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
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
NGINX_OUT_DIR:=$(ROOT_DIR)/build/nginx
NGINX_SRC_DIR:=$(ROOT_DIR)/vendor/nginx
define nginx-configure
cd $(NGINX_SRC_DIR) && \
./auto/configure \
--with-cc-opt="-g -O0" \
--with-debug \
--with-compat \
--builddir=$(NGINX_OUT_DIR) \
--prefix=$(NGINX_OUT_DIR) \
--with-http_ssl_module \
$(1);
endef
all: build
configure: configure-static
configure-static:
$(call nginx-configure, "--add-module=$(ROOT_DIR)")
configure-dynamic:
$(call nginx-configure, "--add-dynamic-module=$(ROOT_DIR)")
build-nginx:
$(MAKE) -C $(NGINX_SRC_DIR) build install
rm -f $(NGINX_SRC_DIR)/Makefile
cd $(NGINX_OUT_DIR); \
[ -f $(ROOT_DIR)/nginx.conf ] && rm -f ./conf/nginx.conf && ln -s $(ROOT_DIR)/nginx.conf ./conf/nginx.conf || true
build: build-static
build-static: configure-static build-nginx
build-dynamic: configure-dynamic build-nginx
run:
LD_LIBRARY_PATH=./vendor/appdynamics-cpp-sdk/lib ./build/nginx/sbin/nginx
stop:
LD_LIBRARY_PATH=./vendor/appdynamics-cpp-sdk/lib ./build/nginx/sbin/nginx -s stop
cycle: compile run
test:
for a in $$(seq 100); do \
curl http://localhost:8888/; \
curl http://localhost:8888/index.html; \
curl http://localhost:8888/proxy-local/; \
curl http://localhost:8888/proxy-remote/; \
curl http://localhost:8888/proxy-remote/; \
curl http://localhost:8888/proxy-remote-upstream/; \
curl http://localhost:8888/login/; \
curl http://localhost:8888/foo/index.html; \
curl http://localhost:8888/foo/index.html/; \
curl http://localhost:8888/foo/bar; \
curl http://localhost:8888/11/22/33/44/55; \
curl http://localhost:8888/11/22/33/index.html; \
sleep 2; \
done