init 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # Copyright (C) Igor Sysoev
  2. NGX_MAKEFILE=$NGX_OBJS/Makefile
  3. NGX_MODULES_C=$NGX_OBJS/ngx_modules.c
  4. NGX_AUTO_HEADERS_H=$NGX_OBJS/ngx_auto_headers.h
  5. NGX_AUTO_CONFIG_H=$NGX_OBJS/ngx_auto_config.h
  6. NGX_AUTOTEST=$NGX_OBJS/autotest
  7. NGX_AUTOCONF_ERR=$NGX_OBJS/autoconf.err
  8. # STUBs
  9. NGX_ERR=$NGX_OBJS/autoconf.err
  10. MAKEFILE=$NGX_OBJS/Makefile
  11. NGX_PCH=
  12. NGX_USE_PCH=
  13. # check the echo's "-n" option and "\c" capability
  14. if echo "test\c" | grep c >/dev/null; then
  15. if echo -n test | grep n >/dev/null; then
  16. ngx_n=
  17. ngx_c=
  18. else
  19. ngx_n=-n
  20. ngx_c=
  21. fi
  22. else
  23. ngx_n=
  24. ngx_c='\c'
  25. fi
  26. # create Makefile
  27. cat << END > Makefile
  28. build:
  29. \$(MAKE) -f $NGX_MAKEFILE
  30. install:
  31. \$(MAKE) -f $NGX_MAKEFILE install
  32. clean:
  33. rm -rf Makefile $NGX_OBJS
  34. upgrade:
  35. $NGX_SBIN_PATH -t
  36. kill -USR2 \`cat $NGX_PID_PATH\`
  37. sleep 1
  38. test -f $NGX_PID_PATH.oldbin
  39. kill -QUIT \`cat $NGX_PID_PATH.oldbin\`
  40. upgrade1:
  41. # upgrade 0.1.x to 0.2+
  42. $NGX_SBIN_PATH -t
  43. cp $NGX_PID_PATH $NGX_PID_PATH.oldbin
  44. kill -USR2 \`cat $NGX_PID_PATH\`
  45. sleep 1
  46. test -f $NGX_PID_PATH.oldbin
  47. cp $NGX_PID_PATH $NGX_PID_PATH.newbin
  48. kill -QUIT \`cat $NGX_PID_PATH.oldbin\`
  49. END