comparison make/linux/makefiles/gcc.make @ 5897:7292cff45988

7141244: build-infra merge: Include $(SPEC) in makefiles and make variables overridable Reviewed-by: dholmes, ohrstrom, ohair, jcoomes
author erikj
date Wed, 22 Feb 2012 09:24:35 +0100
parents 719f7007c8e8
children 3d7ea1dbe0de
comparison
equal deleted inserted replaced
5896:b5ab7482dbf9 5897:7292cff45988
23 # 23 #
24 24
25 #------------------------------------------------------------------------ 25 #------------------------------------------------------------------------
26 # CC, CXX & AS 26 # CC, CXX & AS
27 27
28 # When cross-compiling the ALT_COMPILER_PATH points 28 # If a SPEC is not set already, then use these defaults.
29 # to the cross-compilation toolset 29 ifeq ($(SPEC),)
30 ifdef CROSS_COMPILE_ARCH 30 # When cross-compiling the ALT_COMPILER_PATH points
31 CXX = $(ALT_COMPILER_PATH)/g++ 31 # to the cross-compilation toolset
32 CC = $(ALT_COMPILER_PATH)/gcc 32 ifdef CROSS_COMPILE_ARCH
33 HOSTCXX = g++ 33 CXX = $(ALT_COMPILER_PATH)/g++
34 HOSTCC = gcc 34 CC = $(ALT_COMPILER_PATH)/gcc
35 else 35 HOSTCXX = g++
36 CXX = g++ 36 HOSTCC = gcc
37 CC = gcc 37 STRIP = $(ALT_COMPILER_PATH)/strip
38 HOSTCXX = $(CXX) 38 else
39 HOSTCC = $(CC) 39 CXX = g++
40 endif 40 CC = gcc
41 41 HOSTCXX = $(CXX)
42 AS = $(CC) -c 42 HOSTCC = $(CC)
43 STRIP = strip
44 endif
45 AS = $(CC) -c
46 endif
47
43 48
44 # -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only 49 # -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only
45 # prints the numbers (e.g. "2.95", "3.2.1") 50 # prints the numbers (e.g. "2.95", "3.2.1")
46 CC_VER_MAJOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1) 51 CC_VER_MAJOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1)
47 CC_VER_MINOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2) 52 CC_VER_MINOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2)
259 # We are building Embedded for a small device 264 # We are building Embedded for a small device
260 # favor code space over speed 265 # favor code space over speed
261 ifdef MINIMIZE_RAM_USAGE 266 ifdef MINIMIZE_RAM_USAGE
262 CFLAGS += -DMINIMIZE_RAM_USAGE 267 CFLAGS += -DMINIMIZE_RAM_USAGE
263 endif 268 endif
264
265 ifdef CROSS_COMPILE_ARCH
266 STRIP = $(ALT_COMPILER_PATH)/strip
267 else
268 STRIP = strip
269 endif