xref: /linux/arch/x86/Makefile (revision 4cd24de3a0980bf3100c9dcb08ef65ca7c31af48)
1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
274b469f2SSam Ravnborg# Unified Makefile for i386 and x86_64
374b469f2SSam Ravnborg
42266cfd5SSam Ravnborg# select defconfig based on actual architecture
5d746d647SSam Ravnborgifeq ($(ARCH),x86)
6ffee0de4SDavid Woodhouse  ifeq ($(shell uname -m),x86_64)
7ffee0de4SDavid Woodhouse        KBUILD_DEFCONFIG := x86_64_defconfig
8ffee0de4SDavid Woodhouse  else
9d746d647SSam Ravnborg        KBUILD_DEFCONFIG := i386_defconfig
10ffee0de4SDavid Woodhouse  endif
11d746d647SSam Ravnborgelse
122266cfd5SSam Ravnborg        KBUILD_DEFCONFIG := $(ARCH)_defconfig
13d746d647SSam Ravnborgendif
142266cfd5SSam Ravnborg
15d77698dfSMatthias Kaehlcke# For gcc stack alignment is specified with -mpreferred-stack-boundary,
16d77698dfSMatthias Kaehlcke# clang has the option -mstack-alignment for that purpose.
17d77698dfSMatthias Kaehlckeifneq ($(call cc-option, -mpreferred-stack-boundary=4),)
188f918697SMatthias Kaehlcke      cc_stack_align4 := -mpreferred-stack-boundary=2
198f918697SMatthias Kaehlcke      cc_stack_align8 := -mpreferred-stack-boundary=3
208f918697SMatthias Kaehlckeelse ifneq ($(call cc-option, -mstack-alignment=16),)
218f918697SMatthias Kaehlcke      cc_stack_align4 := -mstack-alignment=4
228f918697SMatthias Kaehlcke      cc_stack_align8 := -mstack-alignment=8
23d77698dfSMatthias Kaehlckeendif
24d77698dfSMatthias Kaehlcke
251c678da3SDavid Woodhouse# How to compile the 16-bit code.  Note we always compile for -march=i386;
261c678da3SDavid Woodhouse# that way we can complain to the user if the CPU is insufficient.
27de3accdaSDavid Woodhouse#
28de3accdaSDavid Woodhouse# The -m16 option is supported by GCC >= 4.9 and clang >= 3.5. For
29a9cfcceeSH. Peter Anvin# older versions of GCC, include an *assembly* header to make sure that
30a9cfcceeSH. Peter Anvin# gcc doesn't play any games behind our back.
31a9cfcceeSH. Peter AnvinCODE16GCC_CFLAGS := -m32 -Wa,$(srctree)/arch/x86/boot/code16gcc.h
32de3accdaSDavid WoodhouseM16_CFLAGS	 := $(call cc-option, -m16, $(CODE16GCC_CFLAGS))
33de3accdaSDavid Woodhouse
34d6289f36SCao jinREALMODE_CFLAGS	:= $(M16_CFLAGS) -g -Os -DDISABLE_BRANCH_PROFILING \
351c678da3SDavid Woodhouse		   -Wall -Wstrict-prototypes -march=i386 -mregparm=3 \
361c678da3SDavid Woodhouse		   -fno-strict-aliasing -fomit-frame-pointer -fno-pic \
37032a2c4fSMatthias Kaehlcke		   -mno-mmx -mno-sse
38032a2c4fSMatthias Kaehlcke
39032a2c4fSMatthias KaehlckeREALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -ffreestanding)
40032a2c4fSMatthias KaehlckeREALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -fno-stack-protector)
419e8730b1SMatthias KaehlckeREALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), $(cc_stack_align4))
421c678da3SDavid Woodhouseexport REALMODE_CFLAGS
431c678da3SDavid Woodhouse
440a6ef376SSam Ravnborg# BITS is used as extension for files which are available in a 32 bit
450a6ef376SSam Ravnborg# and a 64 bit version to simplify shared Makefiles.
460a6ef376SSam Ravnborg# e.g.: obj-y += foo_$(BITS).o
470a6ef376SSam Ravnborgexport BITS
4874b469f2SSam Ravnborg
49a0215061SKees Cookifdef CONFIG_X86_NEED_RELOCS
50a0215061SKees Cook        LDFLAGS_vmlinux := --emit-relocs
51a0215061SKees Cookendif
52a0215061SKees Cook
53b2c51106SAndy Lutomirski#
54b2c51106SAndy Lutomirski# Prevent GCC from generating any FP code by mistake.
55b2c51106SAndy Lutomirski#
56b2c51106SAndy Lutomirski# This must happen before we try the -mpreferred-stack-boundary, see:
57b2c51106SAndy Lutomirski#
58b2c51106SAndy Lutomirski#    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383
59b2c51106SAndy Lutomirski#
60b2c51106SAndy LutomirskiKBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
61b2c51106SAndy LutomirskiKBUILD_CFLAGS += $(call cc-option,-mno-avx,)
62b2c51106SAndy Lutomirski
63d746d647SSam Ravnborgifeq ($(CONFIG_X86_32),y)
640a6ef376SSam Ravnborg        BITS := 32
658c6531f7SAndreas Herrmann        UTS_MACHINE := i386
664ba7e5cdSSam Ravnborg        CHECKFLAGS += -D__i386__
670a6ef376SSam Ravnborg
684ba7e5cdSSam Ravnborg        biarch := $(call cc-option,-m32)
694ba7e5cdSSam Ravnborg        KBUILD_AFLAGS += $(biarch)
704ba7e5cdSSam Ravnborg        KBUILD_CFLAGS += $(biarch)
710a6ef376SSam Ravnborg
720a6ef376SSam Ravnborg        KBUILD_CFLAGS += -msoft-float -mregparm=3 -freg-struct-return
730a6ef376SSam Ravnborg
74484d90eeSAndrew Boie        # Never want PIC in a 32-bit kernel, prevent breakage with GCC built
75484d90eeSAndrew Boie        # with nonstandard options
76484d90eeSAndrew Boie        KBUILD_CFLAGS += -fno-pic
77484d90eeSAndrew Boie
78d77698dfSMatthias Kaehlcke        # Align the stack to the register width instead of using the default
79d77698dfSMatthias Kaehlcke        # alignment of 16 bytes. This reduces stack usage and the number of
80d77698dfSMatthias Kaehlcke        # alignment instructions.
819e8730b1SMatthias Kaehlcke        KBUILD_CFLAGS += $(call cc-option,$(cc_stack_align4))
820a6ef376SSam Ravnborg
830a6ef376SSam Ravnborg        # CPU-specific tuning. Anything which can be shared with UML should go here.
84a436bb7bSMasahiro Yamada        include arch/x86/Makefile_32.cpu
850a6ef376SSam Ravnborg        KBUILD_CFLAGS += $(cflags-y)
860a6ef376SSam Ravnborg
870a6ef376SSam Ravnborg        # temporary until string.h is fixed
880a6ef376SSam Ravnborg        KBUILD_CFLAGS += -ffreestanding
890a6ef376SSam Ravnborgelse
900a6ef376SSam Ravnborg        BITS := 64
910a6ef376SSam Ravnborg        UTS_MACHINE := x86_64
921f2f01b1SLuc Van Oostenryck        CHECKFLAGS += -D__x86_64__
930a6ef376SSam Ravnborg
9414262d67SGeorge Spelvin        biarch := -m64
950a6ef376SSam Ravnborg        KBUILD_AFLAGS += -m64
960a6ef376SSam Ravnborg        KBUILD_CFLAGS += -m64
970a6ef376SSam Ravnborg
98be6cb027SIngo Molnar        # Align jump targets to 1 byte, not the default 16 bytes:
992c4fd1acSMatthias Kaehlcke        KBUILD_CFLAGS += $(call cc-option,-falign-jumps=1)
100be6cb027SIngo Molnar
10152648e83SIngo Molnar        # Pack loops tightly as well:
1022c4fd1acSMatthias Kaehlcke        KBUILD_CFLAGS += $(call cc-option,-falign-loops=1)
10352648e83SIngo Molnar
1045c630089SRasmus Villemoes        # Don't autogenerate traditional x87 instructions
1058f2dd677SBehan Webster        KBUILD_CFLAGS += $(call cc-option,-mno-80387)
1068f2dd677SBehan Webster        KBUILD_CFLAGS += $(call cc-option,-mno-fp-ret-in-387)
1075551a34eSH. Peter Anvin
108d77698dfSMatthias Kaehlcke        # By default gcc and clang use a stack alignment of 16 bytes for x86.
109d77698dfSMatthias Kaehlcke        # However the standard kernel entry on x86-64 leaves the stack on an
110d77698dfSMatthias Kaehlcke        # 8-byte boundary. If the compiler isn't informed about the actual
111d77698dfSMatthias Kaehlcke        # alignment it will generate extra alignment instructions for the
112d77698dfSMatthias Kaehlcke        # default alignment which keep the stack *mis*aligned.
113d77698dfSMatthias Kaehlcke        # Furthermore an alignment to the register width reduces stack usage
114d77698dfSMatthias Kaehlcke        # and the number of alignment instructions.
1159e8730b1SMatthias Kaehlcke        KBUILD_CFLAGS += $(call cc-option,$(cc_stack_align8))
116d9b0cde9SH.J. Lu
117d9ee948dSH.J. Lu	# Use -mskip-rax-setup if supported.
118d9ee948dSH.J. Lu	KBUILD_CFLAGS += $(call cc-option,-mskip-rax-setup)
119d9ee948dSH.J. Lu
1200a6ef376SSam Ravnborg        # FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu)
1210a6ef376SSam Ravnborg        cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8)
1220a6ef376SSam Ravnborg        cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona)
1230a6ef376SSam Ravnborg
1240a6ef376SSam Ravnborg        cflags-$(CONFIG_MCORE2) += \
1250a6ef376SSam Ravnborg                $(call cc-option,-march=core2,$(call cc-option,-mtune=generic))
126366d19e1STobias Doerffel	cflags-$(CONFIG_MATOM) += $(call cc-option,-march=atom) \
127366d19e1STobias Doerffel		$(call cc-option,-mtune=atom,$(call cc-option,-mtune=generic))
1280a6ef376SSam Ravnborg        cflags-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=generic)
1290a6ef376SSam Ravnborg        KBUILD_CFLAGS += $(cflags-y)
1300a6ef376SSam Ravnborg
1310a6ef376SSam Ravnborg        KBUILD_CFLAGS += -mno-red-zone
1320a6ef376SSam Ravnborg        KBUILD_CFLAGS += -mcmodel=kernel
1330a6ef376SSam Ravnborg
1340a6ef376SSam Ravnborg        # -funit-at-a-time shrinks the kernel .text considerably
1350a6ef376SSam Ravnborg        # unfortunately it makes reading oopses harder.
1360a6ef376SSam Ravnborg        KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time)
1375d707e9cSTejun Heoendif
1380a6ef376SSam Ravnborg
1390bf62763SH. Peter Anvinifdef CONFIG_X86_X32
1400bf62763SH. Peter Anvin	x32_ld_ok := $(call try-run,\
1410bf62763SH. Peter Anvin			/bin/echo -e '1: .quad 1b' | \
1420bf62763SH. Peter Anvin			$(CC) $(KBUILD_AFLAGS) -c -x assembler -o "$$TMP" - && \
1430bf62763SH. Peter Anvin			$(OBJCOPY) -O elf32-x86-64 "$$TMP" "$$TMPO" && \
1440bf62763SH. Peter Anvin			$(LD) -m elf32_x86_64 "$$TMPO" -o "$$TMP",y,n)
1450bf62763SH. Peter Anvin        ifeq ($(x32_ld_ok),y)
1460bf62763SH. Peter Anvin                CONFIG_X86_X32_ABI := y
1470bf62763SH. Peter Anvin                KBUILD_AFLAGS += -DCONFIG_X86_X32_ABI
1480bf62763SH. Peter Anvin                KBUILD_CFLAGS += -DCONFIG_X86_X32_ABI
1490bf62763SH. Peter Anvin        else
1500bf62763SH. Peter Anvin                $(warning CONFIG_X86_X32 enabled but no binutils support)
1510bf62763SH. Peter Anvin        endif
1520bf62763SH. Peter Anvinendif
1530bf62763SH. Peter Anvinexport CONFIG_X86_X32_ABI
1540bf62763SH. Peter Anvin
1553f135e57SJosh Poimboeuf#
1563f135e57SJosh Poimboeuf# If the function graph tracer is used with mcount instead of fentry,
1573f135e57SJosh Poimboeuf# '-maccumulate-outgoing-args' is needed to prevent a GCC bug
1583f135e57SJosh Poimboeuf# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42109)
1593f135e57SJosh Poimboeuf#
1603f135e57SJosh Poimboeufifdef CONFIG_FUNCTION_GRAPH_TRACER
1613f135e57SJosh Poimboeuf  ifndef CONFIG_HAVE_FENTRY
1623f135e57SJosh Poimboeuf	ACCUMULATE_OUTGOING_ARGS := 1
1633f135e57SJosh Poimboeuf  else
1643f135e57SJosh Poimboeuf    ifeq ($(call cc-option-yn, -mfentry), n)
1653f135e57SJosh Poimboeuf	ACCUMULATE_OUTGOING_ARGS := 1
166a5859c6dSJosh Poimboeuf
167a5859c6dSJosh Poimboeuf	# GCC ignores '-maccumulate-outgoing-args' when used with '-Os'.
168a5859c6dSJosh Poimboeuf	# If '-Os' is enabled, disable it and print a warning.
169a5859c6dSJosh Poimboeuf        ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
170a5859c6dSJosh Poimboeuf          undefine CONFIG_CC_OPTIMIZE_FOR_SIZE
171a5859c6dSJosh Poimboeuf          $(warning Disabling CONFIG_CC_OPTIMIZE_FOR_SIZE.  Your compiler does not have -mfentry so you cannot optimize for size with CONFIG_FUNCTION_GRAPH_TRACER.)
172a5859c6dSJosh Poimboeuf        endif
173a5859c6dSJosh Poimboeuf
1743f135e57SJosh Poimboeuf    endif
1753f135e57SJosh Poimboeuf  endif
1763f135e57SJosh Poimboeufendif
1773f135e57SJosh Poimboeuf
1783f135e57SJosh Poimboeufifeq ($(ACCUMULATE_OUTGOING_ARGS), 1)
1794a1bec46SNick Desaulniers	# This compiler flag is not supported by Clang:
1804a1bec46SNick Desaulniers	KBUILD_CFLAGS += $(call cc-option,-maccumulate-outgoing-args,)
1813f135e57SJosh Poimboeufendif
1823f135e57SJosh Poimboeuf
1830a6ef376SSam Ravnborg# Stackpointer is addressed different for 32 bit and 64 bit x86
1840a6ef376SSam Ravnborgsp-$(CONFIG_X86_32) := esp
1850a6ef376SSam Ravnborgsp-$(CONFIG_X86_64) := rsp
1860a6ef376SSam Ravnborg
1877b956f03SAndy Lutomirski# do binutils support CFI?
1887b956f03SAndy Lutomirskicfi := $(call as-instr,.cfi_startproc\n.cfi_rel_offset $(sp-y)$(comma)0\n.cfi_endproc,-DCONFIG_AS_CFI=1)
1897b956f03SAndy Lutomirski# is .cfi_signal_frame supported too?
1907b956f03SAndy Lutomirskicfi-sigframe := $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1)
1917b956f03SAndy Lutomirskicfi-sections := $(call as-instr,.cfi_sections .debug_frame,-DCONFIG_AS_CFI_SECTIONS=1)
1927b956f03SAndy Lutomirski
193d7acb92fSH. Peter Anvin# does binutils support specific instructions?
194d7acb92fSH. Peter Anvinasinstr := $(call as-instr,fxsaveq (%rax),-DCONFIG_AS_FXSAVEQ=1)
19575aaf4c3SJan Beulichasinstr += $(call as-instr,pshufb %xmm0$(comma)%xmm0,-DCONFIG_AS_SSSE3=1)
196ea4d26aeSJim Kukunasavx_instr := $(call as-instr,vxorps %ymm0$(comma)%ymm1$(comma)%ymm2,-DCONFIG_AS_AVX=1)
1977056741fSJim Kukunasavx2_instr :=$(call as-instr,vpbroadcastb %xmm0$(comma)%ymm1,-DCONFIG_AS_AVX2=1)
198e0a491c1SGayatri Kammelaavx512_instr :=$(call as-instr,vpmovm2b %k1$(comma)%zmm5,-DCONFIG_AS_AVX512=1)
199e38b6b7fStimsha1_ni_instr :=$(call as-instr,sha1msg1 %xmm0$(comma)%xmm1,-DCONFIG_AS_SHA1_NI=1)
200e38b6b7fStimsha256_ni_instr :=$(call as-instr,sha256msg1 %xmm0$(comma)%xmm1,-DCONFIG_AS_SHA256_NI=1)
201d7acb92fSH. Peter Anvin
202e0a491c1SGayatri KammelaKBUILD_AFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr)
203e0a491c1SGayatri KammelaKBUILD_CFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr)
2040a6ef376SSam Ravnborg
205d503ac53SMasahiro YamadaKBUILD_LDFLAGS := -m elf_$(UTS_MACHINE)
20625dfeeb7SSam Ravnborg
207e3d03598SH.J. Lu#
208e3d03598SH.J. Lu# The 64-bit kernel must be aligned to 2MB.  Pass -z max-page-size=0x200000 to
209e3d03598SH.J. Lu# the linker to force 2MB page size regardless of the default page size used
210e3d03598SH.J. Lu# by the linker.
211e3d03598SH.J. Lu#
212e3d03598SH.J. Luifdef CONFIG_X86_64
213d503ac53SMasahiro YamadaKBUILD_LDFLAGS += $(call ld-option, -z max-page-size=0x200000)
214e3d03598SH.J. Luendif
215e3d03598SH.J. Lu
21625dfeeb7SSam Ravnborg# Workaround for a gcc prelease that unfortunately was shipped in a suse release
21725dfeeb7SSam RavnborgKBUILD_CFLAGS += -Wno-sign-compare
21825dfeeb7SSam Ravnborg#
21925dfeeb7SSam RavnborgKBUILD_CFLAGS += -fno-asynchronous-unwind-tables
2200a6ef376SSam Ravnborg
22176b04384SDavid Woodhouse# Avoid indirect branches in kernel to deal with Spectre
22276b04384SDavid Woodhouseifdef CONFIG_RETPOLINE
223*4cd24de3SZhenzhong Duanifeq ($(RETPOLINE_CFLAGS),)
224*4cd24de3SZhenzhong Duan  $(error You are building kernel with non-retpoline compiler, please update your compiler.)
22576b04384SDavid Woodhouseendif
226*4cd24de3SZhenzhong Duan  KBUILD_CFLAGS += $(RETPOLINE_CFLAGS)
22776b04384SDavid Woodhouseendif
22876b04384SDavid Woodhouse
2293ce9e53eSMichal Marekarchscripts: scripts_basic
2306520fe55SH. Peter Anvin	$(Q)$(MAKE) $(build)=arch/x86/tools relocs
2316520fe55SH. Peter Anvin
2320a6ef376SSam Ravnborg###
233303395acSH. Peter Anvin# Syscall table generation
234303395acSH. Peter Anvin
235303395acSH. Peter Anvinarchheaders:
2361f57d5d8SIngo Molnar	$(Q)$(MAKE) $(build)=arch/x86/entry/syscalls all
237303395acSH. Peter Anvin
23877b0bf55SNadav Amitarchmacros:
23977b0bf55SNadav Amit	$(Q)$(MAKE) $(build)=arch/x86/kernel arch/x86/kernel/macros.s
24077b0bf55SNadav Amit
241437e88abSNathan ChancellorASM_MACRO_FLAGS = -Wa,arch/x86/kernel/macros.s
24277b0bf55SNadav Amitexport ASM_MACRO_FLAGS
24377b0bf55SNadav AmitKBUILD_CFLAGS += $(ASM_MACRO_FLAGS)
24477b0bf55SNadav Amit
245303395acSH. Peter Anvin###
2460a6ef376SSam Ravnborg# Kernel objects
2470a6ef376SSam Ravnborg
2480a6ef376SSam Ravnborghead-y := arch/x86/kernel/head_$(BITS).o
249700efc1bSEric W. Biedermanhead-y += arch/x86/kernel/head$(BITS).o
250f2d85299SLuis R. Rodriguezhead-y += arch/x86/kernel/ebda.o
2518d152e7aSLuis R. Rodriguezhead-y += arch/x86/kernel/platform-quirks.o
2520a6ef376SSam Ravnborg
2530a6ef376SSam Ravnborglibs-y  += arch/x86/lib/
2540a6ef376SSam Ravnborg
255d1f0ae5eSSam Ravnborg# See arch/x86/Kbuild for content of core part of the kernel
256d1f0ae5eSSam Ravnborgcore-y += arch/x86/
2570a6ef376SSam Ravnborg
2580a6ef376SSam Ravnborg# drivers-y are linked after core-y
2590a6ef376SSam Ravnborgdrivers-$(CONFIG_MATH_EMULATION) += arch/x86/math-emu/
2600a6ef376SSam Ravnborgdrivers-$(CONFIG_PCI)            += arch/x86/pci/
2610a6ef376SSam Ravnborg
2620a6ef376SSam Ravnborg# must be linked after kernel/
2630a6ef376SSam Ravnborgdrivers-$(CONFIG_OPROFILE) += arch/x86/oprofile/
2640a6ef376SSam Ravnborg
265cf7700feSRafael J. Wysocki# suspend and hibernation support
2660a6ef376SSam Ravnborgdrivers-$(CONFIG_PM) += arch/x86/power/
267cf7700feSRafael J. Wysocki
2680a6ef376SSam Ravnborgdrivers-$(CONFIG_FB) += arch/x86/video/
2690a6ef376SSam Ravnborg
2700a6ef376SSam Ravnborg####
2710a6ef376SSam Ravnborg# boot loader support. Several targets are kept for legacy purposes
2720a6ef376SSam Ravnborg
2730a6ef376SSam Ravnborgboot := arch/x86/boot
2740a6ef376SSam Ravnborg
2751648e4f8SH. Peter AnvinBOOT_TARGETS = bzlilo bzdisk fdimage fdimage144 fdimage288 isoimage
276f9c5107cSH. Peter Anvin
277f9c5107cSH. Peter AnvinPHONY += bzImage $(BOOT_TARGETS)
2780a6ef376SSam Ravnborg
2790a6ef376SSam Ravnborg# Default kernel to build
2800a6ef376SSam Ravnborgall: bzImage
2810a6ef376SSam Ravnborg
2820a6ef376SSam Ravnborg# KBUILD_IMAGE specify target image being built
2830a6ef376SSam RavnborgKBUILD_IMAGE := $(boot)/bzImage
2840a6ef376SSam Ravnborg
285f9c5107cSH. Peter AnvinbzImage: vmlinux
286ca0e9badSMasami Hiramatsuifeq ($(CONFIG_X86_DECODER_SELFTEST),y)
287ca0e9badSMasami Hiramatsu	$(Q)$(MAKE) $(build)=arch/x86/tools posttest
288ca0e9badSMasami Hiramatsuendif
2890a6ef376SSam Ravnborg	$(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE)
2900a6ef376SSam Ravnborg	$(Q)mkdir -p $(objtree)/arch/$(UTS_MACHINE)/boot
29141b3eae6SJan Beulich	$(Q)ln -fsn ../../x86/boot/bzImage $(objtree)/arch/$(UTS_MACHINE)/boot/$@
2920a6ef376SSam Ravnborg
293f9c5107cSH. Peter Anvin$(BOOT_TARGETS): vmlinux
294f9c5107cSH. Peter Anvin	$(Q)$(MAKE) $(build)=$(boot) $@
2950a6ef376SSam Ravnborg
2961648e4f8SH. Peter AnvinPHONY += install
2971648e4f8SH. Peter Anvininstall:
2981648e4f8SH. Peter Anvin	$(Q)$(MAKE) $(build)=$(boot) $@
2991648e4f8SH. Peter Anvin
3000a6ef376SSam RavnborgPHONY += vdso_install
3010a6ef376SSam Ravnborgvdso_install:
302d603c8e1SIngo Molnar	$(Q)$(MAKE) $(build)=arch/x86/entry/vdso $@
3030a6ef376SSam Ravnborg
304829fe4aaSBen Hutchingsarchprepare: checkbin
305829fe4aaSBen Hutchingscheckbin:
306829fe4aaSBen Hutchingsifndef CC_HAVE_ASM_GOTO
307829fe4aaSBen Hutchings	@echo Compiler lacks asm-goto support.
308829fe4aaSBen Hutchings	@exit 1
309829fe4aaSBen Hutchingsendif
310829fe4aaSBen Hutchings
3110a6ef376SSam Ravnborgarchclean:
3120a6ef376SSam Ravnborg	$(Q)rm -rf $(objtree)/arch/i386
3130a6ef376SSam Ravnborg	$(Q)rm -rf $(objtree)/arch/x86_64
3140a6ef376SSam Ravnborg	$(Q)$(MAKE) $(clean)=$(boot)
315b2d668daSJarkko Sakkinen	$(Q)$(MAKE) $(clean)=arch/x86/tools
3160a6ef376SSam Ravnborg
3170a6ef376SSam Ravnborgdefine archhelp
3180a6ef376SSam Ravnborg  echo  '* bzImage      - Compressed kernel image (arch/x86/boot/bzImage)'
3190a6ef376SSam Ravnborg  echo  '  install      - Install kernel using'
320caa27b66SSam Ravnborg  echo  '                  (your) ~/bin/$(INSTALLKERNEL) or'
321caa27b66SSam Ravnborg  echo  '                  (distribution) /sbin/$(INSTALLKERNEL) or'
3220a6ef376SSam Ravnborg  echo  '                  install to $$(INSTALL_PATH) and run lilo'
32337f30e21SAndi Kleen  echo  '  fdimage      - Create 1.4MB boot floppy image (arch/x86/boot/fdimage)'
32437f30e21SAndi Kleen  echo  '  fdimage144   - Create 1.4MB boot floppy image (arch/x86/boot/fdimage)'
32537f30e21SAndi Kleen  echo  '  fdimage288   - Create 2.8MB boot floppy image (arch/x86/boot/fdimage)'
32637f30e21SAndi Kleen  echo  '  isoimage     - Create a boot CD-ROM image (arch/x86/boot/image.iso)'
32737f30e21SAndi Kleen  echo  '                  bzdisk/fdimage*/isoimage also accept:'
32837f30e21SAndi Kleen  echo  '                  FDARGS="..."  arguments for the booted kernel'
32937f30e21SAndi Kleen  echo  '                  FDINITRD=file initrd for the booted kernel'
3300a6ef376SSam Ravnborgendef
331