@ -108,6 +108,8 @@
#
#
# UNIVERSAL_BINARY: builds a universal binary for OSX. Make sure you got both PPC and x86 libs. Only works with GCC 4 or newer
# UNIVERSAL_BINARY: builds a universal binary for OSX. Make sure you got both PPC and x86 libs. Only works with GCC 4 or newer
# TRIPLE_BINARY: builds a universal binary with the addition of code optimised for G5 (which means a total of 3 binaries in one file)
# TRIPLE_BINARY: builds a universal binary with the addition of code optimised for G5 (which means a total of 3 binaries in one file)
# OTTD_PPC, OTTD_PPC970, OTTD_i386: compile for target architecture.
# Multiple flags can be used so OTTD_PPC:=1 OTTD_i386:=1 produces the same result as UNIVERSAL_BINARY
#
#
# JAGUAR: Crosscompiling for OSX 1.2.8 (codenamed Jaguar). Only works if OSX is defined too. Only works with GCC 4 or newer
# JAGUAR: Crosscompiling for OSX 1.2.8 (codenamed Jaguar). Only works if OSX is defined too. Only works with GCC 4 or newer
# This can be changed to any PPC version of OSX by changing the ppc flags in Makefile.config
# This can be changed to any PPC version of OSX by changing the ppc flags in Makefile.config
@ -130,7 +132,7 @@
# Makefile version tag
# Makefile version tag
# it checks if the version tag in Makefile.config is the same and force update outdated config files
# it checks if the version tag in Makefile.config is the same and force update outdated config files
MAKEFILE_VERSION := 9
MAKEFILE_VERSION := 10
# CONFIG_WRITER has to be found even for manual configuration
# CONFIG_WRITER has to be found even for manual configuration
CONFIG_WRITER = makefiledir/Makefile.config_writer
CONFIG_WRITER = makefiledir/Makefile.config_writer
@ -345,11 +347,6 @@ endif
i f d e f O S X
i f d e f O S X
# these compilerflags makes the app run as fast as possible without making the app unstable. It works on G3 or newer
# these compilerflags makes the app run as fast as possible without making the app unstable. It works on G3 or newer
BASECFLAGS += -O3 -funroll-loops -fsched-interblock -falign-loops= 16 -falign-jumps= 16 -falign-functions= 16 -falign-jumps-max-skip= 15 -falign-loops-max-skip= 15 -mdynamic-no-pic
BASECFLAGS += -O3 -funroll-loops -fsched-interblock -falign-loops= 16 -falign-jumps= 16 -falign-functions= 16 -falign-jumps-max-skip= 15 -falign-loops-max-skip= 15 -mdynamic-no-pic
i f d e f I S _ G 5
i f n d e f U N I V E R S A L _ B I N A R Y
BASECFLAGS += $( G5_FLAGS)
e n d i f
e n d i f
e l s e
e l s e
i f d e f M O R P H O S
i f d e f M O R P H O S
BASECFLAGS += -I/gg/os-include -O2 -noixemul -fstrict-aliasing -fexpensive-optimizations
BASECFLAGS += -I/gg/os-include -O2 -noixemul -fstrict-aliasing -fexpensive-optimizations
@ -830,9 +827,12 @@ $(ENDIAN_CHECK): endian_check.c
$( Q) $( CC_HOST) $( CFLAGS_HOST) $( CDEFS) $< -o $@
$( Q) $( CC_HOST) $( CFLAGS_HOST) $( CDEFS) $< -o $@
i f n d e f N A T I V E _ O S X
# OSX links in os/macosx/Makefile to handle universal binaries better
$(TTD) : $( OBJS ) $( MAKE_CONFIG )
$(TTD) : $( OBJS ) $( MAKE_CONFIG )
@echo '===> Linking $@'
@echo '===> Linking $@'
$( Q) $( CC) $( LDFLAGS) $( TTDLDFLAGS) $( OBJS) $( LIBS) -o $@
$( Q) $( CC) $( LDFLAGS) $( TTDLDFLAGS) $( OBJS) $( LIBS) -o $@
e n d i f
$(STRGEN) : strgen /strgen .c endian_host .h
$(STRGEN) : strgen /strgen .c endian_host .h
@echo '===> Compiling and Linking $@'
@echo '===> Compiling and Linking $@'
@ -899,7 +899,7 @@ FORCE:
clean :
clean :
@echo '===> Cleaning up'
@echo '===> Cleaning up'
# endian.h is out-dated and no longer in use, so it can be removed soon
# endian.h is out-dated and no longer in use, so it can be removed soon
$( Q) rm -rf .deps *~ $( TTD) $( STRGEN) core table/strings.h $( LANGS) $( OBJS) $( OSX_MIDI_PLAYER_FILE) endian.h endian_host.h endian_target.h $( ENDIAN_CHECK)
$( Q) rm -rf .deps *~ $( TTD) $( STRGEN) core table/strings.h $( LANGS) $( OBJS) $( OSX_MIDI_PLAYER_FILE) endian.h endian_host.h endian_target.h $( ENDIAN_CHECK) .OSX
mrproper : clean
mrproper : clean
$( Q) rm -rf $( MAKE_CONFIG)
$( Q) rm -rf $( MAKE_CONFIG)
@ -1006,20 +1006,19 @@ endif
$( Q) $( CC) $( OBJCFLAGS) $( CDEFS) -MM $< | sed 's#^$(@F:%.d=%.o):#$@ $(@:.deps/%.d=%.o):#' > $@
$( Q) $( CC) $( OBJCFLAGS) $( CDEFS) -MM $< | sed 's#^$(@F:%.d=%.o):#$@ $(@:.deps/%.d=%.o):#' > $@
i f n d e f T R I P L E _ B I N A R Y
i f n d e f N A T I V E _ O S X
# building tripple binary object files is handled in os/macosx/Makefile
# OSX uses os/macosx/Makefile to compile files
# TARGET_CPU_FLAGS is used to set target CPUs in OSX universal binaries. It's empty for all other builds
%.o : %.c $( MAKE_CONFIG )
%.o : %.c $( MAKE_CONFIG )
@echo '===> Compiling $<'
@echo '===> Compiling $<'
$( Q) $( CC) $( TARGET_CPU_FLAGS) $( CFLAGS) $( CDEFS) -c -o $@ $<
$( Q) $( CC) $( CFLAGS) $( CDEFS) -c -o $@ $<
%.o : %.cpp $( MAKE_CONFIG )
%.o : %.cpp $( MAKE_CONFIG )
@echo '===> Compiling $<'
@echo '===> Compiling $<'
$( Q) $( CXX) $( TARGET_CPU_FLAGS) $( CFLAGS) $( CDEFS) -c -o $@ $<
$( Q) $( CXX) $( CFLAGS) $( CDEFS) -c -o $@ $<
%.o : %.m $( MAKE_CONFIG )
%.o : %.m $( MAKE_CONFIG )
@echo '===> Compiling $<'
@echo '===> Compiling $<'
$( Q) $( CC) $( TARGET_CPU_FLAGS) $( CFLAGS) $( CDEFS) -c -o $@ $<
$( Q) $( CC) $( CFLAGS) $( CDEFS) -c -o $@ $<
e n d i f
e n d i f
%.o : %.rc
%.o : %.rc