make 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. # Copyright (C) Igor Sysoev
  2. case "$NGX_CC_NAME" in
  3. msvc*)
  4. ngx_makefile=makefile.msvc
  5. ngx_opt="CPU_OPT=\"$CPU_OPT\" LIBC=$LIBC SHA1_ASM=$SHA1_ASM"
  6. ;;
  7. owc*)
  8. ngx_makefile=makefile.owc
  9. ngx_opt="CPU_OPT=\"$CPU_OPT\""
  10. ;;
  11. bcc)
  12. ngx_makefile=makefile.bcc
  13. ngx_opt="-DCPU_OPT=\"$CPU_OPT\" -DSHA1_ASM=$SHA1_ASM"
  14. ;;
  15. esac
  16. done=NO
  17. case "$NGX_PLATFORM" in
  18. win32)
  19. cp auto/lib/sha1/$ngx_makefile $SHA1
  20. cat << END >> $NGX_MAKEFILE
  21. `echo "$SHA1/sha1.lib: $NGX_MAKEFILE" | sed -e "s/\//$ngx_regex_dirsep/g"`
  22. cd `echo $SHA1 | sed -e "s/\//$ngx_regex_dirsep/g"`
  23. \$(MAKE) -f $ngx_makefile $ngx_opt
  24. cd ..\\..\\..
  25. END
  26. done=YES
  27. ;;
  28. SunOS:*:i86pc)
  29. if [ $SHA1_ASM = YES ]; then
  30. cat << END >> $NGX_MAKEFILE
  31. $SHA1/libsha.a: $NGX_MAKEFILE
  32. cd $SHA1 \\
  33. && \$(MAKE) CFLAGS="$SHA1_OPT -DSOL -DSHA1_ASM -DL_ENDIAN" \\
  34. CC="\$(CC)" CPP="\$(CPP)" \\
  35. SHA_ASM_OBJ=asm/sx86-sol.o clean libsha.a
  36. END
  37. done=YES
  38. fi
  39. ;;
  40. # FreeBSD: i386
  41. # Linux: i686
  42. *:i386 | *:i686)
  43. if [ $SHA1_ASM = YES ]; then
  44. cat << END >> $NGX_MAKEFILE
  45. $SHA1/libsha.a: $NGX_MAKEFILE
  46. cd $SHA1 \\
  47. && \$(MAKE) CFLAGS="$SHA1_OPT -DELF -DSHA1_ASM -DL_ENDIAN" \\
  48. CC="\$(CC)" CPP="\$(CPP)" \\
  49. SHA_ASM_OBJ=asm/sx86-elf.o clean libsha.a
  50. END
  51. done=YES
  52. fi
  53. ;;
  54. esac
  55. if [ $done = NO ]; then
  56. cat << END >> $NGX_MAKEFILE
  57. $SHA1/libsha.a: $NGX_MAKEFILE
  58. cd $SHA1 \\
  59. && \$(MAKE) CFLAGS="$SHA1_OPT" \\
  60. CC="\$(CC)" SHA_ASM_OBJ= clean libsha.a
  61. END
  62. fi