71 # If you want to use `make install' to install the game globally, you should |
71 # If you want to use `make install' to install the game globally, you should |
72 # define it _before_ you build the game. If you only define INSTALL when you |
72 # define it _before_ you build the game. If you only define INSTALL when you |
73 # do `make install', the game won't be able to find it's files (so you should |
73 # do `make install', the game won't be able to find it's files (so you should |
74 # also define all the following paths before building). |
74 # also define all the following paths before building). |
75 # |
75 # |
|
76 # OSX specific paths are set in os/macosx/Makefile |
|
77 # MAKEMOVEABLE moves the dynamic libs into the bundle to make the app independent from end user's libs (OSX only) |
|
78 # |
76 # So, the following paths should be defined if INSTALL is defined. |
79 # So, the following paths should be defined if INSTALL is defined. |
77 # None of these paths have to end with / |
80 # None of these paths have to end with / |
78 # PREFIX: Normally /usr/local |
81 # PREFIX: Normally /usr/local |
79 # BINARY_DIR: The location of the binary, normally games. (Will be prefixed |
82 # BINARY_DIR: The location of the binary, normally games. (Will be prefixed |
80 # with $PREFIX) |
83 # with $PREFIX) |
796 |
794 |
797 $(TTD): $(OBJS) $(MAKE_CONFIG) |
795 $(TTD): $(OBJS) $(MAKE_CONFIG) |
798 @echo '===> Linking $@' |
796 @echo '===> Linking $@' |
799 $(Q)$(CC) $(LDFLAGS) $(TTDLDFLAGS) $(OBJS) $(LIBS) -o $@ |
797 $(Q)$(CC) $(LDFLAGS) $(TTDLDFLAGS) $(OBJS) $(LIBS) -o $@ |
800 |
798 |
801 $(OSX): $(TTD) |
799 ifdef OSX |
802 $(Q)rm -fr "$(OSXAPP)" |
800 -include os/macosx/Makefile |
803 $(Q)mkdir -p "$(OSXAPP)"/Contents/MacOS |
801 endif |
804 $(Q)mkdir -p "$(OSXAPP)"/Contents/Resources |
|
805 $(Q)mkdir -p "$(OSXAPP)"/Contents/Data |
|
806 $(Q)mkdir -p "$(OSXAPP)"/Contents/Lang |
|
807 $(Q)echo "APPL????" > "$(OSXAPP)"/Contents/PkgInfo |
|
808 $(Q)cp os/macosx/openttd.icns "$(OSXAPP)"/Contents/Resources/openttd.icns |
|
809 $(Q)os/macosx/plistgen.sh "$(OSXAPP)" "$(REV)" |
|
810 $(Q)cp data/* "$(OSXAPP)"/Contents/Data/ |
|
811 $(Q)cp lang/*.lng "$(OSXAPP)"/Contents/Lang/ |
|
812 $(Q)cp $(TTD) "$(OSXAPP)"/Contents/MacOS/$(TTD) |
|
813 |
802 |
814 $(STRGEN): strgen/strgen.c endian_host.h |
803 $(STRGEN): strgen/strgen.c endian_host.h |
815 @echo '===> Compiling and Linking $@' |
804 @echo '===> Compiling and Linking $@' |
816 $(Q)$(CC_HOST) $(CFLAGS_HOST) $(CDEFS) $< -o $@ |
805 $(Q)$(CC_HOST) $(CFLAGS_HOST) $(CDEFS) $< -o $@ |
817 |
806 |
860 @echo "Release archive can be found in RAM:t/ now." |
849 @echo "Release archive can be found in RAM:t/ now." |
861 |
850 |
862 .PHONY: release |
851 .PHONY: release |
863 endif |
852 endif |
864 |
853 |
865 ifdef OSX |
|
866 release: all |
|
867 $(Q)mkdir -p "OpenTTD $(RELEASE)" |
|
868 $(Q)mkdir -p "OpenTTD $(RELEASE)"/docs |
|
869 $(Q)mkdir -p "OpenTTD $(RELEASE)"/scenario |
|
870 $(Q)cp -R $(OSXAPP) "OpenTTD $(RELEASE)"/ |
|
871 $(Q)cp docs/OSX_where_did_the_package_go.txt "OpenTTD $(RELEASE)"/Where\ did\ the\ package\ go.txt |
|
872 $(Q)cp readme.txt "OpenTTD $(RELEASE)"/docs/ |
|
873 $(Q)cp docs/README_if_game_crashed_on_OSX.txt "OpenTTD $(RELEASE)"/docs/readme\ if\ crashed\ on\ OSX.txt |
|
874 $(Q)cp docs/console.txt "OpenTTD $(RELEASE)"/docs/ |
|
875 $(Q)cp COPYING "OpenTTD $(RELEASE)"/docs/ |
|
876 $(Q)cp changelog.txt "OpenTTD $(RELEASE)"/docs/ |
|
877 $(Q)cp docs/README_if_game_crashed_on_OSX.txt "OpenTTD $(RELEASE)"/docs/ |
|
878 $(Q)cp os/macosx/*.webloc "OpenTTD $(RELEASE)" |
|
879 $(Q)cp known-bugs.txt "OpenTTD $(RELEASE)"/known-bugs.txt |
|
880 $(Q)cp scenario/* "OpenTTD $(RELEASE)"/scenario/ |
|
881 $(Q)/usr/bin/hdiutil create -ov -format UDZO -srcfolder "OpenTTD $(RELEASE)" openttd-"$(RELEASE)"-osx.dmg |
|
882 $(Q)rm -fr "OpenTTD $(RELEASE)" |
|
883 |
|
884 nightly_build: all |
|
885 $(Q)mkdir -p "OpenTTD_nightly_$(DATE)" |
|
886 $(Q)mkdir -p "OpenTTD_nightly_$(DATE)"/docs |
|
887 $(Q)cp -R $(OSXAPP) "OpenTTD_nightly_$(DATE)"/ |
|
888 $(Q)cp docs/OSX_where_did_the_package_go.txt "OpenTTD_nightly_$(DATE)"/Where\ did\ the\ package\ go.txt |
|
889 $(Q)cp readme.txt "OpenTTD_nightly_$(DATE)"/docs/ |
|
890 $(Q)cp docs/README_if_game_crashed_on_OSX.txt "OpenTTD_nightly_$(DATE)"/docs/readme\ if\ crashed\ on\ OSX.txt |
|
891 $(Q)cp docs/console.txt "OpenTTD_nightly_$(DATE)"/docs/ |
|
892 $(Q)cp COPYING "OpenTTD_nightly_$(DATE)"/docs/ |
|
893 $(Q)cp revisionlog.txt "OpenTTD_nightly_$(DATE)"/revisionlog.txt |
|
894 $(Q)cp docs/README_if_game_crashed_on_OSX.txt "OpenTTD_nightly_$(DATE)"/docs/ |
|
895 $(Q)cp os/macosx/*.webloc "OpenTTD_nightly_$(DATE)"/ |
|
896 $(Q)/usr/bin/hdiutil create -ov -format UDZO -srcfolder "OpenTTD_nightly_$(DATE)" openttd-nightly-"$(DATE)".dmg |
|
897 $(Q)rm -fr "OpenTTD_nightly_$(DATE)" |
|
898 |
|
899 .PHONY: release nightly_build |
|
900 endif |
|
901 |
|
902 rev.c: FORCE |
854 rev.c: FORCE |
903 @# setting the revision number in a place, there the binary can read it |
855 @# setting the revision number in a place, there the binary can read it |
904 @echo 'const char _openttd_revision[] = "$(REV)";' >>rev.c.new |
856 @echo 'const char _openttd_revision[] = "$(REV)";' >>rev.c.new |
905 @# some additions for MorphOS versions tag |
857 @# some additions for MorphOS versions tag |
906 @echo '#ifdef __MORPHOS__' >>rev.c.new |
858 @echo '#ifdef __MORPHOS__' >>rev.c.new |