1 # 1 # 2 # arch/sh/Makefile !! 2 # i386/Makefile 3 # 3 # 4 # Copyright (C) 1999 Kaz Kojima !! 4 # This file is included by the global makefile so that you can add your own 5 # Copyright (C) 2002 - 2008 Paul Mundt !! 5 # architecture-specific flags and dependencies. Remember to do have actions 6 # Copyright (C) 2002 M. R. Brown !! 6 # for "archclean" cleaning up for this architecture. 7 # 7 # 8 # This file is subject to the terms and condit 8 # This file is subject to the terms and conditions of the GNU General Public 9 # License. See the file "COPYING" in the main 9 # License. See the file "COPYING" in the main directory of this archive 10 # for more details. 10 # for more details. 11 # 11 # 12 ifdef cross_compiling !! 12 # Copyright (C) 1994 by Linus Torvalds 13 ifeq ($(CROSS_COMPILE),) << 14 CROSS_COMPILE := $(call cc-cross-prefix, s << 15 endif << 16 endif << 17 << 18 KBUILD_DEFCONFIG := shx3_defconfig << 19 << 20 isa-y := any << 21 isa-$(CONFIG_SH_DSP) := sh << 22 isa-$(CONFIG_CPU_SH2) := sh2 << 23 isa-$(CONFIG_CPU_SH2A) := sh2 << 24 isa-$(CONFIG_CPU_SH3) := sh3 << 25 isa-$(CONFIG_CPU_SH4) := sh4 << 26 isa-$(CONFIG_CPU_SH4A) := sh4 << 27 isa-$(CONFIG_CPU_SH4AL_DSP) := sh4 << 28 << 29 isa-$(CONFIG_SH_DSP) := $(i << 30 isa-y := $(i << 31 << 32 cflags-$(CONFIG_CPU_SH2) := $(c << 33 cflags-$(CONFIG_CPU_J2) += $(c << 34 cflags-$(CONFIG_CPU_SH2A) += $(c << 35 $(c << 36 $(c << 37 cflags-$(CONFIG_CPU_SH3) := $(c << 38 cflags-$(CONFIG_CPU_SH4) := $(c << 39 $(call cc-option,-mno-implicit-fp,-m4- << 40 cflags-$(CONFIG_CPU_SH4A) += $(c << 41 $(c << 42 cflags-$(CONFIG_CPU_SH4AL_DSP) += $(c << 43 << 44 ifeq ($(cflags-y),) << 45 # << 46 # In the case where we are stuck with a compil << 47 # restricted to a particular ISA, a favourite << 48 # extensive multilib targets are not provided, << 49 # regarding FP generation. This is intentional << 50 # orders of magnitude less than GCC's default << 51 # with a large number of multilib targets bett << 52 # correctly for the target in mind. << 53 # 13 # 54 cflags-y += $(shell $(CC) $(KBUILD_CFLA !! 14 # 19990713 Artur Skawina <skawina@geocities.com> 55 grep nofpu | sed q | sed !! 15 # Added '-march' and '-mpreferred-stack-boundary' support 56 # At this point, anything goes. << 57 isaflags-y := $(call as-option,-Wa$(comma << 58 else << 59 # 16 # 60 # -Wa,-isa= tuning implies -Wa,-dsp for the ve << 61 # support it, while -Wa,-dsp by itself limits << 62 # on certain CPU subtypes. Try the ISA variant << 63 # fall back on -Wa,-dsp for the old binutils v << 64 # opcodes, we always want the best ISA tuning << 65 # will provide. << 66 # << 67 isaflags-y := $(call as-option,-Wa$(comma << 68 17 69 isaflags-$(CONFIG_SH_DSP) := \ !! 18 LDFLAGS := -m elf_i386 70 $(call as-option,-Wa$(comma)-isa=$(isa !! 19 OBJCOPYFLAGS := -O binary -R .note -R .comment -S 71 endif !! 20 LDFLAGS_vmlinux := 72 !! 21 73 cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb !! 22 CFLAGS += -pipe 74 cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml !! 23 75 !! 24 # prevent gcc from keeping the stack 16 byte aligned 76 cflags-y += $(call cc-option,-mno-fdpic !! 25 CFLAGS += $(call check_gcc,-mpreferred-stack-boundary=2,) 77 cflags-y += $(isaflags-y) -ffreestandin !! 26 78 !! 27 align := $(subst -functions=0,,$(call check_gcc,-falign-functions=0,-malign-functions=0)) 79 OBJCOPYFLAGS := -O binary -R .note -R .note !! 28 80 -R .stab -R .stabstr -S !! 29 cflags-$(CONFIG_M386) += -march=i386 81 !! 30 cflags-$(CONFIG_M486) += -march=i486 82 # Give the various platforms the opportunity t !! 31 cflags-$(CONFIG_M586) += -march=i586 83 defaultimage-y !! 32 cflags-$(CONFIG_M586TSC) += -march=i586 84 defaultimage-$(CONFIG_SH_SH7785LCR) !! 33 cflags-$(CONFIG_M586MMX) += $(call check_gcc,-march=pentium-mmx,-march=i586) 85 defaultimage-$(CONFIG_SH_RSK) !! 34 cflags-$(CONFIG_M686) += -march=i686 86 defaultimage-$(CONFIG_SH_URQUELL) !! 35 cflags-$(CONFIG_MPENTIUMII) += $(call check_gcc,-march=pentium2,-march=i686) 87 defaultimage-$(CONFIG_SH_MIGOR) !! 36 cflags-$(CONFIG_MPENTIUMIII) += $(call check_gcc,-march=pentium3,-march=i686) 88 defaultimage-$(CONFIG_SH_AP325RXA) !! 37 cflags-$(CONFIG_MPENTIUM4) += $(call check_gcc,-march=pentium4,-march=i686) 89 defaultimage-$(CONFIG_SH_SH7757LCR) !! 38 cflags-$(CONFIG_MK6) += $(call check_gcc,-march=k6,-march=i586) 90 defaultimage-$(CONFIG_SH_7724_SOLUTION_ENGINE) !! 39 # Please note, that patches that add -march=athlon-xp and friends are pointless. 91 defaultimage-$(CONFIG_SH_7206_SOLUTION_ENGINE) !! 40 # They make zero difference whatsosever to performance at this time. 92 defaultimage-$(CONFIG_SH_7619_SOLUTION_ENGINE) !! 41 cflags-$(CONFIG_MK7) += $(call check_gcc,-march=athlon,-march=i686 $(align)-functions=4) 93 !! 42 cflags-$(CONFIG_MK8) += $(call check_gcc,-march=k8,$(call check_gcc,-march=athlon,-march=i686 $(align)-functions=4)) 94 # Set some sensible Kbuild defaults !! 43 cflags-$(CONFIG_MCRUSOE) += -march=i686 $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 95 boot := arch/sh/boot !! 44 cflags-$(CONFIG_MWINCHIPC6) += $(call check_gcc,-march=winchip-c6,-march=i586) 96 KBUILD_IMAGE := $(boot)/$(defaultim !! 45 cflags-$(CONFIG_MWINCHIP2) += $(call check_gcc,-march=winchip2,-march=i586) >> 46 cflags-$(CONFIG_MWINCHIP3D) += $(call check_gcc,-march=winchip2,-march=i586) >> 47 cflags-$(CONFIG_MCYRIXIII) += $(call check_gcc,-march=c3,-march=i486) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 >> 48 cflags-$(CONFIG_MVIAC3_2) += $(call check_gcc,-march=c3-2,-march=i686) >> 49 >> 50 CFLAGS += $(cflags-y) >> 51 >> 52 # Default subarch .c files >> 53 mcore-y := mach-default >> 54 >> 55 # Voyager subarch support >> 56 mflags-$(CONFIG_X86_VOYAGER) := -Iinclude/asm-i386/mach-voyager >> 57 mcore-$(CONFIG_X86_VOYAGER) := mach-voyager >> 58 >> 59 # VISWS subarch support >> 60 mflags-$(CONFIG_X86_VISWS) := -Iinclude/asm-i386/mach-visws >> 61 mcore-$(CONFIG_X86_VISWS) := mach-visws >> 62 >> 63 # NUMAQ subarch support >> 64 mflags-$(CONFIG_X86_NUMAQ) := -Iinclude/asm-i386/mach-numaq >> 65 mcore-$(CONFIG_X86_NUMAQ) := mach-default >> 66 >> 67 # BIGSMP subarch support >> 68 mflags-$(CONFIG_X86_BIGSMP) := -Iinclude/asm-i386/mach-bigsmp >> 69 mcore-$(CONFIG_X86_BIGSMP) := mach-default >> 70 >> 71 #Summit subarch support >> 72 mflags-$(CONFIG_X86_SUMMIT) := -Iinclude/asm-i386/mach-summit >> 73 mcore-$(CONFIG_X86_SUMMIT) := mach-default >> 74 >> 75 # generic subarchitecture >> 76 mflags-$(CONFIG_X86_GENERICARCH) := -Iinclude/asm-i386/mach-generic >> 77 mcore-$(CONFIG_X86_GENERICARCH) := mach-default >> 78 core-$(CONFIG_X86_GENERICARCH) += arch/i386/mach-generic/ >> 79 >> 80 # ES7000 subarch support >> 81 mflags-$(CONFIG_X86_ES7000) := -Iinclude/asm-i386/mach-es7000 >> 82 mcore-$(CONFIG_X86_ES7000) := mach-es7000 >> 83 >> 84 # default subarch .h files >> 85 mflags-y += -Iinclude/asm-i386/mach-default >> 86 >> 87 head-y := arch/i386/kernel/head.o arch/i386/kernel/init_task.o >> 88 >> 89 libs-y += arch/i386/lib/ >> 90 core-y += arch/i386/kernel/ \ >> 91 arch/i386/mm/ \ >> 92 arch/i386/$(mcore-y)/ >> 93 drivers-$(CONFIG_MATH_EMULATION) += arch/i386/math-emu/ >> 94 drivers-$(CONFIG_PCI) += arch/i386/pci/ >> 95 # must be linked after kernel/ >> 96 drivers-$(CONFIG_OPROFILE) += arch/i386/oprofile/ >> 97 drivers-$(CONFIG_PM) += arch/i386/power/ >> 98 >> 99 CFLAGS += $(mflags-y) >> 100 AFLAGS += $(mflags-y) >> 101 >> 102 boot := arch/i386/boot >> 103 >> 104 .PHONY: zImage bzImage compressed zlilo bzlilo \ >> 105 zdisk bzdisk fdimage fdimage144 fdimage288 install 97 106 98 # !! 107 all: bzImage 99 # Choosing incompatible machines durings confi << 100 # error messages during linking. << 101 # << 102 UTS_MACHINE := sh << 103 LDFLAGS_vmlinux += -e _stext << 104 108 105 ifdef CONFIG_CPU_LITTLE_ENDIAN !! 109 BOOTIMAGE=arch/i386/boot/bzImage 106 ld-bfd := elf32-sh-linux !! 110 zImage zlilo zdisk: BOOTIMAGE=arch/i386/boot/zImage 107 LDFLAGS_vmlinux += --defsym jiffies=ji << 108 KBUILD_LDFLAGS += -EL << 109 else << 110 ld-bfd := elf32-shbig-linux << 111 LDFLAGS_vmlinux += --defsym jiffies=ji << 112 KBUILD_LDFLAGS += -EB << 113 endif << 114 << 115 export ld-bfd << 116 << 117 # Mach groups << 118 machdir-$(CONFIG_SOLUTION_ENGINE) << 119 machdir-$(CONFIG_SH_DREAMCAST) << 120 machdir-$(CONFIG_SH_SH03) << 121 machdir-$(CONFIG_SH_MIGOR) << 122 machdir-$(CONFIG_SH_KFR2R09) << 123 machdir-$(CONFIG_SH_ECOVEC) << 124 machdir-$(CONFIG_SH_SDK7786) << 125 machdir-$(CONFIG_SH_X3PROTO) << 126 machdir-$(CONFIG_SH_LANDISK) << 127 machdir-y << 128 111 129 # !! 112 zImage bzImage: vmlinux 130 # CPU header paths !! 113 $(Q)$(MAKE) $(build)=$(boot) $(BOOTIMAGE) 131 # !! 114 132 # These are ordered by optimization level. A C !! 115 compressed: zImage 133 # of another (ie, SH-2A / SH-2), is picked up << 134 # levels of genericness if nothing more suitab << 135 # hierarchy. << 136 # << 137 # As an example, in order of preference, SH-2A << 138 # << 139 cpuincdir-$(CONFIG_CPU_SH2A) += cpu-sh2a << 140 cpuincdir-$(CONFIG_CPU_SH2) += cpu-sh2 << 141 cpuincdir-$(CONFIG_CPU_SH3) += cpu-sh3 << 142 cpuincdir-$(CONFIG_CPU_SH4A) += cpu-sh4a << 143 cpuincdir-$(CONFIG_CPU_SH4) += cpu-sh4 << 144 cpuincdir-y += cpu-common << 145 << 146 drivers-y += arch/sh/dri << 147 << 148 KBUILD_CPPFLAGS += $(addprefix -I $(sr << 149 KBUILD_CFLAGS += -pipe $(cflags-y) << 150 KBUILD_AFLAGS += $(cflags-y) << 151 << 152 ifeq ($(CONFIG_MCOUNT),y) << 153 KBUILD_CFLAGS += -pg << 154 endif << 155 << 156 ifeq ($(CONFIG_DWARF_UNWINDER),y) << 157 KBUILD_CFLAGS += -fasynchronous-unwind-table << 158 endif << 159 << 160 libs-y := arch/sh/lib/ $(libs << 161 << 162 BOOT_TARGETS = uImage uImage.bz2 uImage.gz uIm << 163 uImage.srec uImage.bin zImage v << 164 romImage << 165 PHONY += $(BOOT_TARGETS) << 166 116 167 all: $(notdir $(KBUILD_IMAGE)) !! 117 zlilo bzlilo: vmlinux >> 118 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) zlilo 168 119 169 $(BOOT_TARGETS): vmlinux !! 120 zdisk bzdisk: vmlinux 170 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$ !! 121 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) zdisk 171 122 172 compressed: zImage !! 123 install fdimage fdimage144 fdimage288: vmlinux >> 124 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@ 173 125 174 archprepare: !! 126 prepare: include/asm-$(ARCH)/asm_offsets.h 175 $(Q)$(MAKE) $(build)=arch/sh/tools inc !! 127 CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h 176 128 177 archheaders: !! 129 arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ 178 $(Q)$(MAKE) $(build)=arch/sh/kernel/sy !! 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 179 137 180 define archhelp 138 define archhelp 181 @echo ' zImage - C !! 139 echo '* bzImage - Compressed kernel image (arch/$(ARCH)/boot/bzImage)' 182 @echo ' romImage - C !! 140 echo ' install - Install kernel using' 183 @echo ' vmlinux.srec - C !! 141 echo ' (your) ~/bin/installkernel or' 184 @echo ' vmlinux.bin - C !! 142 echo ' (distribution) /sbin/installkernel or' 185 @echo '* uImage - A !! 143 echo ' install to $$(INSTALL_PATH) and run lilo' 186 @echo ' uImage.srec - C !! 144 echo ' bzdisk - Create a boot floppy in /dev/fd0' 187 @echo ' uImage.bin - K !! 145 echo ' fdimage - Create a boot floppy image' 188 @echo '* uImage.gz - K << 189 @echo ' uImage.bz2 - K << 190 @echo ' uImage.lzma - K << 191 @echo ' uImage.xz - K << 192 @echo ' uImage.lzo - K << 193 endef 146 endef >> 147 >> 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.