Makefile.local.mac 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # optimize mac binaries and/or build universal binaries
  2. CFLAGS += -Wno-gnu-variable-sized-type-not-at-end -Wno-address-of-packed-member
  3. #-----------------------------------------------------------------------------
  4. .PHONY : mac-distrib
  5. mac-distrib: mac1 doc $(INSTALL_SCRIPTS) gen-mac-distrib
  6. .PHONY : mac1
  7. mac1: mac-x86_64
  8. @echo
  9. @echo "----- building universal binaries -----"
  10. @for i in $(MAIN_TOOLS); do \
  11. lipo -create bin/x86_64/$${i} -output $${i}; \
  12. cp -p $${i} bin/$${i}; \
  13. done;
  14. @for i in $(WDF_LINKS); do \
  15. cp -p wdf $${i}; \
  16. cp -p wdf bin/$${i}; \
  17. done;
  18. @rm -rf bin/i386 bin/x86_64
  19. @echo "done"
  20. .PHONY : mac2
  21. mac2: mac-i386 mac-x86_64
  22. @echo
  23. @echo "----- building universal binaries -----"
  24. @for i in $(MAIN_TOOLS); do \
  25. lipo -create bin/i386/$${i} bin/x86_64/$${i} -output $${i}; \
  26. cp -p $${i} bin/$${i}; \
  27. done;
  28. @for i in $(WDF_LINKS); do \
  29. cp -p wdf $${i}; \
  30. cp -p wdf bin/$${i}; \
  31. done;
  32. @rm -rf bin/i386 bin/x86_64
  33. @echo "done"
  34. .PHONY : mac3
  35. mac3: mac-i386 mac-x86_64 mac-ppc
  36. @echo
  37. @echo "----- building universal binaries -----"
  38. @for i in $(MAIN_TOOLS); do \
  39. lipo -create bin/ppc/$${i} bin/i386/$${i} bin/x86_64/$${i} -output $${i}; \
  40. cp -p $${i} bin/$${i}; \
  41. done;
  42. @for i in $(WDF_LINKS); do \
  43. cp -p wdf $${i}; \
  44. cp -p wdf bin/$${i}; \
  45. done;
  46. @rm -rf bin/ppc bin/i386 bin/x86_64
  47. @echo "done"
  48. #-----------------------------------------------------------------------------
  49. .PHONY : mac-ppc
  50. mac-ppc:
  51. @echo
  52. @echo "----- building PowerPC -----"
  53. @XFLAGS="-arch ppc -mcpu=powerpc" make clean all
  54. @mkdir -p bin/ppc
  55. @mv $(MAIN_TOOLS) bin/ppc
  56. #-----------------------------------------------------------------------------
  57. .PHONY : mac-i386
  58. mac-i386:
  59. @echo
  60. @echo "----- building i386 -----"
  61. @XFLAGS="-arch i386 -mfpmath=sse -march=prescott" make clean all
  62. @mkdir -p bin/i386
  63. @mv $(MAIN_TOOLS) bin/i386
  64. #-----------------------------------------------------------------------------
  65. .PHONY : mac-x86_64
  66. mac-x86_64:
  67. @echo
  68. @echo "----- building X86-64 -----"
  69. @XFLAGS="-arch x86_64 -mfpmath=sse" make clean all
  70. @mkdir -p bin/x86_64
  71. @mv $(MAIN_TOOLS) bin/x86_64
  72. #-----------------------------------------------------------------------------
  73. .PHONY : gen-mac-distrib
  74. gen-mac-distrib:
  75. @printf "$(LOGFORMAT)" create "$(DISTRIB_PATH)" ""
  76. @rm -rf $(DISTRIB_PATH)
  77. @mkdir -p $(DISTRIB_PATH)/bin $(DISTRIB_PATH)/scripts
  78. @mkdir -p $(DISTRIB_PATH)/share $(DISTRIB_PATH)/doc
  79. @cp -p $(DISTRIB_FILES) $(DISTRIB_PATH)
  80. @cp -p $(MAIN_TOOLS) $(WDF_LINKS) $(DISTRIB_PATH)/bin
  81. @cp -p share/*.txt $(DISTRIB_PATH)/share
  82. @cp -p $(DOC_FILES) $(DISTRIB_PATH)/doc
  83. @cp -p $(SCRIPTS)/*.{sh,txt} $(DISTRIB_PATH)/scripts
  84. @chmod -R 755 $(DISTRIB_PATH)
  85. @chmod a+x $(DISTRIB_PATH)/*.sh $(DISTRIB_PATH)/scripts/*.sh $(DISTRIB_PATH)/bin/*
  86. @chmod -R a+X $(DISTRIB_PATH)
  87. -$(DISTRIB_PATH)/bin/wit version -l
  88. -$(DISTRIB_PATH)/bin/wit version -ll
  89. @tar -czf $(DISTRIB_PATH).tar.gz $(DISTRIB_PATH)
  90. @ln $(DISTRIB_PATH).tar.gz latest-mac.tar.gz