Makefile.in 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. #
  2. # OS X makefile generics
  3. #
  4. DSOLDFLAGS = -dynamiclib
  5. DSOPRE = lib
  6. DSOPOST = .dylib
  7. DSORPATH =
  8. DSOSONAME = -install_name ${LIBDIR}/
  9. STRIP ?= strip
  10. #
  11. # darwin specific recipes.
  12. # Enable 'make install' and 'make uninstall' for darwin builds.
  13. #
  14. ifeq (${SUBPLATFORM},darwin)
  15. include arch/install.inc
  16. # No platform-specific files to install
  17. install-arch:
  18. uninstall-arch:
  19. endif
  20. #
  21. # darwin-dist specific recipes.
  22. # These recipes are intended to produce portable Mac OS X .apps.
  23. # This setup is extremely old and for Intel Macs has been superceded
  24. # by the Xcode project folder (see: arch/xcode). However, this is still
  25. # required to build PowerPC Mac .apps.
  26. #
  27. ifeq (${SUBPLATFORM},darwin-dist)
  28. .PHONY: dist lipo package_clean
  29. # Make dylib path the same as the executable path instead
  30. DSOSONAME = -install_name @executable_path/
  31. # Override these to determine which builds are included in the .app.
  32. PREFIX_I686 ?=
  33. PREFIX_AMD64 ?=
  34. PREFIX_PPC ?=
  35. PREFIX_PPC64 ?=
  36. HAS_PREFIX=1
  37. ifeq (${PREFIX_I686},)
  38. ifeq (${PREFIX_AMD64},)
  39. ifeq (${PREFIX_PPC},)
  40. ifeq (${PREFIX_PPC64},)
  41. HAS_PREFIX=0
  42. endif
  43. endif
  44. endif
  45. endif
  46. # Override these to match the compiler(s) being used.
  47. CROSS_COMPILE_X86_CC ?= i686-apple-darwin10-gcc-4.2.1
  48. CROSS_COMPILE_X86_CXX ?= i686-apple-darwin10-g++-4.2.1
  49. CROSS_COMPILE_PPC_CC ?= powerpc-apple-darwin10-gcc-4.2.1
  50. CROSS_COMPILE_PPC_CXX ?= powerpc-apple-darwin10-g++-4.2.1
  51. ifeq (${ARCH},)
  52. ARCH := i686
  53. endif
  54. ifeq (${ARCH},i686)
  55. CC := ${CROSS_COMPILE_X86_CC} -mmacosx-version-min=10.6
  56. CXX := ${CROSS_COMPILE_X86_CXX} -mmacosx-version-min=10.6
  57. REAL_ARCH := i686
  58. else
  59. ifeq (${ARCH},amd64)
  60. CC := ${CROSS_COMPILE_X86_CC} -m64 -mmacosx-version-min=10.6
  61. CXX := ${CROSS_COMPILE_X86_CXX} -m64 -mmacosx-version-min=10.6
  62. REAL_ARCH := amd64
  63. else
  64. ifeq (${ARCH},ppc)
  65. CC := ${CROSS_COMPILE_PPC_CC} -mmacosx-version-min=10.4
  66. CXX := ${CROSS_COMPILE_PPC_CXX} -mmacosx-version-min=10.4
  67. REAL_ARCH := ppc
  68. else
  69. ifeq (${ARCH},ppc64)
  70. CC := ${CROSS_COMPILE_PPC_CC} -m64 -mmacosx-version-min=10.4
  71. CXX := ${CROSS_COMPILE_PPC_CXX} -m64 -mmacosx-version-min=10.4
  72. REAL_ARCH := ppc64
  73. else
  74. REAL_ARCH := $(error Invalid architecture selection)
  75. endif
  76. endif
  77. endif
  78. endif
  79. package: all
  80. ${MV} ${mzx} ${mzx}.${REAL_ARCH}
  81. ifneq (${BUILD_MZXRUN},)
  82. ${MV} ${mzxrun} ${mzxrun}.${REAL_ARCH}
  83. endif
  84. ifneq (${BUILD_MODULAR},)
  85. ${MV} ${core_target} ${core_target}.${REAL_ARCH}
  86. ${MV} ${editor_target} ${editor_target}.${REAL_ARCH}
  87. endif
  88. package_clean: clean
  89. ${RM} -f ${mzx}.${REAL_ARCH}
  90. ${RM} -f ${mzxrun}.${REAL_ARCH}
  91. ${RM} -f ${core_target}.${REAL_ARCH}
  92. ${RM} -f ${editor_target}.${REAL_ARCH}
  93. lipo:
  94. @arch/darwin/lipo.sh
  95. dist:
  96. ifeq (${HAS_PREFIX},0)
  97. $(error No dist target prefixes defined)
  98. endif
  99. ifneq (${PREFIX_I686},)
  100. @${MAKE} PREFIX=${PREFIX_I686} ARCH=i686 package
  101. @${MAKE} PREFIX=${PREFIX_I686} ARCH=i686 clean
  102. endif
  103. ifneq (${PREFIX_AMD64},)
  104. @${MAKE} PREFIX=${PREFIX_AMD64} ARCH=amd64 package
  105. @${MAKE} PREFIX=${PREFIX_AMD64} ARCH=amd64 clean
  106. endif
  107. ifneq (${PREFIX_PPC},)
  108. @${MAKE} PREFIX=${PREFIX_PPC} ARCH=ppc package
  109. @${MAKE} PREFIX=${PREFIX_PPC} ARCH=ppc clean
  110. endif
  111. ifneq (${PREFIX_PPC64},)
  112. @${MAKE} PREFIX=${PREFIX_PPC64} ARCH=ppc64 package
  113. @${MAKE} PREFIX=${PREFIX_PPC64} ARCH=ppc64 clean
  114. endif
  115. @${MAKE} lipo
  116. mzx_app := build/${SUBPLATFORM}/MegaZeux.app/
  117. mzxrun_app := build/${SUBPLATFORM}/MZXRun.app/
  118. build := ${mzx_app}/Contents/Resources
  119. build:
  120. ${RM} ${build}/*.debug ${build}/utils/*.debug
  121. ${MKDIR} ${mzx_app}/Contents/MacOS
  122. ${CP} contrib/icons/quantump.icns ${mzx_app}/Contents/Resources/MegaZeux.icns
  123. ${MV} ${build}/LICENSE ${build}/docs/
  124. ${MV} ${build}/docs ${mzx_app}/../
  125. ${MV} ${build}/${mzx} ${mzx_app}/Contents/MacOS/MegaZeux
  126. ifneq (${BUILD_MZXRUN},)
  127. ${MV} ${build}/${mzxrun} ${mzx_app}/Contents/MacOS/MZXRun
  128. endif
  129. ifneq (${BUILD_MODULAR},)
  130. ${MV} ${build}/${core_target} ${mzx_app}/Contents/MacOS/
  131. ${MV} ${build}/${editor_target} ${mzx_app}/Contents/MacOS/
  132. endif
  133. ifneq (${BUILD_MZXRUN},)
  134. ${CP} -r ${mzx_app} ${mzxrun_app}
  135. ${RM} ${mzx_app}/Contents/MacOS/MZXRun
  136. ${RM} ${mzxrun_app}/Contents/MacOS/MegaZeux
  137. ifneq (${BUILD_MODULAR},)
  138. ${RM} ${mzxrun_app}/Contents/MacOS/${editor_target}
  139. endif
  140. ${CP} arch/darwin/MZXRun.plist ${mzxrun_app}/Contents/Info.plist
  141. endif
  142. ${CP} arch/darwin/MegaZeux.plist ${mzx_app}/Contents/Info.plist
  143. archive: build
  144. @arch/darwin/dmg.sh ${TARGET}
  145. endif # darwin-dist