-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMakefile
66 lines (51 loc) · 1.83 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
60
61
62
63
64
65
66
nginx/:
-git clone --branch release-1.13.9 --depth 1 https://github.com/nginx/nginx.git
nginx/objs/nginx: nginx/Makefile ipscrub/src/ngx_ipscrub_module.c
cd nginx && make
nginx/Makefile: nginx/
cd nginx && ./auto/configure --prefix=$(PWD)/dest --add-module=../ipscrub --add-dynamic-module=../ipscrub --with-compat
nginx/objs/ngx_ipscrub_module.so: nginx/Makefile
cd nginx && make modules
dest/conf/nginx.conf: ipscrub/nginx.conf dest/
cp $< $@
restart: nginx/objs/nginx dest/conf/nginx.conf
pkill nginx && $<
start: nginx/objs/nginx dest/conf/nginx.conf
@mkdir -p dest/logs/
$<
dest/:
mkdir -p dest/conf/
mkdir -p dest/logs/
test: clean test-sha1hash test-saltedhash test-ipv46hash test-dynmodule
test-sha1hash: ipscrub/test/sha1hash/test.sh ipscrub/test/sha1hash/nginx.conf dest/ nginx/objs/nginx
cp ipscrub/test/sha1hash/nginx.conf dest/conf/nginx.conf
-pkill nginx
nginx/objs/nginx
bash $<
test-saltedhash: ipscrub/test/saltedsha/test.sh ipscrub/test/saltedsha/nginx.conf dest/ nginx/objs/nginx
cp ipscrub/test/saltedsha/nginx.conf dest/conf/nginx.conf
-pkill nginx
nginx/objs/nginx
bash $<
test-ipv46hash: ipscrub/test/ipv46hash/test.sh ipscrub/test/ipv46hash/nginx.conf dest/ nginx/objs/nginx
cp ipscrub/test/ipv46hash/nginx.conf dest/conf/nginx.conf
-pkill nginx
nginx/objs/nginx
bash $<
test-dynmodule: ipscrub/test/dynmodule/test.sh nginx/objs/ngx_ipscrub_module.so
cd nginx && ./auto/configure --prefix=$(PWD)/dest --with-compat && make
cp nginx/objs/ngx_ipscrub_module.so dest/
cp ipscrub/test/dynmodule/nginx.conf dest/conf/nginx.conf
-pkill nginx
nginx/objs/nginx
bash $<
clean:
-rm -f nginx/Makefile
-rm -f nginx/objs/nginx
-rm -rf dest/
run-demo:
docker build -t ipscrub .
docker build -t ipscrub-demo-client demo/
docker-compose up --abort-on-container-exit
check-up-to-date: script/check-up-to-date.sh
$<