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
10 # * IBM Corporation - initial implementation
11 # ****************************************************************************/
13 #############################################################################
15 #############################################################################
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)
22 ifeq (ppc64,$(findstring ppc64,$(ARCH)))
23 ifeq ($(ARCH), ppc64le)
24 EXTRA_CC = -mbig -mabi=elfv1
29 CROSS ?= powerpc64-linux-
35 HOSTCFLAGS = -g -Wall -W -O2 -I. -I../include
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
43 # V=0 means completely silent
44 # V=1 means brief output
45 # V=2 means full output
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"
68 OBJCOPY ?= $(CROSS)objcopy
69 OBJDUMP ?= $(CROSS)objdump
70 STRIP ?= $(CROSS)strip
72 RANLIB ?= $(CROSS)ranlib
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)
79 export CC AS LD CLEAN OBJCOPY OBJDUMP STRIP AR RANLIB CFLAGS