xref: /linux/arch/powerpc/Makefile (revision 92d6cf2dab83cfb00b3d80fd38a38a77c6873277)
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)
69*92d6cf2dSAnton Blanchardoverride CC	+= -mlittle-endian
70*92d6cf2dSAnton Blanchardifneq ($(COMPILER),clang)
71*92d6cf2dSAnton Blanchardoverride CC	+= -mno-strict-align
72*92d6cf2dSAnton Blanchardendif
73d72b0801SIan Munsieoverride AS	+= -mlittle-endian
74d72b0801SIan Munsieoverride LD	+= -EL
75d72b0801SIan Munsieoverride CROSS32CC += -mlittle-endian
76d72b0801SIan Munsieoverride CROSS32AS += -mlittle-endian
77d72b0801SIan MunsieLDEMULATION	:= lppc
78d72b0801SIan MunsieGNUTARGET	:= powerpcle
79d72b0801SIan MunsieMULTIPLEWORD	:= -mno-multiple
80d3d35d95STony BreedsKBUILD_CFLAGS_MODULE += $(call cc-option,-mno-save-toc-indirect)
81d72b0801SIan Munsieelse
82924dd50bSMichael Neulingifeq ($(call cc-option-yn,-mbig-endian),y)
83d72b0801SIan Munsieoverride CC	+= -mbig-endian
84d72b0801SIan Munsieoverride AS	+= -mbig-endian
85924dd50bSMichael Neulingendif
86d72b0801SIan Munsieoverride LD	+= -EB
87d72b0801SIan MunsieLDEMULATION	:= ppc
88d72b0801SIan MunsieGNUTARGET	:= powerpc
89d72b0801SIan MunsieMULTIPLEWORD	:= -mmultiple
90d72b0801SIan Munsieendif
91d72b0801SIan Munsie
9214cf11afSPaul Mackerrasifeq ($(HAS_BIARCH),y)
932578bfaeSStephen Rothwelloverride AS	+= -a$(CONFIG_WORD_SIZE)
94d72b0801SIan Munsieoverride LD	+= -m elf$(CONFIG_WORD_SIZE)$(LDEMULATION)
952578bfaeSStephen Rothwelloverride CC	+= -m$(CONFIG_WORD_SIZE)
96d72b0801SIan Munsieoverride AR	:= GNUTARGET=elf$(CONFIG_WORD_SIZE)-$(GNUTARGET) $(AR)
9714cf11afSPaul Mackerrasendif
9814cf11afSPaul Mackerras
999c5f7d39SSuzuki PouloseLDFLAGS_vmlinux-y := -Bstatic
1009c5f7d39SSuzuki PouloseLDFLAGS_vmlinux-$(CONFIG_RELOCATABLE) := -pie
1019c5f7d39SSuzuki PouloseLDFLAGS_vmlinux	:= $(LDFLAGS_vmlinux-y)
10214cf11afSPaul Mackerras
1031fbe9cf2SAnton Blanchardifeq ($(CONFIG_PPC64),y)
1041fbe9cf2SAnton Blanchardifeq ($(call cc-option-yn,-mcmodel=medium),y)
1051fbe9cf2SAnton Blanchard	# -mcmodel=medium breaks modules because it uses 32bit offsets from
1061fbe9cf2SAnton Blanchard	# the TOC pointer to create pointers where possible. Pointers into the
1071fbe9cf2SAnton Blanchard	# percpu data area are created by this method.
1081fbe9cf2SAnton Blanchard	#
1091fbe9cf2SAnton Blanchard	# The kernel module loader relocates the percpu data section from the
1101fbe9cf2SAnton Blanchard	# original location (starting with 0xd...) to somewhere in the base
1111fbe9cf2SAnton Blanchard	# kernel percpu data space (starting with 0xc...). We need a full
1121fbe9cf2SAnton Blanchard	# 64bit relocation for this to work, hence -mcmodel=large.
1131fbe9cf2SAnton Blanchard	KBUILD_CFLAGS_MODULE += -mcmodel=large
1141fbe9cf2SAnton Blanchardelse
1151fbe9cf2SAnton Blanchard	export NO_MINIMAL_TOC := -mno-minimal-toc
1161fbe9cf2SAnton Blanchardendif
1171fbe9cf2SAnton Blanchardendif
1181fbe9cf2SAnton Blanchard
119a50a862eSAnton BlanchardCFLAGS-$(CONFIG_PPC64)	:= $(call cc-option,-mtraceback=no)
120721aeaa9SAnton Blanchardifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
121721aeaa9SAnton BlanchardCFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mabi=elfv2,-mcall-aixdesc)
122721aeaa9SAnton BlanchardAFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mabi=elfv2)
123721aeaa9SAnton Blanchardelse
124721aeaa9SAnton BlanchardCFLAGS-$(CONFIG_PPC64)	+= -mcall-aixdesc
125721aeaa9SAnton Blanchardendif
1261fbe9cf2SAnton BlanchardCFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mcmodel=medium,-mminimal-toc)
12798679fb0SAnton BlanchardCFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mno-pointers-to-nested-functions)
128d72b0801SIan MunsieCFLAGS-$(CONFIG_PPC32)	:= -ffixed-r2 $(MULTIPLEWORD)
129d23c6fb4SAnton Blanchard
13001718ba6SScott Woodifeq ($(CONFIG_PPC_BOOK3S_64),y)
131d23c6fb4SAnton BlanchardCFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power7,-mtune=power4)
13201718ba6SScott Woodelse
13301718ba6SScott WoodCFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=powerpc64
13401718ba6SScott Woodendif
13501718ba6SScott Wood
136d23c6fb4SAnton BlanchardCFLAGS-$(CONFIG_CELL_CPU) += $(call cc-option,-mcpu=cell)
137d23c6fb4SAnton BlanchardCFLAGS-$(CONFIG_POWER4_CPU) += $(call cc-option,-mcpu=power4)
138d23c6fb4SAnton BlanchardCFLAGS-$(CONFIG_POWER5_CPU) += $(call cc-option,-mcpu=power5)
139d23c6fb4SAnton BlanchardCFLAGS-$(CONFIG_POWER6_CPU) += $(call cc-option,-mcpu=power6)
140d23c6fb4SAnton BlanchardCFLAGS-$(CONFIG_POWER7_CPU) += $(call cc-option,-mcpu=power7)
141ff2e466aSAnton BlanchardCFLAGS-$(CONFIG_POWER8_CPU) += $(call cc-option,-mcpu=power8)
142d23c6fb4SAnton Blanchard
143cbf8a358STiejun Chen# Altivec option not allowed with e500mc64 in GCC.
144cbf8a358STiejun Chenifeq ($(CONFIG_ALTIVEC),y)
145cbf8a358STiejun ChenE5500_CPU := -mcpu=powerpc64
146cbf8a358STiejun Chenelse
14701718ba6SScott WoodE5500_CPU := $(call cc-option,-mcpu=e500mc64,-mcpu=powerpc64)
148cbf8a358STiejun Chenendif
14901718ba6SScott WoodCFLAGS-$(CONFIG_E5500_CPU) += $(E5500_CPU)
15001718ba6SScott WoodCFLAGS-$(CONFIG_E6500_CPU) += $(call cc-option,-mcpu=e6500,$(E5500_CPU))
15101718ba6SScott Wood
152847f56b0SScott Woodifeq ($(CONFIG_PPC32),y)
153847f56b0SScott Woodifeq ($(CONFIG_PPC_E500MC),y)
154847f56b0SScott WoodCFLAGS-y += $(call cc-option,-mcpu=e500mc,-mcpu=powerpc)
155847f56b0SScott Woodelse
156847f56b0SScott WoodCFLAGS-$(CONFIG_E500) += $(call cc-option,-mcpu=8540 -msoft-float,-mcpu=powerpc)
157847f56b0SScott Woodendif
158847f56b0SScott Woodendif
159847f56b0SScott Wood
160d23c6fb4SAnton BlanchardCFLAGS-$(CONFIG_TUNE_CELL) += $(call cc-option,-mtune=cell)
161d23c6fb4SAnton Blanchard
1627998eb3dSGuenter Roeckasinstr := $(call as-instr,lis 9$(comma)foo@high,-DHAVE_AS_ATHIGH=1)
1637998eb3dSGuenter Roeck
1647998eb3dSGuenter RoeckKBUILD_CPPFLAGS	+= -Iarch/$(ARCH) $(asinstr)
16558aedccbSAnton BlanchardKBUILD_AFLAGS	+= -Iarch/$(ARCH) $(AFLAGS-y)
166a50a862eSAnton BlanchardKBUILD_CFLAGS	+= $(call cc-option,-msoft-float)
167a50a862eSAnton BlanchardKBUILD_CFLAGS	+= -pipe -Iarch/$(ARCH) $(CFLAGS-y)
168a0f97e06SSam RavnborgCPP		= $(CC) -E $(KBUILD_CFLAGS)
16914cf11afSPaul Mackerras
1702578bfaeSStephen RothwellCHECKFLAGS	+= -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__
17114cf11afSPaul Mackerras
172772320e8SMichal MarekKBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
1737fca5dc8SStephen Rothwell
174d5b35cffSAlistair Poppleifeq ($(CONFIG_476FPE_ERR46),y)
175d5b35cffSAlistair Popple	KBUILD_LDFLAGS_MODULE += --ppc476-workaround \
176d5b35cffSAlistair Popple		-T $(srctree)/arch/powerpc/platforms/44x/ppc476_modules.lds
177d5b35cffSAlistair Poppleendif
178d5b35cffSAlistair Popple
179d23c6fb4SAnton Blanchard# No AltiVec or VSX instructions when building kernel
180a0f97e06SSam RavnborgKBUILD_CFLAGS += $(call cc-option,-mno-altivec)
181d23c6fb4SAnton BlanchardKBUILD_CFLAGS += $(call cc-option,-mno-vsx)
182d3f67fbbSPaul Mackerras
1830197cd2eSKumar Gala# No SPE instruction when building kernel
184ce400c01SThiemo Seufer# (We use all available options to help semi-broken compilers)
1850197cd2eSKumar GalaKBUILD_CFLAGS += $(call cc-option,-mno-spe)
186ce400c01SThiemo SeuferKBUILD_CFLAGS += $(call cc-option,-mspe=no)
1870197cd2eSKumar Gala
18814cf11afSPaul Mackerras# Enable unit-at-a-time mode when possible. It shrinks the
18914cf11afSPaul Mackerras# kernel considerably.
190a0f97e06SSam RavnborgKBUILD_CFLAGS += $(call cc-option,-funit-at-a-time)
19114cf11afSPaul Mackerras
192d0679c73SAndi Kleen# FIXME: the module load should be taught about the additional relocs
193d0679c73SAndi Kleen# generated by this.
194d0679c73SAndi Kleen# revert to pre-gcc-4.4 behaviour of .eh_frame
195d0679c73SAndi KleenKBUILD_CFLAGS	+= $(call cc-option,-fno-dwarf2-cfi-asm)
196d0679c73SAndi Kleen
19757647a4dSBenjamin Herrenschmidt# Never use string load/store instructions as they are
19857647a4dSBenjamin Herrenschmidt# often slow when they are implemented at all
199a50a862eSAnton BlanchardKBUILD_CFLAGS		+= $(call cc-option,-mno-string)
20014cf11afSPaul Mackerras
201f48b8296SOlaf Heringifeq ($(CONFIG_6xx),y)
202a0f97e06SSam RavnborgKBUILD_CFLAGS		+= -mcpu=powerpc
203f48b8296SOlaf Heringendif
204f48b8296SOlaf Hering
2057563dc64STony Breeds# Work around a gcc code-gen bug with -fno-omit-frame-pointer.
206606576ceSSteven Rostedtifeq ($(CONFIG_FUNCTION_TRACER),y)
2077563dc64STony BreedsKBUILD_CFLAGS		+= -mno-sched-epilog
2087563dc64STony Breedsendif
2097563dc64STony Breeds
21014cf11afSPaul Mackerrascpu-as-$(CONFIG_4xx)		+= -Wa,-m405
211e1fc235dSMatthew McClintockcpu-as-$(CONFIG_ALTIVEC)	+= -Wa,-maltivec
21214cf11afSPaul Mackerrascpu-as-$(CONFIG_E200)		+= -Wa,-me200
21314cf11afSPaul Mackerras
214222d394dSSam RavnborgKBUILD_AFLAGS += $(cpu-as-y)
215a0f97e06SSam RavnborgKBUILD_CFLAGS += $(cpu-as-y)
21614cf11afSPaul Mackerras
2172578bfaeSStephen Rothwellhead-y				:= arch/powerpc/kernel/head_$(CONFIG_WORD_SIZE).o
21814cf11afSPaul Mackerrashead-$(CONFIG_8xx)		:= arch/powerpc/kernel/head_8xx.o
21915f6527eSJosh Boyerhead-$(CONFIG_40x)		:= arch/powerpc/kernel/head_40x.o
22014cf11afSPaul Mackerrashead-$(CONFIG_44x)		:= arch/powerpc/kernel/head_44x.o
22114cf11afSPaul Mackerrashead-$(CONFIG_FSL_BOOKE)	:= arch/powerpc/kernel/head_fsl_booke.o
22214cf11afSPaul Mackerras
2239994a338SPaul Mackerrashead-$(CONFIG_PPC64)		+= arch/powerpc/kernel/entry_64.o
22414cf11afSPaul Mackerrashead-$(CONFIG_PPC_FPU)		+= arch/powerpc/kernel/fpu.o
225e821ea70SBenjamin Herrenschmidthead-$(CONFIG_ALTIVEC)		+= arch/powerpc/kernel/vector.o
2265ac47f7aSAnton Blanchardhead-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE)  += arch/powerpc/kernel/prom_init.o
22714cf11afSPaul Mackerras
228daec962eSPaul Mackerrascore-y				+= arch/powerpc/kernel/ \
229daec962eSPaul Mackerras				   arch/powerpc/mm/ \
230daec962eSPaul Mackerras				   arch/powerpc/lib/ \
231daec962eSPaul Mackerras				   arch/powerpc/sysdev/ \
2321a3d1fc2SLiu Yu				   arch/powerpc/platforms/ \
2330ca87f05SMatt Evans				   arch/powerpc/math-emu/ \
234323a6bf1SMichael Ellerman				   arch/powerpc/crypto/ \
2350ca87f05SMatt Evans				   arch/powerpc/net/
236f78541dcSPaul Mackerrascore-$(CONFIG_XMON)		+= arch/powerpc/xmon/
237bbf45ba5SHollis Blanchardcore-$(CONFIG_KVM) 		+= arch/powerpc/kvm/
238f2699491SMichael Ellermancore-$(CONFIG_PERF_EVENTS)	+= arch/powerpc/perf/
23914cf11afSPaul Mackerras
24014cf11afSPaul Mackerrasdrivers-$(CONFIG_OPROFILE)	+= arch/powerpc/oprofile/
24114cf11afSPaul Mackerras
242135f0b17STom Rini# Default to zImage, override when needed
24325431333SGrant Likelyall: zImage
24414cf11afSPaul Mackerras
245e32e78c5SSam Ravnborg# With make 3.82 we cannot mix normal and wildcard targets
246c686ecf5SAnatolij GustschinBOOT_TARGETS1 := zImage zImage.initrd uImage
24711eab297SBenjamin HerrenschmidtBOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.% uImage.%
248cabb5587SStephen Rothwell
249e32e78c5SSam RavnborgPHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2)
250cabb5587SStephen Rothwell
25194b212c2SPaul Mackerrasboot := arch/$(ARCH)/boot
25214cf11afSPaul Mackerras
253144ef909STony Breedsifeq ($(CONFIG_RELOCATABLE),y)
254144ef909STony Breedsquiet_cmd_relocs_check = CALL    $<
255a71aa05eSStephen Rothwell      cmd_relocs_check = $(CONFIG_SHELL) $< "$(OBJDUMP)" "$(obj)/vmlinux"
256144ef909STony Breeds
257144ef909STony BreedsPHONY += relocs_check
258a71aa05eSStephen Rothwellrelocs_check: arch/powerpc/relocs_check.sh vmlinux
259144ef909STony Breeds	$(call cmd,relocs_check)
260144ef909STony Breeds
261144ef909STony BreedszImage: relocs_check
262144ef909STony Breedsendif
263144ef909STony Breeds
264e32e78c5SSam Ravnborg$(BOOT_TARGETS1): vmlinux
265e32e78c5SSam Ravnborg	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
266e32e78c5SSam Ravnborg$(BOOT_TARGETS2): vmlinux
26720f62954SPaul Mackerras	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
26814cf11afSPaul Mackerras
269e32e78c5SSam Ravnborg
270e32e78c5SSam Ravnborgbootwrapper_install:
271e32e78c5SSam Ravnborg	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
272e32e78c5SSam Ravnborg
2738662d0bcSMatthew McClintock%.dtb: scripts
274773f76b1SDavid Woodhouse	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
275773f76b1SDavid Woodhouse
276ea4d1a87SCyril Bur# Used to create 'merged defconfigs'
277ea4d1a87SCyril Bur# To use it $(call) it with the first argument as the base defconfig
278ea4d1a87SCyril Bur# and the second argument as a space separated list of .config files to merge,
279ea4d1a87SCyril Bur# without the .config suffix.
280ea4d1a87SCyril Burdefine merge_into_defconfig
281ea4d1a87SCyril Bur	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh \
282ea4d1a87SCyril Bur		-m -O $(objtree) $(srctree)/arch/$(ARCH)/configs/$(1) \
283ea4d1a87SCyril Bur		$(foreach config,$(2),$(srctree)/arch/$(ARCH)/configs/$(config).config)
284ea4d1a87SCyril Bur	+$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
285ea4d1a87SCyril Burendef
286ea4d1a87SCyril Bur
287ea4d1a87SCyril BurPHONY += pseries_le_defconfig
288ea4d1a87SCyril Burpseries_le_defconfig:
289ea4d1a87SCyril Bur	$(call merge_into_defconfig,pseries_defconfig,le)
290ea4d1a87SCyril Bur
29114cf11afSPaul Mackerrasdefine archhelp
29270bf0333SGrant Likely  @echo '* zImage          - Build default images selected by kernel config'
29370bf0333SGrant Likely  @echo '  zImage.*        - Compressed kernel image (arch/$(ARCH)/boot/zImage.*)'
29470bf0333SGrant Likely  @echo '  uImage          - U-Boot native image format'
29570bf0333SGrant Likely  @echo '  cuImage.<dt>    - Backwards compatible U-Boot image for older'
29670bf0333SGrant Likely  @echo '                    versions which do not support device trees'
29770bf0333SGrant Likely  @echo '  dtbImage.<dt>   - zImage with an embedded device tree blob'
29870bf0333SGrant Likely  @echo '  simpleImage.<dt> - Firmware independent image.'
29970bf0333SGrant Likely  @echo '  treeImage.<dt>  - Support for older IBM 4xx firmware (not U-Boot)'
30014cf11afSPaul Mackerras  @echo '  install         - Install kernel using'
301caa27b66SSam Ravnborg  @echo '                    (your) ~/bin/$(INSTALLKERNEL) or'
302caa27b66SSam Ravnborg  @echo '                    (distribution) /sbin/$(INSTALLKERNEL) or'
30314cf11afSPaul Mackerras  @echo '                    install to $$(INSTALL_PATH) and run lilo'
304437a58dbSPaul Mackerras  @echo '  *_defconfig     - Select default config from arch/$(ARCH)/configs'
30570bf0333SGrant Likely  @echo ''
30670bf0333SGrant Likely  @echo '  Targets with <dt> embed a device tree blob inside the image'
30770bf0333SGrant Likely  @echo '  These targets support board with firmware that does not'
30870bf0333SGrant Likely  @echo '  support passing a device tree directly.  Replace <dt> with the'
30970bf0333SGrant Likely  @echo '  name of a dts file from the arch/$(ARCH)/boot/dts/ directory'
31070bf0333SGrant Likely  @echo '  (minus the .dts extension).'
31114cf11afSPaul Mackerrasendef
31214cf11afSPaul Mackerras
3133f85d63eSSam Ravnborginstall:
31425431333SGrant Likely	$(Q)$(MAKE) $(build)=$(boot) install
315928370c6SAkinobu Mita
3168150caadSRoland McGrathvdso_install:
3178150caadSRoland McGrathifeq ($(CONFIG_PPC64),y)
3188150caadSRoland McGrath	$(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso64 $@
3198150caadSRoland McGrathendif
3208150caadSRoland McGrath	$(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso32 $@
3218150caadSRoland McGrath
32214cf11afSPaul Mackerrasarchclean:
323a3a9e99eSPaul Mackerras	$(Q)$(MAKE) $(clean)=$(boot)
32470567293SAndreas Gruenbacher
32514cf11afSPaul Mackerrasarchprepare: checkbin
32614cf11afSPaul Mackerras
32714cf11afSPaul Mackerras# Use the file '.tmp_gas_check' for binutils tests, as gas won't output
32814cf11afSPaul Mackerras# to stdout and these checks are run even on install targets.
32914cf11afSPaul MackerrasTOUT	:= .tmp_gas_check
33014cf11afSPaul Mackerras
33182a85084SAnton Blanchard# Check gcc and binutils versions:
33282a85084SAnton Blanchard# - gcc-3.4 and binutils-2.14 are a fatal combination
33382a85084SAnton Blanchard# - Require gcc 4.0 or above on 64-bit
33482a85084SAnton Blanchard# - gcc-4.2.0 has issues compiling modules on 64-bit
33514cf11afSPaul Mackerrascheckbin:
336e79c8385SMichael Ellerman	@if test "${COMPILER}" != "clang" \
337e79c8385SMichael Ellerman	    && test "$(cc-version)" = "0304" ; then \
33814cf11afSPaul Mackerras		if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \
33914cf11afSPaul Mackerras			echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \
34014cf11afSPaul Mackerras			echo 'correctly with gcc-3.4 and your version of binutils.'; \
34114cf11afSPaul Mackerras			echo '*** Please upgrade your binutils or downgrade your gcc'; \
34214cf11afSPaul Mackerras			false; \
34314cf11afSPaul Mackerras		fi ; \
34414cf11afSPaul Mackerras	fi
345e79c8385SMichael Ellerman	@if test "${COMPILER}" != "clang" \
346e79c8385SMichael Ellerman	    && test "$(cc-version)" -lt "0400" \
34782a85084SAnton Blanchard	    && test "x${CONFIG_PPC64}" = "xy" ; then \
34882a85084SAnton Blanchard                echo -n "Sorry, GCC v4.0 or above is required to build " ; \
34982a85084SAnton Blanchard                echo "the 64-bit powerpc kernel." ; \
35082a85084SAnton Blanchard                false ; \
35182a85084SAnton Blanchard        fi
352e79c8385SMichael Ellerman	@if test "${COMPILER}" != "clang" \
353e79c8385SMichael Ellerman	    && test "$(cc-fullversion)" = "040200" \
354f5e83fa4SSegher Boessenkool	    && test "x${CONFIG_MODULES}${CONFIG_PPC64}" = "xyy" ; then \
355f5e83fa4SSegher Boessenkool		echo -n '*** GCC-4.2.0 cannot compile the 64-bit powerpc ' ; \
356f5e83fa4SSegher Boessenkool		echo 'kernel with modules enabled.' ; \
357f5e83fa4SSegher Boessenkool		echo -n '*** Please use a different GCC version or ' ; \
358f5e83fa4SSegher Boessenkool		echo 'disable kernel modules' ; \
359f5e83fa4SSegher Boessenkool		false ; \
360f5e83fa4SSegher Boessenkool	fi
36160e065f7SMichael Ellerman	@if test "x${CONFIG_CPU_LITTLE_ENDIAN}" = "xy" \
36260e065f7SMichael Ellerman	    && $(LD) --version | head -1 | grep ' 2\.24$$' >/dev/null ; then \
36360e065f7SMichael Ellerman		echo -n '*** binutils 2.24 miscompiles weak symbols ' ; \
36460e065f7SMichael Ellerman		echo 'in some circumstances.' ; \
36560e065f7SMichael Ellerman		echo -n '*** Please use a different binutils version.' ; \
36660e065f7SMichael Ellerman		false ; \
36760e065f7SMichael Ellerman	fi
36860e065f7SMichael Ellerman
36914cf11afSPaul Mackerras
37014cf11afSPaul MackerrasCLEAN_FILES += $(TOUT)
37114cf11afSPaul Mackerras
372