aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authork-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-08-18 10:01:01 +0000
committerk-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-08-18 10:01:01 +0000
commit1e96769e49f8f4fb27ea7039c7f1dba4b8af1fe5 (patch)
tree32711b213f72d05d0ce0586e285bd7022b587412
parentdb2ec4956bbb5846937ab81d4b75027515675e2f (diff)
downloadusdx-1e96769e49f8f4fb27ea7039c7f1dba4b8af1fe5.tar.gz
usdx-1e96769e49f8f4fb27ea7039c7f1dba4b8af1fe5.tar.xz
usdx-1e96769e49f8f4fb27ea7039c7f1dba4b8af1fe5.zip
first try to create a Mac OS X standalone app bundle
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1273 b956fd51-792f-4845-bead-9b4dfca2ff2c
-rw-r--r--Game/Code/Makefile.in40
1 files changed, 40 insertions, 0 deletions
diff --git a/Game/Code/Makefile.in b/Game/Code/Makefile.in
index a340518c..0ff80e69 100644
--- a/Game/Code/Makefile.in
+++ b/Game/Code/Makefile.in
@@ -278,6 +278,46 @@ macosx-app: all
@echo "Have fun."
@echo ""
+macosx-app-standalone: macosx-app
+# Create double clickable standalone (does not need fink) Mac OS X
+# application. Not fully test, but should work on 10.5.
+
+ @echo ""
+ @echo "Creating the standalone Mac OS X application"
+ @echo ""
+
+# copy the dylib and change its install names
+
+define install_osx_libraries
+ $(shell $(INSTALL) -m 755 $(dylib) $(macosx_bundle_path)/MacOS)
+ $(shell $(INSTALL_NAME_TOOL) -change $(dylib) @executable_path/$(notdir $(dylib)) $(macosx_bundle_path)/MacOS/ultrastardx)
+ $(shell $(INSTALL_NAME_TOOL) -id @executable_path/$(notdir $(dylib)) $(macosx_bundle_path)/MacOS/$(notdir $(dylib)))
+ $(foreach linked_dylibs_2,$(shell $(OTOOL) -L $(dylib) | grep version | cut -f 1 -d ' ' | grep -v \/System\/Library | grep -v \usr\/lib | grep -v executable_path),$(rename_secondary_osx_libraries))
+endef
+
+define rename_secondary_osx_libraries
+ $(shell $(INSTALL_NAME_TOOL) -change $(linked_dylibs_2) @executable_path/$(notdir $(linked_dylibs_2)) $(macosx_bundle_path)/MacOS/$(notdir $(dylib)))
+endef
+
+# work on the dylibs in $(macosx_bundle_path)/MacOS/ultrastardx
+ $(foreach dylib,$(shell $(OTOOL) -L $(macosx_bundle_path)/MacOS/ultrastardx | grep version | cut -f 1 -d ' ' | grep -v \/System\/Library | grep -v \/usr\/lib),$(install_osx_libraries))
+
+# work on the secondary dylibs from ffmpeg
+# libavcodec references all tertiary libraries of the ffmpeg libs
+ $(foreach dylib,$(shell $(OTOOL) -L /sw/lib/libavcodec.dylib | grep version | cut -f 1 -d ' ' | grep -v \/System\/Library | grep -v \/usr\/lib),$(install_osx_libraries))
+# same procedure in libfaac. it gets libgnugetopt
+ $(foreach dylib,$(shell $(OTOOL) -L /sw/lib/libfaac.dylib | grep version | cut -f 1 -d ' ' | grep -v \/System\/Library | grep -v \/usr\/lib),$(install_osx_libraries))
+
+# same procedure for tertiary libs in SDL_image
+ $(foreach dylib,$(shell $(OTOOL) -L /sw/lib/libSDL_image.dylib | grep version | cut -f 1 -d ' ' | grep -v \/System\/Library | grep -v \/usr\/lib),$(install_osx_libraries))
+
+# X11 libs as well, because users may not have installed it on 10.4
+ $(foreach dylib,$(shell $(OTOOL) -L /usr/X11/lib/libX11.dylib | grep version | cut -f 1 -d ' ' | grep -v \/System\/Library | grep -v \/usr\/lib),$(install_osx_libraries))
+
+# final messages
+ @echo "Standalone Mac OS X application created."
+ @echo ""
+
#################################################
# clean-up
#################################################