aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2006-07-21 00:22:52 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2006-07-21 00:22:52 +0000
commit4a4e4e0747175848f1a51b20e472334c1e8f052d (patch)
tree6846303f888be1fc1338c59902271ba7e3f951a9
parent6768962545c5e0060cb2974453736a9a83c9ba12 (diff)
more work on centralizing the CPU optimization flags. With GNU/Linux on PowerPC and Mac OS X on Intel, things are becoming more complicated... ;)
svn path=/trunk/; revision=5389
-rw-r--r--packages/Makefile3
-rw-r--r--packages/Makefile.buildlayout11
-rw-r--r--packages/darwin_app/Makefile14
-rwxr-xr-xpackages/linux_make/Makefile36
-rwxr-xr-xpackages/win32_inno/Makefile20
5 files changed, 34 insertions, 50 deletions
diff --git a/packages/Makefile b/packages/Makefile
index 4914081f..6f3a20ab 100644
--- a/packages/Makefile
+++ b/packages/Makefile
@@ -85,9 +85,6 @@ ZEXY_VERSION := $(shell grep VERSION $(externals_src)/zexy/src/zexy.h | \
grep -v _VERSION | cut -d ' ' -f 3 | cut -d '"' -f 2)
-
-OPT_FLAGS = -O6 -funroll-loops -fomit-frame-pointer
-
# these are sent to all of the various Makefiles so that they all copy their
# output to the same directory tree
DEST_PATHS = BUILDLAYOUT_DIR=$(BUILDLAYOUT_DIR) \
diff --git a/packages/Makefile.buildlayout b/packages/Makefile.buildlayout
index 27fb3f6b..d80264b8 100644
--- a/packages/Makefile.buildlayout
+++ b/packages/Makefile.buildlayout
@@ -58,6 +58,17 @@ endif
#==============================================================================#
#
+## CFLAGS
+#
+#==============================================================================#
+
+# base level optimizations
+OPT_CFLAGS = -O3 -funroll-loops -fomit-frame-pointer
+
+DEBUG_CFLAGS = -ggdb
+
+#==============================================================================#
+#
# DIRECTORY STRUCTURE
#
#==============================================================================#
diff --git a/packages/darwin_app/Makefile b/packages/darwin_app/Makefile
index 1ea9e05e..3768c4a9 100644
--- a/packages/darwin_app/Makefile
+++ b/packages/darwin_app/Makefile
@@ -30,8 +30,9 @@ WISH_CONTENTS = "$(WISH)/Contents"
include $(BUILDLAYOUT_DIR)/Makefile.buildlayout
-# base level optimizations
-OPT_CFLAGS = -O3 -funroll-loops -fomit-frame-pointer
+
+# which CPU to compile for
+TARGET_PLATFORM := $(shell uname -p)
# CPU-specific gleaned from http://developer.apple.com/releasenotes/DeveloperTools/GCC3.html
# check this too: http://hpc.sourceforge.net/
@@ -46,8 +47,13 @@ OPT_CFLAGS = -O3 -funroll-loops -fomit-frame-pointer
# PowerPC G5 (gcc-3.3)
#OPT_CFLAGS += -fast -fPIC -faltivec -mpowerpc-gpopt -mpowerpc-gfxopt
-# Package default, support older PowerPCs, but G4 (7450) is the most common
-OPT_CFLAGS += -mcpu=powerpc -mtune=7450 -mpowerpc-gfxopt
+# auto-vectorization would be nice:
+# http://gcc.gnu.org/projects/tree-ssa/vectorization.html
+
+ifeq ($(TARGET_PLATFORM),powerpc)
+ # Package default, support older PowerPCs, but G4 (7450) is the most common
+ OPT_CFLAGS += -mcpu=powerpc -mtune=7450 -mpowerpc-gfxopt
+endif
# these are sent to all of the various Makefiles so that they all copy their
diff --git a/packages/linux_make/Makefile b/packages/linux_make/Makefile
index 68772ecd..e3816c46 100755
--- a/packages/linux_make/Makefile
+++ b/packages/linux_make/Makefile
@@ -17,31 +17,21 @@ prefix = /usr/local
include $(BUILDLAYOUT_DIR)/Makefile.buildlayout
-
-# base level optimizations
-OPT_CFLAGS = -O3 -funroll-loops -fomit-frame-pointer
-
+TARGET_PLATFORM := $(shell uname -m)
+ifeq ($(TARGET_PLATFORM),i686)
# Generic x86 (tune for Pentium III, since that's more common these days)
-#OPT_CFLAGS += -mcpu=i386 -mtune=pentium3
-OPT_CFLAGS += -mcpu=pentium
+OPT_CFLAGS += -march=i386 -mtune=pentium3
+else
+ ifeq ($(TARGET_PLATFORM),ppc)
+ OPT_CFLAGS += -pipe -fsigned-char -mpowerpc-gfxopt
+ else
+ # more CPUs should go here
+ OPT_CFLAGS +=
+ endif
+endif
+
+# lots more here: http://www.gentoo.se/docs/doc-cflags.php
-# INTEL
-#
-# Pentium MMX
-#OPT_CFLAGS += -mcpu=pentium-mmx -mmmx
-# Pentium Pro
-#OPT_CFLAGS += -mcpu=pentiumpro -mmmx
-# Pentium II/Celeron
-#OPT_CFLAGS += -mfpmath=sse -mmmx -msse -mcpu=pentium2
-# Pentium III/Celeron2
-#OPT_CFLAGS += -mfpmath=sse -mmmx -msse -mcpu=pentium3
-# Pentium 4
-#OPT_CFLAGS += -mfpmath=sse -mmmx -msse -msse2 -mcpu=pentium4
-
-# AMD
-#
-# Athlon XP K7
-#OPT_CFLAGS = -O3 -mcpu=athlon-xp -m3dnow -msse -mfpmath=sse
# these are sent to all of the various Makefiles so that they all copy their
# output to the same directory tree
diff --git a/packages/win32_inno/Makefile b/packages/win32_inno/Makefile
index e4768073..baaf191b 100755
--- a/packages/win32_inno/Makefile
+++ b/packages/win32_inno/Makefile
@@ -12,30 +12,10 @@ BUILDLAYOUT_DIR = $(CWD)/..
include $(BUILDLAYOUT_DIR)/Makefile.buildlayout
-# base level optimizations
-OPT_CFLAGS = -O3 -funroll-loops -fomit-frame-pointer
# Generic x86 (tune for Pentium III, since that's most common these days)
OPT_CFLAGS += -mcpu=i586 -mtune=pentium3
-# INTEL
-#
-# Pentium MMX
-#OPT_CFLAGS += -march=pentium-mmx -mmmx
-# Pentium Pro
-#OPT_CFLAGS += -march=pentiumpro -mmmx
-# Pentium II/Celeron
-#OPT_CFLAGS += -mfpmath=sse -mmmx -msse -march=pentium2
-# Pentium III/Celeron2
-#OPT_CFLAGS += -mfpmath=sse -mmmx -msse -march=pentium3
-# Pentium 4
-#OPT_CFLAGS += -mfpmath=sse -mmmx -msse -msse2 -march=pentium4
-
-# AMD
-#
-# Athlon XP K7
-#OPT_CFLAGS = -O3 -march=athlon-xp -m3dnow -msse -mfpmath=sse
-
# these are sent to all of the various Makefiles so that they all copy their
# output to the same directory tree