GNUmakefile 4.2 KB

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