These changes are the raw update to qemu-2.6.
[kvmfornfv.git] / qemu / roms / SLOF / make.rules
1 # *****************************************************************************
2 # * Copyright (c) 2004, 2008 IBM Corporation
3 # * All rights reserved.
4 # * This program and the accompanying materials
5 # * are made available under the terms of the BSD License
6 # * which accompanies this distribution, and is available at
7 # * http://www.opensource.org/licenses/bsd-license.php
8 # *
9 # * Contributors:
10 # *     IBM Corporation - initial implementation
11 # ****************************************************************************/
12
13 #############################################################################
14 # BUILD ENV SETTINGS
15 #############################################################################
16
17 # CROSS is the prefix of your cross-compiler.
18 # You can override this variable in your environment (export CROSS=...).
19 ARCH := $(shell uname -p)
20
21 # Auto-detect ppc64
22 ifeq (ppc64,$(findstring ppc64,$(ARCH)))
23   ifeq ($(ARCH), ppc64le)
24     EXTRA_CC    = -mbig -mabi=elfv1
25     EXTRA_LD    = -mbig
26   endif
27 CROSS           ?=
28 else
29 CROSS           ?= powerpc64-linux-
30 endif
31
32 CELLSIZE        ?= 64
33
34 HOSTCC          ?= gcc
35 HOSTCFLAGS      = -g -Wall -W -O2 -I. -I../include
36 DD              = dd
37
38 ONLY_CC         = $(CROSS)gcc -m$(CELLSIZE) $(EXTRA_CC)
39 ONLY_AS         = $(CROSS)as -m$(CELLSIZE) $(EXTRA_LD)
40 ONLY_LD         = $(CROSS)ld -melf$(CELLSIZE)ppc
41
42 # Verbose level:
43 #   V=0 means completely silent
44 #   V=1 means brief output
45 #   V=2 means full output
46 V               ?= 1
47
48 ifeq ($(V),0)
49 Q               := @
50 MAKEFLAGS       += --silent
51 MAKE            += -s
52 endif
53
54 ifeq ($(V),1)
55 MAKEFLAGS       += --silent
56 MAKE            += -s
57 CC              = printf "\t[CC]\t%s\n" `basename "$@"`; $(ONLY_CC)
58 AS              = printf "\t[AS]\t%s\n" `basename "$@"`; $(ONLY_AS)
59 LD              = printf "\t[LD]\t%s\n" `basename "$@"`; $(ONLY_LD)
60 CLEAN           = printf "\t[CLEAN]\t%s\n" "$(DIRECTORY)$$dir"
61 else
62 CC              = $(ONLY_CC)
63 AS              = $(ONLY_AS)
64 LD              = $(ONLY_LD)
65 CLEAN           = echo -n
66 endif
67
68 OBJCOPY         ?= $(CROSS)objcopy
69 OBJDUMP         ?= $(CROSS)objdump
70 STRIP           ?= $(CROSS)strip
71 AR              ?= $(CROSS)ar
72 RANLIB          ?= $(CROSS)ranlib
73 CPP             ?= $(CROSS)cpp
74
75 WARNFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes
76 CFLAGS ?= -g -O2 -fno-builtin -ffreestanding -nostdinc -msoft-float -fno-strict-aliasing \
77           -mno-altivec -mabi=no-altivec -fno-stack-protector $(WARNFLAGS)
78
79 export CC AS LD CLEAN OBJCOPY OBJDUMP STRIP AR RANLIB CFLAGS
80