summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2006-03-15 14:03:09 +0000
committerbjarni <bjarni@openttd.org>2006-03-15 14:03:09 +0000
commit3ebc41c9fed6aa3f496884f452b9aaac62da6a3d (patch)
tree303fd17ea514eea165d715e87f7a62438f9a60d3 /Makefile
parent63a181f3969c23c9de1c69be8507471c22a084fb (diff)
downloadopenttd-3ebc41c9fed6aa3f496884f452b9aaac62da6a3d.tar.xz
(svn r3882) -Codechange: [OSX] changed the way universal and tripple binaries are build
Instead of compiling a binary for each arch and then join them in the end, each .o file is now compiled as a fat file This means that the makefile will not call itself to make a binary for each target and we don't have to make clean between each build it also means that if one file changed, we don't have to recompile all files Another benefit is since it's handled at .o level and though LDFLAGS, no special code is needed if we decide to compile more binaries (like a lot of stuff used to happen at post linking) We also needs much less flags to set up, so it should be even easier to get to work out of the box now The tradeoff in doing so is that now the binary needs at least OSX 10.3.9 to execute To deal with this issue, the JAGUAR flag can be used to compile for older OSes. We will release a binary for old OSes at next release to see if anybody even downloads it (not that many people use OSX 10.2 anymore) GPMI will not work on 10.2 anyway so we will cut support for it some day anyway
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 11 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 9646660bb..1320fd09e 100644
--- a/Makefile
+++ b/Makefile
@@ -130,7 +130,7 @@
# Makefile version tag
# it checks if the version tag in Makefile.config is the same and force update outdated config files
-MAKEFILE_VERSION:=8
+MAKEFILE_VERSION:=9
# CONFIG_WRITER has to be found even for manual configuration
CONFIG_WRITER=makefiledir/Makefile.config_writer
@@ -346,7 +346,9 @@ ifdef OSX
# 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
ifdef IS_G5
-BASECFLAGS += -mtune=970 -mcpu=970 -mpowerpc-gpopt
+ifndef UNIVERSAL_BINARY
+BASECFLAGS += $(G5_FLAGS)
+endif
endif
else
ifdef MORPHOS
@@ -995,17 +997,21 @@ endif
$(Q)$(CC) $(OBJCFLAGS) $(CDEFS) -MM $< | sed 's#^$(@F:%.d=%.o):#$@ $(@:.deps/%.d=%.o):#' > $@
+ifndef TRIPPLE_BINARY
+# building tripple binary object files is handled in os/macosx/Makefile
+# TARGET_CPU_FLAGS is used to set target CPUs in OSX universal binaries. It's empty for all other builds
%.o: %.c $(MAKE_CONFIG)
@echo '===> Compiling $<'
- $(Q)$(CC) $(CFLAGS) $(CDEFS) -c -o $@ $<
+ $(Q)$(CC) $(TARGET_CPU_FLAGS) $(CFLAGS) $(CDEFS) -c -o $@ $<
%.o: %.cpp $(MAKE_CONFIG)
@echo '===> Compiling $<'
- $(Q)$(CXX) $(CFLAGS) $(CDEFS) -c -o $@ $<
+ $(Q)$(CXX) $(TARGET_CPU_FLAGS) $(CFLAGS) $(CDEFS) -c -o $@ $<
%.o: %.m $(MAKE_CONFIG)
@echo '===> Compiling $<'
- $(Q)$(CC) $(CFLAGS) $(CDEFS) -c -o $@ $<
+ $(Q)$(CC) $(TARGET_CPU_FLAGS) $(CFLAGS) $(CDEFS) -c -o $@ $<
+endif
%.o: %.rc
@echo '===> Compiling resource $<'