xref: /nginx/misc/GNUmakefile (revision 9211:0d9e536ec628)
1
2VER =		$(shell grep 'define NGINX_VERSION' src/core/nginx.h	\
3			| sed -e 's/^.*"\(.*\)".*/\1/')
4NGINX =		nginx-$(VER)
5TEMP =		tmp
6
7CC =		cl
8OBJS =		objs.msvc8
9OPENSSL =	openssl-3.0.13
10ZLIB =		zlib-1.3.1
11PCRE =		pcre2-10.39
12
13
14release: export
15
16	mv $(TEMP)/$(NGINX)/auto/configure $(TEMP)/$(NGINX)
17
18	mv $(TEMP)/$(NGINX)/docs/text/LICENSE $(TEMP)/$(NGINX)
19	mv $(TEMP)/$(NGINX)/docs/text/README $(TEMP)/$(NGINX)
20	mv $(TEMP)/$(NGINX)/docs/html $(TEMP)/$(NGINX)
21	mv $(TEMP)/$(NGINX)/docs/man $(TEMP)/$(NGINX)
22
23	$(MAKE) -f docs/GNUmakefile changes
24
25	rm -r $(TEMP)/$(NGINX)/docs
26	rm -r $(TEMP)/$(NGINX)/misc
27
28	tar -c -z -f $(NGINX).tar.gz --directory $(TEMP) $(NGINX)
29
30
31export:
32	rm -rf $(TEMP)
33	hg archive -X '.hg*' $(TEMP)/$(NGINX)
34
35
36RELEASE:
37	hg ci -m nginx-$(VER)-RELEASE
38	hg tag -m "release-$(VER) tag" release-$(VER)
39
40	$(MAKE) -f misc/GNUmakefile release
41
42
43win32:
44	./auto/configure						\
45		--with-cc=$(CC)						\
46		--builddir=$(OBJS)					\
47		--with-debug						\
48		--prefix= 						\
49		--conf-path=conf/nginx.conf				\
50		--pid-path=logs/nginx.pid				\
51		--http-log-path=logs/access.log				\
52		--error-log-path=logs/error.log				\
53		--sbin-path=nginx.exe					\
54		--http-client-body-temp-path=temp/client_body_temp	\
55		--http-proxy-temp-path=temp/proxy_temp			\
56		--http-fastcgi-temp-path=temp/fastcgi_temp		\
57		--http-scgi-temp-path=temp/scgi_temp			\
58		--http-uwsgi-temp-path=temp/uwsgi_temp			\
59		--with-cc-opt=-DFD_SETSIZE=1024				\
60		--with-pcre=$(OBJS)/lib/$(PCRE)				\
61		--with-zlib=$(OBJS)/lib/$(ZLIB)				\
62		--with-http_v2_module					\
63		--with-http_realip_module				\
64		--with-http_addition_module				\
65		--with-http_sub_module					\
66		--with-http_dav_module					\
67		--with-http_stub_status_module				\
68		--with-http_flv_module					\
69		--with-http_mp4_module					\
70		--with-http_gunzip_module				\
71		--with-http_gzip_static_module				\
72		--with-http_auth_request_module				\
73		--with-http_random_index_module				\
74		--with-http_secure_link_module				\
75		--with-http_slice_module				\
76		--with-mail						\
77		--with-stream						\
78		--with-stream_realip_module				\
79		--with-stream_ssl_preread_module			\
80		--with-openssl=$(OBJS)/lib/$(OPENSSL)			\
81		--with-openssl-opt="no-asm no-tests -D_WIN32_WINNT=0x0501" \
82		--with-http_ssl_module					\
83		--with-mail_ssl_module					\
84		--with-stream_ssl_module
85
86
87zip: export
88	rm -f $(NGINX).zip
89
90	mkdir -p $(TEMP)/$(NGINX)/docs.new
91	mkdir -p $(TEMP)/$(NGINX)/logs
92	mkdir -p $(TEMP)/$(NGINX)/temp
93
94	sed -i '' -e "s/$$/`printf '\r'`/" $(TEMP)/$(NGINX)/conf/*
95
96	mv $(TEMP)/$(NGINX)/docs/text/LICENSE $(TEMP)/$(NGINX)/docs.new
97	mv $(TEMP)/$(NGINX)/docs/text/README $(TEMP)/$(NGINX)/docs.new
98	mv $(TEMP)/$(NGINX)/docs/html $(TEMP)/$(NGINX)
99
100	rm -r $(TEMP)/$(NGINX)/docs
101	mv $(TEMP)/$(NGINX)/docs.new $(TEMP)/$(NGINX)/docs
102
103	cp -p $(OBJS)/nginx.exe $(TEMP)/$(NGINX)
104
105	$(MAKE) -f docs/GNUmakefile changes
106	mv $(TEMP)/$(NGINX)/CHANGES* $(TEMP)/$(NGINX)/docs/
107
108	cp -p $(OBJS)/lib/$(OPENSSL)/LICENSE.txt			\
109		$(TEMP)/$(NGINX)/docs/OpenSSL.LICENSE
110
111	cp -p $(OBJS)/lib/$(PCRE)/LICENCE				\
112		$(TEMP)/$(NGINX)/docs/PCRE.LICENCE
113
114	sed -ne '/^ (C) 1995-20/,/^  jloup@gzip\.org/p'			\
115		$(OBJS)/lib/$(ZLIB)/README				\
116		> $(TEMP)/$(NGINX)/docs/zlib.LICENSE
117
118	touch -r $(OBJS)/lib/$(ZLIB)/README				\
119		$(TEMP)/$(NGINX)/docs/zlib.LICENSE
120
121	rm -r $(TEMP)/$(NGINX)/auto
122	rm -r $(TEMP)/$(NGINX)/misc
123	rm -r $(TEMP)/$(NGINX)/src
124
125	cd $(TEMP) && zip -r ../$(NGINX).zip $(NGINX)
126
127
128icons:	src/os/win32/nginx.ico
129
130# 48x48, 32x32 and 16x16 icons
131
132src/os/win32/nginx.ico:	src/os/win32/nginx_icon48.xpm			\
133			src/os/win32/nginx_icon32.xpm			\
134			src/os/win32/nginx_icon16.xpm
135
136	test -d $(TEMP) || mkdir $(TEMP)
137
138	xpmtoppm --alphaout=$(TEMP)/nginx48.pbm				\
139		src/os/win32/nginx_icon48.xpm > $(TEMP)/nginx48.ppm
140
141	xpmtoppm --alphaout=$(TEMP)/nginx32.pbm				\
142		src/os/win32/nginx_icon32.xpm > $(TEMP)/nginx32.ppm
143
144	xpmtoppm --alphaout=$(TEMP)/nginx16.pbm				\
145		src/os/win32/nginx_icon16.xpm > $(TEMP)/nginx16.ppm
146
147	ppmtowinicon -output src/os/win32/nginx.ico -andpgms		\
148		$(TEMP)/nginx48.ppm $(TEMP)/nginx48.pbm			\
149		$(TEMP)/nginx32.ppm $(TEMP)/nginx32.pbm			\
150		$(TEMP)/nginx16.ppm $(TEMP)/nginx16.pbm
151