-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
51 lines (39 loc) · 1 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
NGINX_URI=http://nginx.org/download/
NGINX_VER=1.9.12
NGINX_SRC=nginx-$(NGINX_VER).tar.gz
DISTDIR=./nginx_agent
DISTNAME=nginx_agent_`date +%Y%m%d`.`uname -m`.zip
CFLAGS=-g
LDFLAGS=-Wl,-rpath,'\$$\$$ORIGIN/../lib'
all: dist
$(NGINX_SRC):
wget $(NGINX_URI)$(NGINX_SRC)
build: $(NGINX_SRC)
tar xzf $(NGINX_SRC)
mv nginx-$(NGINX_VER) build
touch build
build/Makefile: build
cd build && \
./configure \
--with-cc-opt="$(CFLAGS)" \
--with-ld-opt="$(LDFLAGS)" \
--prefix=./ \
--sbin-path=./bin/nginx \
--add-module=../ \
--with-http_ssl_module \
--with-pcre
build/bin/nginx: build/Makefile
make -C build
dist: build/bin/nginx
rm -rf $(DISTDIR)
make -C build install DESTDIR="../$(DISTDIR)/"
cp -rp extlib/common/lib $(DISTDIR)
cp -rp conf $(DISTDIR)
mv $(DISTDIR)/conf/agentadmin.sh $(DISTDIR)/bin/
install -m 755 extlib/common/bin/crypt_util $(DISTDIR)/bin/
install -m 644 README.md $(DISTDIR)
zip -r $(DISTNAME) $(DISTDIR)
clean:
rm -rf build/Makefile build/objs/
distclean:
rm -rf build/