arch/powerpc/boot/Makefile

Source file repositories/reference/linux-study-clean/arch/powerpc/boot/Makefile

File Facts

System
Linux kernel
Corpus path
arch/powerpc/boot/Makefile
Extension
[no extension]
Size
18544 bytes
Lines
500
Domain
Architecture Layer
Bucket
arch/powerpc
Inferred role
Architecture Layer: build/configuration rule
Status
atlas-only

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

# SPDX-License-Identifier: GPL-2.0
# Makefile for making ELF bootable images for booting on CHRP
# using Open Firmware.
#
# Geert Uytterhoeven	September 1997
#
# Based on coffboot by Paul Mackerras
# Simplified for ppc64 by Todd Inglett
#
# NOTE:	this code may be built for 32 bit in ELF32 format even though
#	it packages a 64 bit kernel.  We do this to simplify the
#	bootloader and increase compatibility with OpenFirmware.
#
#	To this end we need to define BOOTCC, etc, as the tools
#	needed to build the 32 bit image.  That's normally the same
#	compiler for the rest of the kernel, with the -m32 flag added.
#	To make it easier to setup a cross compiler,
#	CROSS32_COMPILE is setup as a prefix just like CROSS_COMPILE
#	in the toplevel makefile.

all: $(obj)/zImage

ifdef CROSS32_COMPILE
ifdef CONFIG_CC_IS_CLANG
    BOOTCC := $(CROSS32_COMPILE)clang
else
    BOOTCC := $(CROSS32_COMPILE)gcc
endif
    BOOTAR := $(CROSS32_COMPILE)ar
else
    BOOTCC := $(CC)
    BOOTAR := $(AR)
endif

ifdef CONFIG_PPC64_BOOT_WRAPPER
BOOTTARGETFLAGS	+= -m64
BOOTTARGETFLAGS	+= -mabi=elfv2
ifdef CONFIG_PPC64_ELF_ABI_V2
BOOTTARGETFLAGS	+= $(call cc-option,-mabi=elfv2)
endif
else
BOOTTARGETFLAGS	:= -m32
endif

ifdef CONFIG_TARGET_CPU_BOOL
BOOTTARGETFLAGS	+= -mcpu=$(CONFIG_TARGET_CPU)
else ifdef CONFIG_PPC64_BOOT_WRAPPER
ifdef CONFIG_CPU_LITTLE_ENDIAN
BOOTTARGETFLAGS	+= -mcpu=powerpc64le
else
BOOTTARGETFLAGS	+= -mcpu=powerpc64
endif
endif

$(obj)/4xx.o: BOOTTARGETFLAGS += -mcpu=405
$(obj)/ebony.o: BOOTTARGETFLAGS += -mcpu=440
$(obj)/cuboot-taishan.o: BOOTTARGETFLAGS += -mcpu=440
$(obj)/cuboot-katmai.o: BOOTTARGETFLAGS += -mcpu=440
$(obj)/treeboot-iss4xx.o: BOOTTARGETFLAGS += -mcpu=405
$(obj)/treeboot-currituck.o: BOOTTARGETFLAGS += -mcpu=405
$(obj)/treeboot-akebono.o: BOOTTARGETFLAGS += -mcpu=405

ifdef CONFIG_CPU_BIG_ENDIAN
BOOTTARGETFLAGS	+= -mbig-endian
else
BOOTTARGETFLAGS	+= -mlittle-endian
endif

BOOTCPPFLAGS	:= -nostdinc $(LINUXINCLUDE)
BOOTCPPFLAGS	+= -isystem $(shell $(BOOTCC) -print-file-name=include)

Annotation

Implementation Notes