linux/arch/powerpc/Makefile
<<
valu12valu12>>vavaluvalu12 ">valu12valu12Searchvalu12Prefs. 12vava ">vlu12 2.
2 21# This file is included by the global makefile so that you cav add your own 2 22# architecture-specific flags and dependencies. Remember to do have ac vs 2 23# for "archclean" and "archdep" for cleaning up and making dependencies for 2 24# this architecture. 2 25# 2 26# This file is subject to the terms and condi vs of the GNU General Public 2 27# License. See the file "COPYING" in the main directory of this archive 2 28# for more details. 2 29# 2 " a># Copyright (C) 1994 by Linus Tor> ds 2 11# Changes for PPC by Gary Thomas 2 12# Rewritten by Cort Dougav and Paul Mackerras 2 13# 2 14 2 15HAS_BIARCHlu12 2:= $(call cc- > v-yn, -m32) 2 16 2 17# Set default 32 bits cross compilers for vdso and boot wrapper 2 18CROSS32_COMPILE ?= 2 19 2 20CROSS32CC := $(CROSS32_COMPILE)gcc 2 21CROSS32AR := $(CROSS32_COMPILE)ar 2 22 2 23ifeq ($(HAS_BIARCH),y) 2 24ifeq ($(CROSS32_COMPILE),) 2 25CROSS32CC := $(CC) -m32 2 26CROSS32AR := GNUTARGET=elf32-powerpc $(AR) 2 27endif 2 28endif 2 29 2 30export CROSS32CC CROSS32AR 2 31 2 32ifeq ($(CROSS_COMPILE),) 2 33KBUILD_DEFCONFIG := $(shell unam -m)_defconfig 2 34else 2 35KBUILD_DEFCONFIG := ppc64_defconfig 2 36endif 2 37 2 38ifeq ($(CONFIG_PPC64),y) 2 39OLDARCHl:= ppc64 2 40 2 41new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi) 2 42 2 43ifeq ($(new_nm),y) 2 44NM := $(NM) --synthetic 2 45endif 2 46 2 47else 2 48OLDARCHl:= ppc 2 49endif 2 50 2 51# It seems there are times we use this Makefile without 2 52# including the config file, but this replicates the old behaviour 2 53ifeq ($(CONFIG_WORD_SIZE),) 2 54CONFIG_WORD_SIZEl:= 32 2 55endif 2 56 2 57UTS_MACHINE := $(OLDARCH) 2 58 2 59ifeq ($(HAS_BIARCH),y) 2 60override AS += -a$(CONFIG_WORD_SIZE) 2 61override LD += -m elf$(CONFIG_WORD_SIZE)ppc 2 62override CC += -m$(CONFIG_WORD_SIZE) 2 63override AR := GNUTARGET=elf$(CONFIG_WORD_SIZE)-powerpc $(AR) 2 64endif 2 65 2 66LDFLAGS_vmlinux-y := -Bstatic 2 67LDFLAGS_vmlinux-$(CONFIG_RELOCATABLE) := -pie 2 68LDFLAGS_vmlinux := $(LDFLAGS_vmlinux-y) 2 69 2 70CFLAGS-$(CONFIG_PPC64) := -mminimal-toc -mtraceback=no -mcall-aixdesc 2 71CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 -mmultiple 2 72 2 73CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc- > v,-mtune=power7,-mtune=power4) 2 74CFLAGS-$(CONFIG_CELL_CPU) += $(call cc- > v,-mcpu=cell) 2 75CFLAGS-$(CONFIG_POWER4_CPU) += $(call cc- > v,-mcpu=power4) 2 76CFLAGS-$(CONFIG_POWER5_CPU) += $(call cc- > v,-mcpu=power5) 2 77CFLAGS-$(CONFIG_POWER6_CPU) += $(call cc- > v,-mcpu=power6) 2 78CFLAGS-$(CONFIG_POWER7_CPU) += $(call cc- > v,-mcpu=power7) 2 79 2 80CFLAGS-$(CONFIG_TUNE_CELL) += $(call cc- > v,-mtune=cell) 2 81 2 82KBUILD_CPPFLAGS += -Iarch/$(ARCH) 2 83KBUILD_AFLAGS += -Iarch/$(ARCH) 2 84KBUILD_CFLAGS += -msoft-float -pipe -Iarch/$(ARCH) $(CFLAGS-y) 2 85CPP = $(CC) -E $(KBUILD_CFLAGS) 2 86 2 87CHECKFLAGS += -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__ 2 88 2 89KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o 2 90 2 91# No AltiVec or VSX instruc vs when building kernel 2 92KBUILD_CFLAGS += $(call cc- > v,-mno-altivec) 2 93KBUILD_CFLAGS += $(call cc- > v,-mno-vsx) 2 94 2 95# No SPE instruc v when building kernel 2 96# (We use all available > vs to help semi-broken compilers) 2 97KBUILD_CFLAGS += $(call cc- > v,-mno-spe) 2 98KBUILD_CFLAGS += $(call cc- > v,-mspe=no) 2 99 2100# Enable unit-at-a-time mode when possible. It shrinks the 2101# kernel considerably. 2102KBUILD_CFLAGS += $(call cc- > v,-funit-at-a-time) 2103 2104# FIXME: the module load should be taught about the addi val relocs 2105# generated by this. 2106# revert to pre-gcc-4.4 behaviour of .eh_fram 2107KBUILD_CFLAGS += $(call cc- > v,-fno-dwarf2-cfi-asm) 2108 2109# Never use string load/store instruc vs as they are 21" a># often slow when they are implemented at all 2111KBUILD_CFLAGS += -mno-string 2112 2113ifeq ($(CONFIG_6xx),y) 2114KBUILD_CFLAGS += -mcpu=powerpc 2115endif 2116 2117# Work around a gcc code-gen bug with -fno-omit-fram -pointer. 2118ifeq ($(CONFIG_FUNCTION_TRACER),y) 2119KBUILD_CFLAGS += -mno-sched-epilog 2120endif 2121 2122cpu-as-$(CONFIG_4xx) += -Wa,-m405 2123cpu-as-$(CONFIG_ALTIVEC) += -Wa,-maltivec 2124cpu-as-$(CONFIG_E500) += -Wa,-me500 2125cpu-as-$(CONFIG_E200) += -Wa,-me200 2126 2127KBUILD_AFLAGS += $(cpu-as-y) 2128KBUILD_CFLAGS += $(cpu-as-y) 2129 2130head-y := arch/powerpc/kernel/head_$(CONFIG_WORD_SIZE).o 2131head-$(CONFIG_8xx) := arch/powerpc/kernel/head_8xx.o 2132head-$(CONFIG_40x) := arch/powerpc/kernel/head_40x.o 2133head-$(CONFIG_44x) := arch/powerpc/kernel/head_44x.o 2134head-$(CONFIG_FSL_BOOKE) := arch/powerpc/kernel/head_fsl_booke.o 2135 2136head-$(CONFIG_PPC64) += arch/powerpc/kernel/entry_64.o 2137head-$(CONFIG_PPC_FPU) += arch/powerpc/kernel/fpu.o 2138head-$(CONFIG_ALTIVEC) += arch/powerpc/kernel/vector.o 2139 2140core-y += arch/powerpc/kernel/ \ 2141 arch/powerpc/mm/ \ 2142 arch/powerpc/lib/ \ 2143 arch/powerpc/sysdev/ \ 2144 arch/powerpc/platforms/ \ 2145 arch/powerpc/math-emu/ \ 2146 arch/powerpc/net/ 2147core-$(CONFIG_XMON) += arch/powerpc/xmon/ 2148core-$(CONFIG_KVM) += arch/powerpc/kvm/ 2149core-$(CONFIG_PERF_EVENTS) += arch/powerpc/perf/ 2150 2151drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/ 2152 2153# Default to zImage, override when needed 2154all: zImage 2155 2156# With make 3.82 we cannot mix normal and wildcard targets 2157BOOT_TARGETS1 := zImage zImage.initrd uImage 2158BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.% uImage.% 2159 2160PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2) 2161 2162boot := arch/$(ARCH)/boot 2163 2164ifeq ($(CONFIG_RELOCATABLE),y) 2165quiet_cmd_relocs_check = CALL $< 2166 cmd_relocs_check = perl $< "$(OBJDUMP)" "$(obj)/vmlinux" 2167 2168PHONY += relocs_check 2169relocs_check: arch/powerpc/relocs_check.pl vmlinux 2170 $(call cmd,relocs_check) 2171 2172zImage: relocs_check 2173endif 2174 2175$(BOOT_TARGETS1): vmlinux 2176 $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) 2177$(BOOT_TARGETS2): vmlinux 2178 $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) 2179 2180 2181bootwrapper_install: 2182 $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) 2183 2184%.dtb: 2185 $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) 2186 2187define archhelp 2188 @echo '* zImage - Build default images selected by kernel config' 2189 @echo ' zImage.* - Compressed kernel image (arch/$(ARCH)/boot/zImage.*)' 2190 @echo ' uImage - U-Boot native image format' 2191 @echo ' cuImage.<dt> - Backwards compatible U-Boot image for older' 2192 @echo ' vers vs which do not support device trees' 2193 @echo ' dtbImage.<dt> - zImage with an embedded device tree blob' 2194 @echo ' simpleImage.<dt> - Firmware independent image.' 2195 @echo ' treeImage.<dt> - Support for older IBM 4xx firmware (not U-Boot)' 2196 @echo ' install - Install kernel using' 2197 @echo ' (your) ~/bin/$(INSTALLKERNEL) or' 2198 @echo ' (distribu v) /sbin/$(INSTALLKERNEL) or' 2199 @echo ' install to $$(INSTALL_PATH) and run lilo' 2200 @echo ' *_defconfig - Select default config from arch/$(ARCH)/configs' 2201 @echo '' 2202 @echo ' Targets with <dt> embed a device tree blob inside the image' 2203 @echo ' These targets support board with firmware that does not' 2204 @echo ' support passing a device tree directly. Replace <dt> with the' 2205 @echo ' nam of a dts file from the arch/$(ARCH)/boot/dts/ directory' 2206 @echo ' (minus the .dts extens v).' 2207endef 2208 2209install: 2210 $(Q)$(MAKE) $(build)=$(boot) install 2211 2212vdso_install: 2213ifeq ($(CONFIG_PPC64),y) 2214 $(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso64 $@ 2215endif 2216 $(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso32 $@ 2217 2218archclean: 2219 $(Q)$(MAKE) $(clean)=$(boot) 2220 2221archprepare: checkbin 2222 2223# Use the file '.tmp_gas_check' for binu ls tests, as gas won't output 2224# to stdout and these checks are run even on install targets. 2225TOUT := .tmp_gas_check 2226 2227# Check gcc and binu ls vers vs: 2228# - gcc-3.4 and binu ls-2.14 are a fatal combina v 2229# - Require gcc 4.0 or above on 64-bit 2230# - gcc-4.2.0 has issues compiling modules on 64-bit 2231checkbin: 2232 @if test "$(call cc-vers v)" = "0304" ; then \ 2233 if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \ 2234 echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \ 2235 echo 'correctly with gcc-3.4 and your vers v of binu ls.'; \ 2236 echo '*** Please upgrade your binu ls or downgrade your gcc'; \ 2237 false; \ 2238 fi ; \ 2239 fi 2240 @if test "$(call cc-vers v)" -lt "0400" \ 2241 && test "x${CONFIG_PPC64}" = "xy" ; then \ 2242 echo -n "Sorry, GCC v4.0 or above is required to build " ; \ 2243 echo "the 64-bit powerpc kernel." ; \ 2244 false ; \ 2245 fi 2246 @if test "$(call cc-fullvers v)" = "040200" \ 2247 && test "x${CONFIG_MODULES}${CONFIG_PPC64}" = "xyy" ; then \ 2248 echo -n '*** GCC-4.2.0 cannot compile the 64-bit powerpc ' ; \ 2249 echo 'kernel with modules enabled.' ; \ 2250 echo -n '*** Please use a different GCC vers v or ' ; \ 2251 echo 'disable kernel modules' ; \ 2252 false ; \ 2253 fi 2254 2255CLEAN_FILES += $(TOUT) 2256 2257 The origival LX> soft2">22ass="lil6 22he m-timy>lxr@href=.no> subThe origilxr.href=.no kindcc-hosrnel coefile#L196" p://www.ild64-l-hrepro.no">Rld64-lr> pro AS>