xref: /linux/arch/powerpc/Makefile (revision cbf8a358be27ceecea5bd44cf82ab01683fcc90c)
114cf11afSPaul Mackerras# This file is included by the global makefile so that you can add your own
214cf11afSPaul Mackerras# architecture-specific flags and dependencies. Remember to do have actions
314cf11afSPaul Mackerras# for "archclean" and "archdep" for cleaning up and making dependencies for
414cf11afSPaul Mackerras# this architecture.
514cf11afSPaul Mackerras#
614cf11afSPaul Mackerras# This file is subject to the terms and conditions of the GNU General Public
714cf11afSPaul Mackerras# License.  See the file "COPYING" in the main directory of this archive
814cf11afSPaul Mackerras# for more details.
914cf11afSPaul Mackerras#
1014cf11afSPaul Mackerras# Copyright (C) 1994 by Linus Torvalds
1114cf11afSPaul Mackerras# Changes for PPC by Gary Thomas
1214cf11afSPaul Mackerras# Rewritten by Cort Dougan and Paul Mackerras
1314cf11afSPaul Mackerras#
1414cf11afSPaul Mackerras
1514cf11afSPaul MackerrasHAS_BIARCH	:= $(call cc-option-yn, -m32)
1614cf11afSPaul Mackerras
1714cf11afSPaul Mackerras# Set default 32 bits cross compilers for vdso and boot wrapper
1814cf11afSPaul MackerrasCROSS32_COMPILE ?=
1914cf11afSPaul Mackerras
2014cf11afSPaul MackerrasCROSS32CC		:= $(CROSS32_COMPILE)gcc
212bf11819SPaul MackerrasCROSS32AR		:= $(CROSS32_COMPILE)ar
2214cf11afSPaul Mackerras
2314cf11afSPaul Mackerrasifeq ($(HAS_BIARCH),y)
2414cf11afSPaul Mackerrasifeq ($(CROSS32_COMPILE),)
2514cf11afSPaul MackerrasCROSS32CC	:= $(CC) -m32
268995ac87SSegher BoessenkoolCROSS32AR	:= GNUTARGET=elf32-powerpc $(AR)
2714cf11afSPaul Mackerrasendif
2814cf11afSPaul Mackerrasendif
2914cf11afSPaul Mackerras
301976aef9SSegher Boessenkoolexport CROSS32CC CROSS32AR
3114cf11afSPaul Mackerras
32ca786f83SAdrian Bunkifeq ($(CROSS_COMPILE),)
338a5abdf8SPaul MackerrasKBUILD_DEFCONFIG := $(shell uname -m)_defconfig
34ca786f83SAdrian Bunkelse
35ca786f83SAdrian BunkKBUILD_DEFCONFIG := ppc64_defconfig
36ca786f83SAdrian Bunkendif
378a5abdf8SPaul Mackerras
3894b212c2SPaul Mackerrasifeq ($(CONFIG_PPC64),y)
3914cf11afSPaul Mackerrasnew_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi)
4014cf11afSPaul Mackerras
4114cf11afSPaul Mackerrasifeq ($(new_nm),y)
4214cf11afSPaul MackerrasNM		:= $(NM) --synthetic
4314cf11afSPaul Mackerrasendif
44a0588015SAnton Blanchardendif
4514cf11afSPaul Mackerras
46a0588015SAnton Blanchardifeq ($(CONFIG_PPC64),y)
47a0588015SAnton Blanchardifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
48a0588015SAnton BlanchardOLDARCH	:= ppc64le
49a0588015SAnton Blanchardelse
50a0588015SAnton BlanchardOLDARCH	:= ppc64
51a0588015SAnton Blanchardendif
52a0588015SAnton Blanchardelse
53a0588015SAnton Blanchardifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
54a0588015SAnton BlanchardOLDARCH	:= ppcle
5514cf11afSPaul Mackerraselse
56bbeb3f4cSStephen RothwellOLDARCH	:= ppc
572578bfaeSStephen Rothwellendif
58a0588015SAnton Blanchardendif
592578bfaeSStephen Rothwell
602578bfaeSStephen Rothwell# It seems there are times we use this Makefile without
612578bfaeSStephen Rothwell# including the config file, but this replicates the old behaviour
622578bfaeSStephen Rothwellifeq ($(CONFIG_WORD_SIZE),)
632578bfaeSStephen RothwellCONFIG_WORD_SIZE := 32
6414cf11afSPaul Mackerrasendif
6514cf11afSPaul Mackerras
66190554dbSStephen RothwellUTS_MACHINE := $(OLDARCH)
67190554dbSStephen Rothwell
68d72b0801SIan Munsieifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
69f036b368SAnton Blanchardoverride CC	+= -mlittle-endian -mno-strict-align
70d72b0801SIan Munsieoverride AS	+= -mlittle-endian
71d72b0801SIan Munsieoverride LD	+= -EL
72d72b0801SIan Munsieoverride CROSS32CC += -mlittle-endian
73d72b0801SIan Munsieoverride CROSS32AS += -mlittle-endian
74d72b0801SIan MunsieLDEMULATION	:= lppc
75d72b0801SIan MunsieGNUTARGET	:= powerpcle
76d72b0801SIan MunsieMULTIPLEWORD	:= -mno-multiple
77d72b0801SIan Munsieelse
78d72b0801SIan Munsieoverride CC	+= -mbig-endian
79d72b0801SIan Munsieoverride AS	+= -mbig-endian
80d72b0801SIan Munsieoverride LD	+= -EB
81d72b0801SIan MunsieLDEMULATION	:= ppc
82d72b0801SIan MunsieGNUTARGET	:= powerpc
83d72b0801SIan MunsieMULTIPLEWORD	:= -mmultiple
84d72b0801SIan Munsieendif
85d72b0801SIan Munsie
8614cf11afSPaul Mackerrasifeq ($(HAS_BIARCH),y)
872578bfaeSStephen Rothwelloverride AS	+= -a$(CONFIG_WORD_SIZE)
88d72b0801SIan Munsieoverride LD	+= -m elf$(CONFIG_WORD_SIZE)$(LDEMULATION)
892578bfaeSStephen Rothwelloverride CC	+= -m$(CONFIG_WORD_SIZE)
90d72b0801SIan Munsieoverride AR	:= GNUTARGET=elf$(CONFIG_WORD_SIZE)-$(GNUTARGET) $(AR)
9114cf11afSPaul Mackerrasendif
9214cf11afSPaul Mackerras
939c5f7d39SSuzuki PouloseLDFLAGS_vmlinux-y := -Bstatic
949c5f7d39SSuzuki PouloseLDFLAGS_vmlinux-$(CONFIG_RELOCATABLE) := -pie
959c5f7d39SSuzuki PouloseLDFLAGS_vmlinux	:= $(LDFLAGS_vmlinux-y)
9614cf11afSPaul Mackerras
971fbe9cf2SAnton Blanchardifeq ($(CONFIG_PPC64),y)
981fbe9cf2SAnton Blanchardifeq ($(call cc-option-yn,-mcmodel=medium),y)
991fbe9cf2SAnton Blanchard	# -mcmodel=medium breaks modules because it uses 32bit offsets from
1001fbe9cf2SAnton Blanchard	# the TOC pointer to create pointers where possible. Pointers into the
1011fbe9cf2SAnton Blanchard	# percpu data area are created by this method.
1021fbe9cf2SAnton Blanchard	#
1031fbe9cf2SAnton Blanchard	# The kernel module loader relocates the percpu data section from the
1041fbe9cf2SAnton Blanchard	# original location (starting with 0xd...) to somewhere in the base
1051fbe9cf2SAnton Blanchard	# kernel percpu data space (starting with 0xc...). We need a full
1061fbe9cf2SAnton Blanchard	# 64bit relocation for this to work, hence -mcmodel=large.
1071fbe9cf2SAnton Blanchard	KBUILD_CFLAGS_MODULE += -mcmodel=large
1081fbe9cf2SAnton Blanchardelse
1091fbe9cf2SAnton Blanchard	export NO_MINIMAL_TOC := -mno-minimal-toc
1101fbe9cf2SAnton Blanchardendif
1111fbe9cf2SAnton Blanchardendif
1121fbe9cf2SAnton Blanchard
1131fbe9cf2SAnton BlanchardCFLAGS-$(CONFIG_PPC64)	:= -mtraceback=no -mcall-aixdesc
114b2ca8c89SAlistair PoppleCFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mabi=elfv1)
1151fbe9cf2SAnton BlanchardCFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mcmodel=medium,-mminimal-toc)
11698679fb0SAnton BlanchardCFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mno-pointers-to-nested-functions)
117d72b0801SIan MunsieCFLAGS-$(CONFIG_PPC32)	:= -ffixed-r2 $(MULTIPLEWORD)
118d23c6fb4SAnton Blanchard
11901718ba6SScott Woodifeq ($(CONFIG_PPC_BOOK3S_64),y)
120d23c6fb4SAnton BlanchardCFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power7,-mtune=power4)
12101718ba6SScott Woodelse
12201718ba6SScott WoodCFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=powerpc64
12301718ba6SScott Woodendif
12401718ba6SScott Wood
125d23c6fb4SAnton BlanchardCFLAGS-$(CONFIG_CELL_CPU) += $(call cc-option,-mcpu=cell)
126d23c6fb4SAnton BlanchardCFLAGS-$(CONFIG_POWER4_CPU) += $(call cc-option,-mcpu=power4)
127d23c6fb4SAnton BlanchardCFLAGS-$(CONFIG_POWER5_CPU) += $(call cc-option,-mcpu=power5)
128d23c6fb4SAnton BlanchardCFLAGS-$(CONFIG_POWER6_CPU) += $(call cc-option,-mcpu=power6)
129d23c6fb4SAnton BlanchardCFLAGS-$(CONFIG_POWER7_CPU) += $(call cc-option,-mcpu=power7)
130d23c6fb4SAnton Blanchard
131*cbf8a358STiejun Chen# Altivec option not allowed with e500mc64 in GCC.
132*cbf8a358STiejun Chenifeq ($(CONFIG_ALTIVEC),y)
133*cbf8a358STiejun ChenE5500_CPU := -mcpu=powerpc64
134*cbf8a358STiejun Chenelse
13501718ba6SScott WoodE5500_CPU := $(call cc-option,-mcpu=e500mc64,-mcpu=powerpc64)
136*cbf8a358STiejun Chenendif
13701718ba6SScott WoodCFLAGS-$(CONFIG_E5500_CPU) += $(E5500_CPU)
13801718ba6SScott WoodCFLAGS-$(CONFIG_E6500_CPU) += $(call cc-option,-mcpu=e6500,$(E5500_CPU))
13901718ba6SScott Wood
140847f56b0SScott Woodifeq ($(CONFIG_PPC32),y)
141847f56b0SScott Woodifeq ($(CONFIG_PPC_E500MC),y)
142847f56b0SScott WoodCFLAGS-y += $(call cc-option,-mcpu=e500mc,-mcpu=powerpc)
143847f56b0SScott Woodelse
144847f56b0SScott WoodCFLAGS-$(CONFIG_E500) += $(call cc-option,-mcpu=8540 -msoft-float,-mcpu=powerpc)
145847f56b0SScott Woodendif
146847f56b0SScott Woodendif
147847f56b0SScott Wood
148d23c6fb4SAnton BlanchardCFLAGS-$(CONFIG_TUNE_CELL) += $(call cc-option,-mtune=cell)
149d23c6fb4SAnton Blanchard
1501993cbf4SKumar GalaKBUILD_CPPFLAGS	+= -Iarch/$(ARCH)
1515ba840ecSBenjamin HerrenschmidtKBUILD_AFLAGS	+= -Iarch/$(ARCH)
1521993cbf4SKumar GalaKBUILD_CFLAGS	+= -msoft-float -pipe -Iarch/$(ARCH) $(CFLAGS-y)
153a0f97e06SSam RavnborgCPP		= $(CC) -E $(KBUILD_CFLAGS)
15414cf11afSPaul Mackerras
1552578bfaeSStephen RothwellCHECKFLAGS	+= -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__
15614cf11afSPaul Mackerras
157772320e8SMichal MarekKBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
1587fca5dc8SStephen Rothwell
159d23c6fb4SAnton Blanchard# No AltiVec or VSX instructions when building kernel
160a0f97e06SSam RavnborgKBUILD_CFLAGS += $(call cc-option,-mno-altivec)
161d23c6fb4SAnton BlanchardKBUILD_CFLAGS += $(call cc-option,-mno-vsx)
162d3f67fbbSPaul Mackerras
1630197cd2eSKumar Gala# No SPE instruction when building kernel
164ce400c01SThiemo Seufer# (We use all available options to help semi-broken compilers)
1650197cd2eSKumar GalaKBUILD_CFLAGS += $(call cc-option,-mno-spe)
166ce400c01SThiemo SeuferKBUILD_CFLAGS += $(call cc-option,-mspe=no)
1670197cd2eSKumar Gala
16814cf11afSPaul Mackerras# Enable unit-at-a-time mode when possible. It shrinks the
16914cf11afSPaul Mackerras# kernel considerably.
170a0f97e06SSam RavnborgKBUILD_CFLAGS += $(call cc-option,-funit-at-a-time)
17114cf11afSPaul Mackerras
172d0679c73SAndi Kleen# FIXME: the module load should be taught about the additional relocs
173d0679c73SAndi Kleen# generated by this.
174d0679c73SAndi Kleen# revert to pre-gcc-4.4 behaviour of .eh_frame
175d0679c73SAndi KleenKBUILD_CFLAGS	+= $(call cc-option,-fno-dwarf2-cfi-asm)
176d0679c73SAndi Kleen
17757647a4dSBenjamin Herrenschmidt# Never use string load/store instructions as they are
17857647a4dSBenjamin Herrenschmidt# often slow when they are implemented at all
179a0f97e06SSam RavnborgKBUILD_CFLAGS		+= -mno-string
18014cf11afSPaul Mackerras
181f48b8296SOlaf Heringifeq ($(CONFIG_6xx),y)
182a0f97e06SSam RavnborgKBUILD_CFLAGS		+= -mcpu=powerpc
183f48b8296SOlaf Heringendif
184f48b8296SOlaf Hering
1857563dc64STony Breeds# Work around a gcc code-gen bug with -fno-omit-frame-pointer.
186606576ceSSteven Rostedtifeq ($(CONFIG_FUNCTION_TRACER),y)
1877563dc64STony BreedsKBUILD_CFLAGS		+= -mno-sched-epilog
1887563dc64STony Breedsendif
1897563dc64STony Breeds
19014cf11afSPaul Mackerrascpu-as-$(CONFIG_4xx)		+= -Wa,-m405
191e1fc235dSMatthew McClintockcpu-as-$(CONFIG_ALTIVEC)	+= -Wa,-maltivec
19214cf11afSPaul Mackerrascpu-as-$(CONFIG_E200)		+= -Wa,-me200
19314cf11afSPaul Mackerras
194222d394dSSam RavnborgKBUILD_AFLAGS += $(cpu-as-y)
195a0f97e06SSam RavnborgKBUILD_CFLAGS += $(cpu-as-y)
19614cf11afSPaul Mackerras
1972578bfaeSStephen Rothwellhead-y				:= arch/powerpc/kernel/head_$(CONFIG_WORD_SIZE).o
19814cf11afSPaul Mackerrashead-$(CONFIG_8xx)		:= arch/powerpc/kernel/head_8xx.o
19915f6527eSJosh Boyerhead-$(CONFIG_40x)		:= arch/powerpc/kernel/head_40x.o
20014cf11afSPaul Mackerrashead-$(CONFIG_44x)		:= arch/powerpc/kernel/head_44x.o
20114cf11afSPaul Mackerrashead-$(CONFIG_FSL_BOOKE)	:= arch/powerpc/kernel/head_fsl_booke.o
20214cf11afSPaul Mackerras
2039994a338SPaul Mackerrashead-$(CONFIG_PPC64)		+= arch/powerpc/kernel/entry_64.o
20414cf11afSPaul Mackerrashead-$(CONFIG_PPC_FPU)		+= arch/powerpc/kernel/fpu.o
205e821ea70SBenjamin Herrenschmidthead-$(CONFIG_ALTIVEC)		+= arch/powerpc/kernel/vector.o
2065ac47f7aSAnton Blanchardhead-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE)  += arch/powerpc/kernel/prom_init.o
20714cf11afSPaul Mackerras
208daec962eSPaul Mackerrascore-y				+= arch/powerpc/kernel/ \
209daec962eSPaul Mackerras				   arch/powerpc/mm/ \
210daec962eSPaul Mackerras				   arch/powerpc/lib/ \
211daec962eSPaul Mackerras				   arch/powerpc/sysdev/ \
2121a3d1fc2SLiu Yu				   arch/powerpc/platforms/ \
2130ca87f05SMatt Evans				   arch/powerpc/math-emu/ \
214323a6bf1SMichael Ellerman				   arch/powerpc/crypto/ \
2150ca87f05SMatt Evans				   arch/powerpc/net/
216f78541dcSPaul Mackerrascore-$(CONFIG_XMON)		+= arch/powerpc/xmon/
217bbf45ba5SHollis Blanchardcore-$(CONFIG_KVM) 		+= arch/powerpc/kvm/
218f2699491SMichael Ellermancore-$(CONFIG_PERF_EVENTS)	+= arch/powerpc/perf/
21914cf11afSPaul Mackerras
22014cf11afSPaul Mackerrasdrivers-$(CONFIG_OPROFILE)	+= arch/powerpc/oprofile/
22114cf11afSPaul Mackerras
222135f0b17STom Rini# Default to zImage, override when needed
22325431333SGrant Likelyall: zImage
22414cf11afSPaul Mackerras
225e32e78c5SSam Ravnborg# With make 3.82 we cannot mix normal and wildcard targets
226c686ecf5SAnatolij GustschinBOOT_TARGETS1 := zImage zImage.initrd uImage
22711eab297SBenjamin HerrenschmidtBOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.% uImage.%
228cabb5587SStephen Rothwell
229e32e78c5SSam RavnborgPHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2)
230cabb5587SStephen Rothwell
23194b212c2SPaul Mackerrasboot := arch/$(ARCH)/boot
23214cf11afSPaul Mackerras
233144ef909STony Breedsifeq ($(CONFIG_RELOCATABLE),y)
234144ef909STony Breedsquiet_cmd_relocs_check = CALL    $<
235144ef909STony Breeds      cmd_relocs_check = perl $< "$(OBJDUMP)" "$(obj)/vmlinux"
236144ef909STony Breeds
237144ef909STony BreedsPHONY += relocs_check
238144ef909STony Breedsrelocs_check: arch/powerpc/relocs_check.pl vmlinux
239144ef909STony Breeds	$(call cmd,relocs_check)
240144ef909STony Breeds
241144ef909STony BreedszImage: relocs_check
242144ef909STony Breedsendif
243144ef909STony Breeds
244e32e78c5SSam Ravnborg$(BOOT_TARGETS1): vmlinux
245e32e78c5SSam Ravnborg	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
246e32e78c5SSam Ravnborg$(BOOT_TARGETS2): vmlinux
24720f62954SPaul Mackerras	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
24814cf11afSPaul Mackerras
249e32e78c5SSam Ravnborg
250e32e78c5SSam Ravnborgbootwrapper_install:
251e32e78c5SSam Ravnborg	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
252e32e78c5SSam Ravnborg
2538662d0bcSMatthew McClintock%.dtb: scripts
254773f76b1SDavid Woodhouse	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
255773f76b1SDavid Woodhouse
25614cf11afSPaul Mackerrasdefine archhelp
25770bf0333SGrant Likely  @echo '* zImage          - Build default images selected by kernel config'
25870bf0333SGrant Likely  @echo '  zImage.*        - Compressed kernel image (arch/$(ARCH)/boot/zImage.*)'
25970bf0333SGrant Likely  @echo '  uImage          - U-Boot native image format'
26070bf0333SGrant Likely  @echo '  cuImage.<dt>    - Backwards compatible U-Boot image for older'
26170bf0333SGrant Likely  @echo '                    versions which do not support device trees'
26270bf0333SGrant Likely  @echo '  dtbImage.<dt>   - zImage with an embedded device tree blob'
26370bf0333SGrant Likely  @echo '  simpleImage.<dt> - Firmware independent image.'
26470bf0333SGrant Likely  @echo '  treeImage.<dt>  - Support for older IBM 4xx firmware (not U-Boot)'
26514cf11afSPaul Mackerras  @echo '  install         - Install kernel using'
266caa27b66SSam Ravnborg  @echo '                    (your) ~/bin/$(INSTALLKERNEL) or'
267caa27b66SSam Ravnborg  @echo '                    (distribution) /sbin/$(INSTALLKERNEL) or'
26814cf11afSPaul Mackerras  @echo '                    install to $$(INSTALL_PATH) and run lilo'
269437a58dbSPaul Mackerras  @echo '  *_defconfig     - Select default config from arch/$(ARCH)/configs'
27070bf0333SGrant Likely  @echo ''
27170bf0333SGrant Likely  @echo '  Targets with <dt> embed a device tree blob inside the image'
27270bf0333SGrant Likely  @echo '  These targets support board with firmware that does not'
27370bf0333SGrant Likely  @echo '  support passing a device tree directly.  Replace <dt> with the'
27470bf0333SGrant Likely  @echo '  name of a dts file from the arch/$(ARCH)/boot/dts/ directory'
27570bf0333SGrant Likely  @echo '  (minus the .dts extension).'
27614cf11afSPaul Mackerrasendef
27714cf11afSPaul Mackerras
2783f85d63eSSam Ravnborginstall:
27925431333SGrant Likely	$(Q)$(MAKE) $(build)=$(boot) install
280928370c6SAkinobu Mita
2818150caadSRoland McGrathvdso_install:
2828150caadSRoland McGrathifeq ($(CONFIG_PPC64),y)
2838150caadSRoland McGrath	$(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso64 $@
2848150caadSRoland McGrathendif
2858150caadSRoland McGrath	$(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso32 $@
2868150caadSRoland McGrath
28714cf11afSPaul Mackerrasarchclean:
288a3a9e99eSPaul Mackerras	$(Q)$(MAKE) $(clean)=$(boot)
28970567293SAndreas Gruenbacher
29014cf11afSPaul Mackerrasarchprepare: checkbin
29114cf11afSPaul Mackerras
29214cf11afSPaul Mackerras# Use the file '.tmp_gas_check' for binutils tests, as gas won't output
29314cf11afSPaul Mackerras# to stdout and these checks are run even on install targets.
29414cf11afSPaul MackerrasTOUT	:= .tmp_gas_check
29514cf11afSPaul Mackerras
29682a85084SAnton Blanchard# Check gcc and binutils versions:
29782a85084SAnton Blanchard# - gcc-3.4 and binutils-2.14 are a fatal combination
29882a85084SAnton Blanchard# - Require gcc 4.0 or above on 64-bit
29982a85084SAnton Blanchard# - gcc-4.2.0 has issues compiling modules on 64-bit
30014cf11afSPaul Mackerrascheckbin:
301ad14336dSSam Ravnborg	@if test "$(call cc-version)" = "0304" ; then \
30214cf11afSPaul Mackerras		if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \
30314cf11afSPaul Mackerras			echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \
30414cf11afSPaul Mackerras			echo 'correctly with gcc-3.4 and your version of binutils.'; \
30514cf11afSPaul Mackerras			echo '*** Please upgrade your binutils or downgrade your gcc'; \
30614cf11afSPaul Mackerras			false; \
30714cf11afSPaul Mackerras		fi ; \
30814cf11afSPaul Mackerras	fi
30982a85084SAnton Blanchard	@if test "$(call cc-version)" -lt "0400" \
31082a85084SAnton Blanchard	    && test "x${CONFIG_PPC64}" = "xy" ; then \
31182a85084SAnton Blanchard                echo -n "Sorry, GCC v4.0 or above is required to build " ; \
31282a85084SAnton Blanchard                echo "the 64-bit powerpc kernel." ; \
31382a85084SAnton Blanchard                false ; \
31482a85084SAnton Blanchard        fi
315f5e83fa4SSegher Boessenkool	@if test "$(call cc-fullversion)" = "040200" \
316f5e83fa4SSegher Boessenkool	    && test "x${CONFIG_MODULES}${CONFIG_PPC64}" = "xyy" ; then \
317f5e83fa4SSegher Boessenkool		echo -n '*** GCC-4.2.0 cannot compile the 64-bit powerpc ' ; \
318f5e83fa4SSegher Boessenkool		echo 'kernel with modules enabled.' ; \
319f5e83fa4SSegher Boessenkool		echo -n '*** Please use a different GCC version or ' ; \
320f5e83fa4SSegher Boessenkool		echo 'disable kernel modules' ; \
321f5e83fa4SSegher Boessenkool		false ; \
322f5e83fa4SSegher Boessenkool	fi
32314cf11afSPaul Mackerras
32414cf11afSPaul MackerrasCLEAN_FILES += $(TOUT)
32514cf11afSPaul Mackerras
326