Changeset 38209


Ignore:
Timestamp:
2013-09-26T19:53:09+02:00 (4 years ago)
Author:
nbd
Message:

build: clean up default cflags handling

  • reduce redundancy
  • introduce a CPU_TYPE variable for cpu specific options

Signed-off-by: Felix Fietkau <nbd@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/target.mk

    r37818 r38209  
    196196    FEATURES:=$(sort $(FEATURES)) 
    197197  endif 
    198   DEFAULT_CFLAGS_i386=-O2 -pipe -march=i486 
    199   DEFAULT_CFLAGS_x86_64=-O2 -pipe -march=athlon64 
    200   DEFAULT_CFLAGS_m68k=-Os -pipe -mcfv4e 
    201   DEFAULT_CFLAGS_mips=-Os -pipe -mips32 -mtune=mips32 -mno-branch-likely 
    202   DEFAULT_CFLAGS_mipsel=$(DEFAULT_CFLAGS_mips) 
    203   DEFAULT_CFLAGS_mips64=-Os -pipe -mips64 -mtune=mips64 -mabi=64 
    204   DEFAULT_CFLAGS_mips64el=$(DEFAULT_CFLAGS_mips64) 
    205   DEFAULT_CFLAGS_sparc=-Os -pipe -mcpu=ultrasparc 
    206   DEFAULT_CFLAGS_arm=-Os -pipe -march=armv5te -mtune=xscale 
    207   DEFAULT_CFLAGS_armeb=$(DEFAULT_CFLAGS_arm) 
    208   DEFAULT_CFLAGS=$(if $(DEFAULT_CFLAGS_$(ARCH)),$(DEFAULT_CFLAGS_$(ARCH)),-Os -pipe) 
     198  CPU_CFLAGS = -Os -pipe 
     199  ifneq ($(findstring mips,$(ARCH)),) 
     200    ifneq ($(findstring mips64,$(ARCH)),) 
     201      CPU_TYPE ?= mips64 
     202    else 
     203      CPU_TYPE ?= mips32 
     204    endif 
     205    CPU_CFLAGS += -mno-branch-likely 
     206    CPU_CFLAGS_mips32 = -mips32 -mtune=mips32 
     207    CPU_CFLAGS_mips64 = -mips64 -mtune=mips64 -mabi=64 
     208  endif 
     209  ifeq ($(ARCH),i386) 
     210    CPU_TYPE ?= i486 
     211    CPU_CFLAGS_i486 = -march=i486 
     212  endif 
     213  ifneq ($(findstring arm,$(ARCH)),) 
     214    CPU_TYPE ?= xscale 
     215    CPU_CFLAGS_xscale = march=armv5te -mtune=xscale 
     216  endif 
     217  ifeq ($(ARCH),sparc) 
     218    CPU_TYPE = sparc 
     219    CPU_CFLAGS_ultrasparc = -mcpu=ultrasparc 
     220  endif 
     221  DEFAULT_CFLAGS=$(CPU_CFLAGS) $(CPU_CFLAGS_$(CPU_TYPE)) 
    209222endif 
    210223 
Note: See TracChangeset for help on using the changeset viewer.