2005-04-17 02:20:36 +04:00
# This file is included by the global makefile so that you can add your own
# architecture-specific flags and dependencies. Remember to do have actions
# for "archclean" and "archdep" for cleaning up and making dependencies for
# this architecture
#
# This file is subject to the terms and conditions of the GNU General Public
# License. See the file "COPYING" in the main directory of this archive
# for more details.
#
# Copyright (C) 1994 by Linus Torvalds
# Changes for PPC by Gary Thomas
# Rewritten by Cort Dougan and Paul Mackerras
# Adjusted for PPC64 by Tom Gall
#
KERNELLOAD := 0xc000000000000000
# Set default 32 bits cross compilers for vdso and boot wrapper
CROSS32_COMPILE ?=
CROSS32CC := $( CROSS32_COMPILE) gcc
CROSS32AS := $( CROSS32_COMPILE) as
CROSS32LD := $( CROSS32_COMPILE) ld
CROSS32OBJCOPY := $( CROSS32_COMPILE) objcopy
# If we have a biarch compiler, use it for 32 bits cross compile if
# CROSS32_COMPILE wasn't explicitely defined, and add proper explicit
# target type to target compilers
HAS_BIARCH := $( call cc-option-yn, -m64)
i f e q ( $( HAS_BIARCH ) , y )
i f e q ( $( CROSS 32_COMPILE ) , )
CROSS32CC := $( CC) -m32
CROSS32AS := $( AS) -a32
CROSS32LD := $( LD) -m elf32ppc
CROSS32OBJCOPY := $( OBJCOPY)
e n d i f
2005-06-22 04:15:32 +04:00
o v e r r i d e AS += -a64
o v e r r i d e LD += -m elf64ppc
o v e r r i d e CC += -m64
2005-04-17 02:20:36 +04:00
e n d i f
export CROSS32CC CROSS32AS CROSS32LD CROSS32OBJCOPY
new_nm := $( shell if $( NM) --help 2>& 1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi )
i f e q ( $( new_nm ) , y )
NM := $( NM) --synthetic
e n d i f
CHECKFLAGS += -m64 -D__powerpc__
LDFLAGS := -m elf64ppc
LDFLAGS_vmlinux := -Bstatic -e $( KERNELLOAD) -Ttext $( KERNELLOAD)
CFLAGS += -msoft-float -pipe -mminimal-toc -mtraceback= none \
-mcall-aixdesc
2005-08-29 07:15:50 +04:00
# Temporary hack until we have migrated to asm-powerpc
CPPFLAGS += -Iinclude3
2005-04-17 02:20:36 +04:00
2005-05-03 09:34:58 +04:00
GCC_VERSION := $( call cc-version)
GCC_BROKEN_VEC := $( shell if [ $( GCC_VERSION) -lt 0400 ] ; then echo "y" ; fi ; )
2005-04-17 02:20:36 +04:00
i f e q ( $( CONFIG_POWER 4_ONLY ) , y )
i f e q ( $( CONFIG_ALTIVEC ) , y )
2005-05-03 09:34:58 +04:00
i f e q ( $( GCC_BROKEN_VEC ) , y )
2005-04-17 02:20:36 +04:00
CFLAGS += $( call cc-option,-mcpu= 970)
e l s e
CFLAGS += $( call cc-option,-mcpu= power4)
e n d i f
2005-05-03 09:34:58 +04:00
e l s e
CFLAGS += $( call cc-option,-mcpu= power4)
e n d i f
2005-04-17 02:20:36 +04:00
e l s e
CFLAGS += $( call cc-option,-mtune= power4)
e n d i f
# Enable unit-at-a-time mode when possible. It shrinks the
# kernel considerably.
CFLAGS += $( call cc-option,-funit-at-a-time)
head-y := arch/ppc64/kernel/head.o
libs-y += arch/ppc64/lib/
core-y += arch/ppc64/kernel/
core-y += arch/ppc64/mm/
core-$(CONFIG_XMON) += arch/ppc64/xmon/
drivers-$(CONFIG_OPROFILE) += arch/ppc64/oprofile/
boot := arch/ppc64/boot
boottarget-$(CONFIG_PPC_PSERIES) := zImage zImage.initrd
boottarget-$(CONFIG_PPC_MAPLE) := zImage zImage.initrd
boottarget-$(CONFIG_PPC_ISERIES) := vmlinux.sminitrd vmlinux.initrd vmlinux.sm
2005-06-23 03:43:37 +04:00
boottarget-$(CONFIG_PPC_BPA) := zImage zImage.initrd
2005-04-17 02:20:36 +04:00
$(boottarget-y) : vmlinux
$( Q) $( MAKE) $( build) = $( boot) $( boot) /$@
bootimage-$(CONFIG_PPC_PSERIES) := $( boot) /zImage
bootimage-$(CONFIG_PPC_PMAC) := vmlinux
bootimage-$(CONFIG_PPC_MAPLE) := $( boot) /zImage
2005-06-23 03:43:37 +04:00
bootimage-$(CONFIG_PPC_BPA) := zImage
2005-04-17 02:20:36 +04:00
bootimage-$(CONFIG_PPC_ISERIES) := vmlinux
BOOTIMAGE := $( bootimage-y)
install : vmlinux
$( Q) $( MAKE) $( build) = $( boot) BOOTIMAGE = $( BOOTIMAGE) $@
defaultimage-$(CONFIG_PPC_PSERIES) := zImage
defaultimage-$(CONFIG_PPC_PMAC) := vmlinux
defaultimage-$(CONFIG_PPC_MAPLE) := zImage
defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux
KBUILD_IMAGE := $( defaultimage-y)
all : $( KBUILD_IMAGE )
archclean :
$( Q) $( MAKE) $( clean) = $( boot)
2005-08-29 07:15:50 +04:00
$( Q) rm -rf include3
2005-04-17 02:20:36 +04:00
prepare : include /asm -ppc 64/offsets .h
arch/ppc64/kernel/asm-offsets.s : include /asm include /linux /version .h \
include/config/MARKER
include/asm-ppc64/offsets.h : arch /ppc 64/kernel /asm -offsets .s
$( call filechk,gen-asm-offsets)
2005-08-29 07:15:50 +04:00
# Temporary hack until we have migrated to asm-powerpc
include/asm : include 3/asm
include3/asm :
$( Q) if [ ! -d include3 ] ; then mkdir -p include3; fi ;
$( Q) ln -fsn $( srctree) /include/asm-powerpc include3/asm
2005-04-17 02:20:36 +04:00
d e f i n e a r c h h e l p
echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
echo ' zImage.initrd- Compressed kernel image with initrd attached,'
echo ' sourced from arch/$(ARCH)/boot/ramdisk.image.gz'
echo ' (arch/$(ARCH)/boot/zImage.initrd)'
e n d e f
CLEAN_FILES += include/asm-ppc64/offsets.h