⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 makefile

📁 linux 内核源代码
💻
字号:
# 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#HAS_BIARCH	:= $(call cc-option-yn, -m32)# Set default 32 bits cross compilers for vdso and boot wrapperCROSS32_COMPILE ?=CROSS32CC		:= $(CROSS32_COMPILE)gccCROSS32AS		:= $(CROSS32_COMPILE)asCROSS32LD		:= $(CROSS32_COMPILE)ldCROSS32AR		:= $(CROSS32_COMPILE)arCROSS32OBJCOPY		:= $(CROSS32_COMPILE)objcopyifeq ($(HAS_BIARCH),y)ifeq ($(CROSS32_COMPILE),)CROSS32CC	:= $(CC) -m32CROSS32AS	:= $(AS) -a32CROSS32LD	:= $(LD) -m elf32ppcCROSS32OBJCOPY	:= $(OBJCOPY)CROSS32AR	:= GNUTARGET=elf32-powerpc $(AR)endifendifexport CROSS32CC CROSS32AS CROSS32LD CROSS32AR CROSS32OBJCOPYifeq ($(CROSS_COMPILE),)KBUILD_DEFCONFIG := $(shell uname -m)_defconfigelseKBUILD_DEFCONFIG := ppc64_defconfigendififeq ($(CONFIG_PPC64),y)OLDARCH	:= ppc64new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi)ifeq ($(new_nm),y)NM		:= $(NM) --syntheticendifelseOLDARCH	:= ppcendif# It seems there are times we use this Makefile without# including the config file, but this replicates the old behaviourifeq ($(CONFIG_WORD_SIZE),)CONFIG_WORD_SIZE := 32endifUTS_MACHINE := $(OLDARCH)ifeq ($(HAS_BIARCH),y)override AS	+= -a$(CONFIG_WORD_SIZE)override LD	+= -m elf$(CONFIG_WORD_SIZE)ppcoverride CC	+= -m$(CONFIG_WORD_SIZE)override AR	:= GNUTARGET=elf$(CONFIG_WORD_SIZE)-powerpc $(AR)endifLDFLAGS_vmlinux	:= -BstaticCPPFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH)AFLAGS-$(CONFIG_PPC32)	:= -Iarch/$(ARCH)CFLAGS-$(CONFIG_PPC64)	:= -mminimal-toc -mtraceback=none  -mcall-aixdescCFLAGS-$(CONFIG_PPC32)	:= -Iarch/$(ARCH) -ffixed-r2 -mmultipleKBUILD_CPPFLAGS	+= $(CPPFLAGS-y)KBUILD_AFLAGS	+= $(AFLAGS-y)KBUILD_CFLAGS	+= -msoft-float -pipe $(CFLAGS-y)CPP		= $(CC) -E $(KBUILD_CFLAGS)CHECKFLAGS	+= -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__ifeq ($(CONFIG_PPC64),y)GCC_BROKEN_VEC	:= $(shell if [ $(call cc-version) -lt 0400 ] ; then echo "y"; fi)ifeq ($(CONFIG_POWER4_ONLY),y)ifeq ($(CONFIG_ALTIVEC),y)ifeq ($(GCC_BROKEN_VEC),y)	KBUILD_CFLAGS += $(call cc-option,-mcpu=970)else	KBUILD_CFLAGS += $(call cc-option,-mcpu=power4)endifelse	KBUILD_CFLAGS += $(call cc-option,-mcpu=power4)endifelse	KBUILD_CFLAGS += $(call cc-option,-mtune=power4)endifendififeq ($(CONFIG_TUNE_CELL),y)	KBUILD_CFLAGS += $(call cc-option,-mtune=cell)endif# No AltiVec instruction when building kernelKBUILD_CFLAGS += $(call cc-option,-mno-altivec)# No SPE instruction when building kernelKBUILD_CFLAGS += $(call cc-option,-mno-spe)# Enable unit-at-a-time mode when possible. It shrinks the# kernel considerably.KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time)# Never use string load/store instructions as they are# often slow when they are implemented at allKBUILD_CFLAGS		+= -mno-stringifeq ($(CONFIG_6xx),y)KBUILD_CFLAGS		+= -mcpu=powerpcendifcpu-as-$(CONFIG_4xx)		+= -Wa,-m405cpu-as-$(CONFIG_6xx)		+= -Wa,-maltiveccpu-as-$(CONFIG_POWER4)		+= -Wa,-maltiveccpu-as-$(CONFIG_E500)		+= -Wa,-me500cpu-as-$(CONFIG_E200)		+= -Wa,-me200KBUILD_AFLAGS += $(cpu-as-y)KBUILD_CFLAGS += $(cpu-as-y)head-y				:= arch/powerpc/kernel/head_$(CONFIG_WORD_SIZE).ohead-$(CONFIG_8xx)		:= arch/powerpc/kernel/head_8xx.ohead-$(CONFIG_40x)		:= arch/powerpc/kernel/head_40x.ohead-$(CONFIG_44x)		:= arch/powerpc/kernel/head_44x.ohead-$(CONFIG_FSL_BOOKE)	:= arch/powerpc/kernel/head_fsl_booke.ohead-$(CONFIG_PPC64)		+= arch/powerpc/kernel/entry_64.ohead-$(CONFIG_PPC_FPU)		+= arch/powerpc/kernel/fpu.ocore-y				+= arch/powerpc/kernel/ \				   arch/powerpc/mm/ \				   arch/powerpc/lib/ \				   arch/powerpc/sysdev/ \				   arch/powerpc/platforms/core-$(CONFIG_MATH_EMULATION)	+= arch/powerpc/math-emu/core-$(CONFIG_XMON)		+= arch/powerpc/xmon/drivers-$(CONFIG_OPROFILE)	+= arch/powerpc/oprofile/# Default to zImage, override when neededdefaultimage-y			:= zImagedefaultimage-$(CONFIG_DEFAULT_UIMAGE) := uImageKBUILD_IMAGE := $(defaultimage-y)all: $(KBUILD_IMAGE)CPPFLAGS_vmlinux.lds	:= -UpowerpcBOOT_TARGETS = zImage zImage.initrd uImagePHONY += $(BOOT_TARGETS)boot := arch/$(ARCH)/boot$(BOOT_TARGETS): vmlinux	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)define archhelp  @echo '* zImage          - Compressed kernel image (arch/$(ARCH)/boot/zImage.*)'  @echo '  install         - Install kernel using'  @echo '                    (your) ~/bin/installkernel or'  @echo '                    (distribution) /sbin/installkernel or'  @echo '                    install to $$(INSTALL_PATH) and run lilo'  @echo '  *_defconfig     - Select default config from arch/$(ARCH)/configs'endefinstall: vdso_install	$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) installvdso_install:ifeq ($(CONFIG_PPC64),y)	$(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso64 $@endif	$(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso32 $@archclean:	$(Q)$(MAKE) $(clean)=$(boot)archprepare: checkbin# Use the file '.tmp_gas_check' for binutils tests, as gas won't output# to stdout and these checks are run even on install targets.TOUT	:= .tmp_gas_check# Ensure this is binutils 2.12.1 (or 2.12.90.0.7) or later for altivec# instructions.# gcc-3.4 and binutils-2.14 are a fatal combination.checkbin:	@if test "$(call cc-version)" = "0304" ; then \		if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \			echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \			echo 'correctly with gcc-3.4 and your version of binutils.'; \			echo '*** Please upgrade your binutils or downgrade your gcc'; \			false; \		fi ; \	fi	@if test "$(call cc-fullversion)" = "040200" \	    && test "x${CONFIG_MODULES}${CONFIG_PPC64}" = "xyy" ; then \		echo -n '*** GCC-4.2.0 cannot compile the 64-bit powerpc ' ; \		echo 'kernel with modules enabled.' ; \		echo -n '*** Please use a different GCC version or ' ; \		echo 'disable kernel modules' ; \		false ; \	fi	@if ! /bin/echo dssall | $(AS) -many -o $(TOUT) >/dev/null 2>&1 ; then \		echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build ' ; \		echo 'correctly with old versions of binutils.' ; \		echo '*** Please upgrade your binutils to 2.12.1 or newer' ; \		false ; \	fiCLEAN_FILES += $(TOUT)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -