summaryrefslogtreecommitdiff
path: root/include/target.mk
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-09-26 17:53:09 +0000
committerFelix Fietkau <nbd@openwrt.org>2013-09-26 17:53:09 +0000
commit569da024f0f37b2477f8d1499fb4860a7b4a9cd5 (patch)
treec5390a263b729093305af03e49e92c07bfb5f590 /include/target.mk
parent3e5da21b150a24acb1fbce9749e78ee56c4645e9 (diff)
downloadmtk-20170518-569da024f0f37b2477f8d1499fb4860a7b4a9cd5.zip
mtk-20170518-569da024f0f37b2477f8d1499fb4860a7b4a9cd5.tar.gz
mtk-20170518-569da024f0f37b2477f8d1499fb4860a7b4a9cd5.tar.bz2
build: clean up default cflags handling
- reduce redundancy - introduce a CPU_TYPE variable for cpu specific options Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 38209
Diffstat (limited to 'include/target.mk')
-rw-r--r--include/target.mk35
1 files changed, 24 insertions, 11 deletions
diff --git a/include/target.mk b/include/target.mk
index e34d372..685013c 100644
--- a/include/target.mk
+++ b/include/target.mk
@@ -195,17 +195,30 @@ ifeq ($(DUMP),1)
# remove duplicates
FEATURES:=$(sort $(FEATURES))
endif
- DEFAULT_CFLAGS_i386=-O2 -pipe -march=i486
- DEFAULT_CFLAGS_x86_64=-O2 -pipe -march=athlon64
- DEFAULT_CFLAGS_m68k=-Os -pipe -mcfv4e
- DEFAULT_CFLAGS_mips=-Os -pipe -mips32 -mtune=mips32 -mno-branch-likely
- DEFAULT_CFLAGS_mipsel=$(DEFAULT_CFLAGS_mips)
- DEFAULT_CFLAGS_mips64=-Os -pipe -mips64 -mtune=mips64 -mabi=64
- DEFAULT_CFLAGS_mips64el=$(DEFAULT_CFLAGS_mips64)
- DEFAULT_CFLAGS_sparc=-Os -pipe -mcpu=ultrasparc
- DEFAULT_CFLAGS_arm=-Os -pipe -march=armv5te -mtune=xscale
- DEFAULT_CFLAGS_armeb=$(DEFAULT_CFLAGS_arm)
- DEFAULT_CFLAGS=$(if $(DEFAULT_CFLAGS_$(ARCH)),$(DEFAULT_CFLAGS_$(ARCH)),-Os -pipe)
+ CPU_CFLAGS = -Os -pipe
+ ifneq ($(findstring mips,$(ARCH)),)
+ ifneq ($(findstring mips64,$(ARCH)),)
+ CPU_TYPE ?= mips64
+ else
+ CPU_TYPE ?= mips32
+ endif
+ CPU_CFLAGS += -mno-branch-likely
+ CPU_CFLAGS_mips32 = -mips32 -mtune=mips32
+ CPU_CFLAGS_mips64 = -mips64 -mtune=mips64 -mabi=64
+ endif
+ ifeq ($(ARCH),i386)
+ CPU_TYPE ?= i486
+ CPU_CFLAGS_i486 = -march=i486
+ endif
+ ifneq ($(findstring arm,$(ARCH)),)
+ CPU_TYPE ?= xscale
+ CPU_CFLAGS_xscale = march=armv5te -mtune=xscale
+ endif
+ ifeq ($(ARCH),sparc)
+ CPU_TYPE = sparc
+ CPU_CFLAGS_ultrasparc = -mcpu=ultrasparc
+ endif
+ DEFAULT_CFLAGS=$(CPU_CFLAGS) $(CPU_CFLAGS_$(CPU_TYPE))
endif
define BuildTargets/DumpCurrent