1 # SPDX-License-Identifier: GPL-2.0-only << 2 # 1 # 3 # Copyright (C) 2004, 2007-2010, 2011-2012 Syn !! 2 # i386/Makefile >> 3 # >> 4 # This file is included by the global makefile so that you can add your own >> 5 # architecture-specific flags and dependencies. Remember to do have actions >> 6 # for "archclean" cleaning up for this architecture. >> 7 # >> 8 # This file is subject to the terms and conditions of the GNU General Public >> 9 # License. See the file "COPYING" in the main directory of this archive >> 10 # for more details. >> 11 # >> 12 # Copyright (C) 1994 by Linus Torvalds >> 13 # >> 14 # 19990713 Artur Skawina <skawina@geocities.com> >> 15 # Added '-march' and '-mpreferred-stack-boundary' support 4 # 16 # 5 17 6 KBUILD_DEFCONFIG := haps_hs_smp_defconfig !! 18 LDFLAGS := -m elf_i386 7 !! 19 OBJCOPYFLAGS := -O binary -R .note -R .comment -S 8 ifeq ($(CROSS_COMPILE),) !! 20 LDFLAGS_vmlinux := 9 CROSS_COMPILE := $(call cc-cross-prefix, arc-l !! 21 10 endif !! 22 CFLAGS += -pipe 11 !! 23 12 cflags-y += -fno-common -pipe -fno-buil !! 24 # prevent gcc from keeping the stack 16 byte aligned 13 !! 25 CFLAGS += $(call check_gcc,-mpreferred-stack-boundary=2,) 14 tune-mcpu-def-$(CONFIG_ISA_ARCOMPACT) := -mc !! 26 15 tune-mcpu-def-$(CONFIG_ISA_ARCV2) := -mc !! 27 align := $(subst -functions=0,,$(call check_gcc,-falign-functions=0,-malign-functions=0)) 16 !! 28 17 ifeq ($(CONFIG_ARC_TUNE_MCPU),) !! 29 cflags-$(CONFIG_M386) += -march=i386 18 cflags-y += $(t !! 30 cflags-$(CONFIG_M486) += -march=i486 19 else !! 31 cflags-$(CONFIG_M586) += -march=i586 20 tune-mcpu := $(C !! 32 cflags-$(CONFIG_M586TSC) += -march=i586 21 ifneq ($(call cc-option,$(tune-mcpu)),) !! 33 cflags-$(CONFIG_M586MMX) += $(call check_gcc,-march=pentium-mmx,-march=i586) 22 cflags-y += $(t !! 34 cflags-$(CONFIG_M686) += -march=i686 23 else !! 35 cflags-$(CONFIG_MPENTIUMII) += $(call check_gcc,-march=pentium2,-march=i686) 24 # The flag provided by 'CONFIG_ARC_TUNE_MCPU' !! 36 cflags-$(CONFIG_MPENTIUMIII) += $(call check_gcc,-march=pentium3,-march=i686) 25 # (probably the compiler is too old). Use ISA !! 37 cflags-$(CONFIG_MPENTIUM4) += $(call check_gcc,-march=pentium4,-march=i686) 26 $(warning ** WARNING ** CONFIG_ARC_TUNE_MCPU f !! 38 cflags-$(CONFIG_MK6) += $(call check_gcc,-march=k6,-march=i586) 27 cflags-y += $(t !! 39 # Please note, that patches that add -march=athlon-xp and friends are pointless. 28 endif !! 40 # They make zero difference whatsosever to performance at this time. 29 endif !! 41 cflags-$(CONFIG_MK7) += $(call check_gcc,-march=athlon,-march=i686 $(align)-functions=4) 30 !! 42 cflags-$(CONFIG_MK8) += $(call check_gcc,-march=k8,$(call check_gcc,-march=athlon,-march=i686 $(align)-functions=4)) 31 ifdef CONFIG_ARC_CURR_IN_REG !! 43 cflags-$(CONFIG_MCRUSOE) += -march=i686 $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 32 # For a global register definition, make sure !! 44 cflags-$(CONFIG_MWINCHIPC6) += $(call check_gcc,-march=winchip-c6,-march=i586) 33 # We had a customer reported bug where some co !! 45 cflags-$(CONFIG_MWINCHIP2) += $(call check_gcc,-march=winchip2,-march=i586) 34 # any kernel headers, and missing the global r !! 46 cflags-$(CONFIG_MWINCHIP3D) += $(call check_gcc,-march=winchip2,-march=i586) 35 # Can't do unconditionally because of recursiv !! 47 cflags-$(CONFIG_MCYRIXIII) += $(call check_gcc,-march=c3,-march=i486) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 36 # due to <linux/thread_info.h> !! 48 cflags-$(CONFIG_MVIAC3_2) += $(call check_gcc,-march=c3-2,-march=i686) 37 LINUXINCLUDE += -include $(srctree)/arch/a !! 49 38 cflags-y += -ffixed-gp !! 50 CFLAGS += $(cflags-y) 39 endif !! 51 40 !! 52 # Default subarch .c files 41 cflags-y += -fs !! 53 mcore-y := mach-default 42 !! 54 43 cflags-$(CONFIG_ARC_HAS_LLSC) += -ml !! 55 # Voyager subarch support 44 cflags-$(CONFIG_ARC_HAS_SWAPE) += -ms !! 56 mflags-$(CONFIG_X86_VOYAGER) := -Iinclude/asm-i386/mach-voyager 45 !! 57 mcore-$(CONFIG_X86_VOYAGER) := mach-voyager 46 ifdef CONFIG_ISA_ARCV2 !! 58 47 !! 59 # VISWS subarch support 48 ifdef CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS !! 60 mflags-$(CONFIG_X86_VISWS) := -Iinclude/asm-i386/mach-visws 49 cflags-y += -mu !! 61 mcore-$(CONFIG_X86_VISWS) := mach-visws 50 else !! 62 51 cflags-y += -mn !! 63 # NUMAQ subarch support 52 endif !! 64 mflags-$(CONFIG_X86_NUMAQ) := -Iinclude/asm-i386/mach-numaq 53 !! 65 mcore-$(CONFIG_X86_NUMAQ) := mach-default 54 ifndef CONFIG_ARC_HAS_LL64 !! 66 55 cflags-y += -mn !! 67 # BIGSMP subarch support 56 endif !! 68 mflags-$(CONFIG_X86_BIGSMP) := -Iinclude/asm-i386/mach-bigsmp 57 !! 69 mcore-$(CONFIG_X86_BIGSMP) := mach-default 58 ifndef CONFIG_ARC_HAS_DIV_REM !! 70 59 cflags-y += -mn !! 71 #Summit subarch support 60 endif !! 72 mflags-$(CONFIG_X86_SUMMIT) := -Iinclude/asm-i386/mach-summit 61 !! 73 mcore-$(CONFIG_X86_SUMMIT) := mach-default 62 endif !! 74 63 !! 75 # generic subarchitecture 64 cfi := $(call as-instr,.cfi_startproc\n.cfi_en !! 76 mflags-$(CONFIG_X86_GENERICARCH) := -Iinclude/asm-i386/mach-generic 65 cflags-$(CONFIG_ARC_DW2_UNWIND) += -fa !! 77 mcore-$(CONFIG_X86_GENERICARCH) := mach-default 66 !! 78 core-$(CONFIG_X86_GENERICARCH) += arch/i386/mach-generic/ 67 # small data is default for elf32 tool-chain. !! 79 68 # This also allows repurposing GP as scratch r !! 80 # ES7000 subarch support 69 disable_small_data := y !! 81 mflags-$(CONFIG_X86_ES7000) := -Iinclude/asm-i386/mach-es7000 70 cflags-$(disable_small_data) += -mn !! 82 mcore-$(CONFIG_X86_ES7000) := mach-es7000 71 !! 83 72 cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb !! 84 # default subarch .h files 73 ldflags-$(CONFIG_CPU_BIG_ENDIAN) += -EB !! 85 mflags-y += -Iinclude/asm-i386/mach-default 74 !! 86 75 LIBGCC = $(shell $(CC) $(cflags-y) --print-li !! 87 head-y := arch/i386/kernel/head.o arch/i386/kernel/init_task.o 76 !! 88 77 # Modules with short calls might break for cal !! 89 libs-y += arch/i386/lib/ 78 KBUILD_CFLAGS_MODULE += -mlong-calls -mno-m !! 90 core-y += arch/i386/kernel/ \ 79 !! 91 arch/i386/mm/ \ 80 # Finally dump eveything into kernel build sys !! 92 arch/i386/$(mcore-y)/ 81 KBUILD_CFLAGS += $(cflags-y) !! 93 drivers-$(CONFIG_MATH_EMULATION) += arch/i386/math-emu/ 82 KBUILD_AFLAGS += $(KBUILD_CFLAGS) !! 94 drivers-$(CONFIG_PCI) += arch/i386/pci/ 83 KBUILD_LDFLAGS += $(ldflags-y) !! 95 # must be linked after kernel/ 84 !! 96 drivers-$(CONFIG_OPROFILE) += arch/i386/oprofile/ 85 # w/o this dtb won't embed into kernel binary !! 97 drivers-$(CONFIG_PM) += arch/i386/power/ 86 core-y += arch/arc/boot/dts/ !! 98 87 !! 99 CFLAGS += $(mflags-y) 88 core-y += arch/arc/pl !! 100 AFLAGS += $(mflags-y) 89 core-$(CONFIG_ARC_PLAT_TB10X) += arch/arc/pl !! 101 90 core-$(CONFIG_ARC_PLAT_AXS10X) += arch/arc/pl !! 102 boot := arch/i386/boot 91 core-$(CONFIG_ARC_SOC_HSDK) += arch/arc/pl !! 103 92 !! 104 .PHONY: zImage bzImage compressed zlilo bzlilo \ 93 libs-y += arch/arc/lib/ $(LIBGCC) !! 105 zdisk bzdisk fdimage fdimage144 fdimage288 install 94 !! 106 95 boot := arch/arc/boot !! 107 all: bzImage 96 !! 108 97 boot_targets := uImage.bin uImage.gz uImage.lz !! 109 BOOTIMAGE=arch/i386/boot/bzImage 98 !! 110 zImage zlilo zdisk: BOOTIMAGE=arch/i386/boot/zImage 99 PHONY += $(boot_targets) !! 111 100 $(boot_targets): vmlinux !! 112 zImage bzImage: vmlinux 101 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$ !! 113 $(Q)$(MAKE) $(build)=$(boot) $(BOOTIMAGE) 102 !! 114 103 uimage-default-y := uIm !! 115 compressed: zImage 104 uimage-default-$(CONFIG_KERNEL_GZIP) := uIm !! 116 105 uimage-default-$(CONFIG_KERNEL_LZMA) := uIm !! 117 zlilo bzlilo: vmlinux 106 !! 118 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) zlilo 107 PHONY += uImage !! 119 108 uImage: $(uimage-default-y) !! 120 zdisk bzdisk: vmlinux 109 @ln -sf $< $(boot)/uImage !! 121 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) zdisk 110 @$(kecho) ' Image $(boot)/uImage is r !! 122 >> 123 install fdimage fdimage144 fdimage288: vmlinux >> 124 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@ >> 125 >> 126 prepare: include/asm-$(ARCH)/asm_offsets.h >> 127 CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h >> 128 >> 129 arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ >> 130 include/config/MARKER >> 131 >> 132 include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s >> 133 $(call filechk,gen-asm-offsets) >> 134 >> 135 archclean: >> 136 $(Q)$(MAKE) $(clean)=arch/i386/boot >> 137 >> 138 define archhelp >> 139 echo '* bzImage - Compressed kernel image (arch/$(ARCH)/boot/bzImage)' >> 140 echo ' install - Install kernel using' >> 141 echo ' (your) ~/bin/installkernel or' >> 142 echo ' (distribution) /sbin/installkernel or' >> 143 echo ' install to $$(INSTALL_PATH) and run lilo' >> 144 echo ' bzdisk - Create a boot floppy in /dev/fd0' >> 145 echo ' fdimage - Create a boot floppy image' >> 146 endef 111 147 112 CLEAN_FILES += $(boot)/uImage !! 148 CLEAN_FILES += arch/$(ARCH)/boot/fdimage arch/$(ARCH)/boot/mtools.conf
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.