Makefile
changeset 561 9a0c469a251c
parent 551 f69b4fc48d19
child 563 a6ef8e441cd6
equal deleted inserted replaced
560:60e198893a41 561:9a0c469a251c
    87 #		share/games/openttd. (Will be prefixed with $PREFIX)
    87 #		share/games/openttd. (Will be prefixed with $PREFIX)
    88 # PERSONAL_DIR:	The directory where openttd.cfg and the save folder will be
    88 # PERSONAL_DIR:	The directory where openttd.cfg and the save folder will be
    89 #		stored. You cannot use ~ here, define USE_HOMEDIR for that.
    89 #		stored. You cannot use ~ here, define USE_HOMEDIR for that.
    90 # USE_HOMEDIR:	If this variable is set, PERSONAL_DIR will be prefixed with
    90 # USE_HOMEDIR:	If this variable is set, PERSONAL_DIR will be prefixed with
    91 #		~/ at runtime (the user's homedir)
    91 #		~/ at runtime (the user's homedir)
       
    92 # SECOND_DATA_PATH  Use this data dir if a file is not found in the data dir in the data path
       
    93 # CUSTOM_LANG_PATH  If this is set, it will use the path given to search for lng files 
       
    94 #		instead of the lang dir in the data path
       
    95 #   NOTE: both SECOND_DATA_PATH and CUSTOM_LANG_PATH uses paths relative to where OTTD is opened
    92 #
    96 #
    93 # DEST_DIR:	make install will use this directory instead of the filesystem
    97 # DEST_DIR:	make install will use this directory instead of the filesystem
    94 # 		root to install its files. This should normally not be used by
    98 # 		root to install its files. This should normally not be used by
    95 # 		ordinary users, currently it is only used for the debian
    99 # 		ordinary users, currently it is only used for the debian
    96 # 		packaging. This value should only be set when calling `make
   100 # 		packaging. This value should only be set when calling `make
   111 # Configuration
   115 # Configuration
   112 #
   116 #
   113 
   117 
   114 # Makefile version tag
   118 # Makefile version tag
   115 # it checks if the version tag in makefile.config is the same and force update outdated config files
   119 # it checks if the version tag in makefile.config is the same and force update outdated config files
   116 MAKEFILE_VERSION:=4
   120 MAKEFILE_VERSION:=5
   117 
   121 
   118 # CONFIG_WRITER have to be found even for manual configuration
   122 # CONFIG_WRITER have to be found even for manual configuration
   119 CONFIG_WRITER=makefiledir/Makefile.config_writer
   123 CONFIG_WRITER=makefiledir/Makefile.config_writer
   120 
   124 
   121 ifndef MANUAL_CONFIG
   125 ifndef MANUAL_CONFIG
   442 # MIDI setup
   446 # MIDI setup
   443 ifdef OSX
   447 ifdef OSX
   444 ifndef MIDI
   448 ifndef MIDI
   445 MIDI:=$(OSXAPP)/contents/macos/track_starter
   449 MIDI:=$(OSXAPP)/contents/macos/track_starter
   446 endif
   450 endif
       
   451 ifndef SECOND_DATA_PATH
       
   452 SECOND_DATA_PATH:="$(OSXAPP)/contents/data/"
       
   453 endif
       
   454 ifndef CUSTOM_LANG_DIR
       
   455 CUSTOM_LANG_DIR:="$(OSXAPP)/contents/lang/"
       
   456 endif
   447 endif
   457 endif
   448 
   458 
   449 ifdef MIDI
   459 ifdef MIDI
   450 CDEFS += -DEXTERNAL_PLAYER=\"$(MIDI)\"
   460 CDEFS += -DEXTERNAL_PLAYER=\"$(MIDI)\"
   451 ifdef MIDI_ARG
   461 ifdef MIDI_ARG
   465 # now we test if disabling it as a general breaks it for anybody
   475 # now we test if disabling it as a general breaks it for anybody
   466 #LIBS += -lresolv
   476 #LIBS += -lresolv
   467 endif
   477 endif
   468 endif
   478 endif
   469 endif
   479 endif
       
   480 endif
       
   481 
       
   482 
       
   483 ifdef SECOND_DATA_PATH
       
   484 CDEFS += -DSECOND_DATA_DIR=\"$(SECOND_DATA_PATH)/\"
       
   485 endif
       
   486 
       
   487 ifdef CUSTOM_LANG_DIR
       
   488 CDEFS += -DCUSTOM_LANG_DIR=\"$(CUSTOM_LANG_DIR)/\"
   470 endif
   489 endif
   471 
   490 
   472 ifdef WITH_DIRECTMUSIC
   491 ifdef WITH_DIRECTMUSIC
   473 CDEFS += -DWIN32_ENABLE_DIRECTMUSIC_SUPPORT
   492 CDEFS += -DWIN32_ENABLE_DIRECTMUSIC_SUPPORT
   474 endif
   493 endif
   602 $(TTD): table/strings.h $(ttd_OBJS) $(MAKE_CONFIG)
   621 $(TTD): table/strings.h $(ttd_OBJS) $(MAKE_CONFIG)
   603 	$(if $(VERBOSE),@echo '$(C_LINK) $@ $(TTDLDFLAGS) $(ttd_OBJS) $(LIBS)';,@echo 'Compiling and Linking $@';) \
   622 	$(if $(VERBOSE),@echo '$(C_LINK) $@ $(TTDLDFLAGS) $(ttd_OBJS) $(LIBS)';,@echo 'Compiling and Linking $@';) \
   604  		$(C_LINK) $@ $(TTDLDFLAGS) $(ttd_OBJS) $(LIBS) $(VERBOSE_FILTER)
   623  		$(C_LINK) $@ $(TTDLDFLAGS) $(ttd_OBJS) $(LIBS) $(VERBOSE_FILTER)
   605 
   624 
   606 $(OSX):
   625 $(OSX):
       
   626 	@rm -fr $(OSXAPP)
   607 	@mkdir -p $(OSXAPP)/Contents/MacOS
   627 	@mkdir -p $(OSXAPP)/Contents/MacOS
   608 	@mkdir -p $(OSXAPP)/Contents/Resources
   628 	@mkdir -p $(OSXAPP)/Contents/Resources
       
   629 	@mkdir -p $(OSXAPP)/Contents/Data
       
   630 	@mkdir -p $(OSXAPP)/Contents/Lang
   609 	@echo "APPL????" > $(OSXAPP)/Contents/PkgInfo
   631 	@echo "APPL????" > $(OSXAPP)/Contents/PkgInfo
   610 	@cp os/macos/ttd.icns $(OSXAPP)/Contents/Resources/openttd.icns
   632 	@cp os/macos/ttd.icns $(OSXAPP)/Contents/Resources/openttd.icns
   611 	@os/macos/plistgen.sh $(OSXAPP) $(REV)
   633 	@os/macos/plistgen.sh $(OSXAPP) $(REV)
   612 	@cp os/macos/track_starter $(OSXAPP)/contents/macos
   634 	@cp os/macos/track_starter $(OSXAPP)/contents/macos
   613 	@ls os/macos | grep -q "\.class" || \
   635 	@ls os/macos | grep -q "\.class" || \
   614 	javac os/macos/OpenTTDMidi.java
   636 	javac os/macos/OpenTTDMidi.java
   615 	@cp os/macos/OpenTTDMidi.class $(OSXAPP)/contents/macos
   637 	@cp os/macos/OpenTTDMidi.class $(OSXAPP)/contents/macos
       
   638 	@cp data/* $(OSXAPP)/Contents/data/
       
   639 	@cp lang/*.lng $(OSXAPP)/Contents/lang/
   616 	@cp $(TTD) $(OSXAPP)/Contents/MacOS/$(TTD)
   640 	@cp $(TTD) $(OSXAPP)/Contents/MacOS/$(TTD)
       
   641 	
       
   642 	
   617 
   643 
   618 $(endwarnings): $(64_bit_warnings)
   644 $(endwarnings): $(64_bit_warnings)
   619 
   645 
   620 $(64_bit_warnings):
   646 $(64_bit_warnings):
   621 	$(warning 64 bit CPUs will get some 64 bit specific bugs!)
   647 	$(warning 64 bit CPUs will get some 64 bit specific bugs!)