os/macosx/Makefile
changeset 2714 2b34ba290a5c
parent 2713 9f06e1f94ce9
child 2717 0f385152f0d3
equal deleted inserted replaced
2713:9f06e1f94ce9 2714:2b34ba290a5c
     1 # $Id: Makefile 3214 2005-11-17 19:43:37Z bjarni $
     1 # $Id: Makefile 3214 2005-11-17 19:43:37Z bjarni $
     2 # This makefile is not a standalone makefile, but is called from the general one
     2 # This makefile is not a standalone makefile, but is called from the general one
     3 # it contains targets specific to MacOS X
     3 # it contains targets specific to MacOS X
     4 
       
     5 ifdef UNIVERSAL_OTHER_HALF
       
     6 # don't call anything in this file if it is building the 2nd half of an universal binary
       
     7 # all that needs to be done will be done with the first call
       
     8 OSX:=
       
     9 else
       
    10 
     4 
    11 ifdef BUILD_UNIVERSAL_BINARY
     5 ifdef BUILD_UNIVERSAL_BINARY
    12 BUILD_UNIVERSAL_BINARY:=build_universal_binary
     6 BUILD_UNIVERSAL_BINARY:=build_universal_binary
    13 endif
     7 endif
    14 
     8 
    28 
    22 
    29 ifndef LDFLAGS_UNI
    23 ifndef LDFLAGS_UNI
    30 	LDFLAGS_UNI:= -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk
    24 	LDFLAGS_UNI:= -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk
    31 endif
    25 endif
    32 
    26 
       
    27 ifdef UNIVERSAL_OTHER_HALF
       
    28 # if UNIVERSAL_OTHER_HALF is defined, we know that the original makefile call will build the bundle
       
    29 BUILD_OSX_BUNDLE:=
       
    30 else
       
    31 BUILD_OSX_BUNDLE:=build_OSX_bundle
       
    32 endif
       
    33 
    33 # building an universal binary
    34 # building an universal binary
    34 # since we can only compile for PPC or x86 at any one time, we compile one and then
    35 # since we can only compile for PPC or x86 at any one time, we compile one and then
    35 # we make clean and compile the other one. In the end we use lipo to join them together
    36 # we make clean and compile the other one. In the end we use lipo to join them together
    36 # when this is done, we can continue with the targets from the first run, which is build_OSX_bundle
    37 # when this is done, we can continue with the targets from the first run, which is build_OSX_bundle
    37 
    38 
    44 	$(Q)cp $(TTD) temp_binary_dir/$(TTD)_b
    45 	$(Q)cp $(TTD) temp_binary_dir/$(TTD)_b
    45 	@echo '===> Joining binaries into one universal one'
    46 	@echo '===> Joining binaries into one universal one'
    46 	$(Q)lipo temp_binary_dir/$(TTD)_a temp_binary_dir/$(TTD)_b -create -output $(TTD)
    47 	$(Q)lipo temp_binary_dir/$(TTD)_a temp_binary_dir/$(TTD)_b -create -output $(TTD)
    47 	$(Q)rm -rf temp_binary_dir
    48 	$(Q)rm -rf temp_binary_dir
    48 
    49 
       
    50 
       
    51 
    49 # build the bundle. OSX wants to keep apps in bundles, so we will give it one
    52 # build the bundle. OSX wants to keep apps in bundles, so we will give it one
    50 # the good thing about bundles is that you can keep extra files in them, so we keep lng files and a data dir in it
    53 # the good thing about bundles is that you can keep extra files in them, so we keep lng files and a data dir in it
    51 
    54 
    52 build_OSX_bundle: $(TTD) $(BUILD_UNIVERSAL_BINARY)
    55 $(BUILD_OSX_BUNDLE): $(TTD) $(BUILD_UNIVERSAL_BINARY)
    53 	$(Q)rm -fr "$(OSXAPP)"
    56 	$(Q)rm -fr "$(OSXAPP)"
    54 	$(Q)mkdir -p "$(OSXAPP)"/Contents/MacOS
    57 	$(Q)mkdir -p "$(OSXAPP)"/Contents/MacOS
    55 	$(Q)mkdir -p "$(OSXAPP)"/Contents/Resources
    58 	$(Q)mkdir -p "$(OSXAPP)"/Contents/Resources
    56 	$(Q)mkdir -p "$(OSXAPP)"/Contents/Data
    59 	$(Q)mkdir -p "$(OSXAPP)"/Contents/Data
    57 	$(Q)mkdir -p "$(OSXAPP)"/Contents/Lang
    60 	$(Q)mkdir -p "$(OSXAPP)"/Contents/Lang
    79 	$(Q)cp known-bugs.txt "OpenTTD $(RELEASE)"/known-bugs.txt
    82 	$(Q)cp known-bugs.txt "OpenTTD $(RELEASE)"/known-bugs.txt
    80 	$(Q)cp scenario/* "OpenTTD $(RELEASE)"/scenario/
    83 	$(Q)cp scenario/* "OpenTTD $(RELEASE)"/scenario/
    81 	$(Q)/usr/bin/hdiutil create -ov -format UDZO -srcfolder "OpenTTD $(RELEASE)" openttd-"$(RELEASE)"-osx.dmg
    84 	$(Q)/usr/bin/hdiutil create -ov -format UDZO -srcfolder "OpenTTD $(RELEASE)" openttd-"$(RELEASE)"-osx.dmg
    82 	$(Q)rm -fr "OpenTTD $(RELEASE)"
    85 	$(Q)rm -fr "OpenTTD $(RELEASE)"
    83 
    86 
    84 $(OSX): $(TTD) build_OSX_bundle
    87 $(OSX): $(TTD) $(BUILD_OSX_BUNDLE)
    85 
    88 
    86 .PHONY: release build_OSX_bundle $(BUILD_UNIVERSAL_BINARY)
    89 .PHONY: release $(BUILD_OSX_BUNDLE) $(BUILD_UNIVERSAL_BINARY)
    87 
       
    88 endif