1 # !! 1 # This file is included by the global makefile so that you can add your own 2 # arch/sh/Makefile !! 2 # architecture-specific flags and dependencies. 3 # << 4 # Copyright (C) 1999 Kaz Kojima << 5 # Copyright (C) 2002 - 2008 Paul Mundt << 6 # Copyright (C) 2002 M. R. Brown << 7 # 3 # 8 # This file is subject to the terms and condit 4 # This file is subject to the terms and conditions of the GNU General Public 9 # License. See the file "COPYING" in the main 5 # License. See the file "COPYING" in the main directory of this archive 10 # for more details. 6 # for more details. 11 # 7 # 12 ifdef cross_compiling !! 8 # Copyright (C) 1994 by Linus Torvalds 13 ifeq ($(CROSS_COMPILE),) !! 9 # Changes for PPC by Gary Thomas 14 CROSS_COMPILE := $(call cc-cross-prefix, s !! 10 # Rewritten by Cort Dougan and Paul Mackerras 15 endif !! 11 # 16 endif << 17 12 18 KBUILD_DEFCONFIG := shx3_defconfig !! 13 # This must match PAGE_OFFSET in include/asm-ppc/page.h. >> 14 KERNELLOAD := $(CONFIG_KERNEL_START) 19 15 20 isa-y := any !! 16 LDFLAGS_vmlinux := -Ttext $(KERNELLOAD) -Bstatic 21 isa-$(CONFIG_SH_DSP) := sh !! 17 CPPFLAGS += -Iarch/$(ARCH) 22 isa-$(CONFIG_CPU_SH2) := sh2 !! 18 AFLAGS += -Iarch/$(ARCH) 23 isa-$(CONFIG_CPU_SH2A) := sh2 !! 19 cflags-y += -Iarch/$(ARCH) -msoft-float -pipe \ 24 isa-$(CONFIG_CPU_SH3) := sh3 !! 20 -ffixed-r2 -Wno-uninitialized -mmultiple -mstring 25 isa-$(CONFIG_CPU_SH4) := sh4 !! 21 CPP = $(CC) -E $(CFLAGS) 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 22 44 ifeq ($(cflags-y),) !! 23 cflags-$(CONFIG_4xx) += -Wa,-m405 45 # !! 24 cflags-$(CONFIG_PPC64BRIDGE) += -Wa,-mppc64bridge 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 # << 54 cflags-y += $(shell $(CC) $(KBUILD_CFLA << 55 grep nofpu | sed q | sed << 56 # At this point, anything goes. << 57 isaflags-y := $(call as-option,-Wa$(comma << 58 else << 59 # << 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 25 69 isaflags-$(CONFIG_SH_DSP) := \ !! 26 CFLAGS += $(cflags-y) 70 $(call as-option,-Wa$(comma)-isa=$(isa << 71 endif << 72 27 73 cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb << 74 cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml << 75 28 76 cflags-y += $(call cc-option,-mno-fdpic !! 29 head-y := arch/ppc/kernel/head.o 77 cflags-y += $(isaflags-y) -ffreestandin !! 30 head-$(CONFIG_8xx) := arch/ppc/kernel/head_8xx.o >> 31 head-$(CONFIG_4xx) := arch/ppc/kernel/head_4xx.o >> 32 head-$(CONFIG_44x) := arch/ppc/kernel/head_44x.o 78 33 79 OBJCOPYFLAGS := -O binary -R .note -R .note !! 34 head-$(CONFIG_6xx) += arch/ppc/kernel/idle_6xx.o 80 -R .stab -R .stabstr -S !! 35 head-$(CONFIG_POWER4) += arch/ppc/kernel/idle_power4.o 81 36 82 # Give the various platforms the opportunity t !! 37 core-y += arch/ppc/kernel/ arch/ppc/platforms/ \ 83 defaultimage-y !! 38 arch/ppc/mm/ arch/ppc/lib/ arch/ppc/syslib/ 84 defaultimage-$(CONFIG_SH_SH7785LCR) !! 39 core-$(CONFIG_4xx) += arch/ppc/platforms/4xx/ 85 defaultimage-$(CONFIG_SH_RSK) !! 40 core-$(CONFIG_MATH_EMULATION) += arch/ppc/math-emu/ 86 defaultimage-$(CONFIG_SH_URQUELL) !! 41 core-$(CONFIG_XMON) += arch/ppc/xmon/ 87 defaultimage-$(CONFIG_SH_MIGOR) !! 42 core-$(CONFIG_APUS) += arch/ppc/amiga/ 88 defaultimage-$(CONFIG_SH_AP325RXA) !! 43 drivers-$(CONFIG_8xx) += arch/ppc/8xx_io/ 89 defaultimage-$(CONFIG_SH_SH7757LCR) !! 44 drivers-$(CONFIG_4xx) += arch/ppc/4xx_io/ 90 defaultimage-$(CONFIG_SH_7724_SOLUTION_ENGINE) !! 45 drivers-$(CONFIG_8260) += arch/ppc/8260_io/ 91 defaultimage-$(CONFIG_SH_7206_SOLUTION_ENGINE) !! 46 drivers-$(CONFIG_OCP) += arch/ppc/ocp/ 92 defaultimage-$(CONFIG_SH_7619_SOLUTION_ENGINE) << 93 << 94 # Set some sensible Kbuild defaults << 95 boot := arch/sh/boot << 96 KBUILD_IMAGE := $(boot)/$(defaultim << 97 47 98 # !! 48 BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm 99 # Choosing incompatible machines durings confi << 100 # error messages during linking. << 101 # << 102 UTS_MACHINE := sh << 103 LDFLAGS_vmlinux += -e _stext << 104 49 105 ifdef CONFIG_CPU_LITTLE_ENDIAN !! 50 .PHONY: $(BOOT_TARGETS) 106 ld-bfd := elf32-sh-linux << 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 51 115 export ld-bfd !! 52 all: zImage 116 53 117 # Mach groups !! 54 AFLAGS_vmlinux.lds.o := -Upowerpc 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 55 129 # !! 56 # All the instructions talk about "make bzImage". 130 # CPU header paths !! 57 bzImage: zImage 131 # << 132 # These are ordered by optimization level. A C << 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 58 152 ifeq ($(CONFIG_MCOUNT),y) !! 59 boot := arch/$(ARCH)/boot 153 KBUILD_CFLAGS += -pg << 154 endif << 155 60 156 ifeq ($(CONFIG_DWARF_UNWINDER),y) !! 61 $(BOOT_TARGETS): vmlinux 157 KBUILD_CFLAGS += -fasynchronous-unwind-table !! 62 $(Q)$(MAKE) $(build)=$(boot) $@ 158 endif << 159 63 160 libs-y := arch/sh/lib/ $(libs !! 64 uImage: vmlinux >> 65 $(Q)$(MAKE) $(build)=$(boot)/images $(boot)/images/$@ 161 66 162 BOOT_TARGETS = uImage uImage.bz2 uImage.gz uIm !! 67 define archhelp 163 uImage.srec uImage.bin zImage v !! 68 @echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/images/zImage.*)' 164 romImage !! 69 @echo ' uImage - Create a bootable image for U-Boot / PPCBoot' 165 PHONY += $(BOOT_TARGETS) !! 70 @echo ' install - Install kernel using' >> 71 @echo ' (your) ~/bin/installkernel or' >> 72 @echo ' (distribution) /sbin/installkernel or' >> 73 @echo ' install to $$(INSTALL_PATH) and run lilo' >> 74 @echo ' *_defconfig - Select default config from arch/$(ARCH)/ppc/configs' >> 75 endef 166 76 167 all: $(notdir $(KBUILD_IMAGE)) !! 77 archclean: >> 78 $(Q)$(MAKE) $(clean)=arch/ppc/boot 168 79 169 $(BOOT_TARGETS): vmlinux !! 80 prepare: include/asm-$(ARCH)/offsets.h checkbin 170 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$ << 171 81 172 compressed: zImage !! 82 arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ >> 83 include/config/MARKER 173 84 174 archprepare: !! 85 include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s 175 $(Q)$(MAKE) $(build)=arch/sh/tools inc !! 86 $(call filechk,gen-asm-offsets) 176 87 177 archheaders: !! 88 ifdef CONFIG_6xx 178 $(Q)$(MAKE) $(build)=arch/sh/kernel/sy !! 89 # Ensure this is binutils 2.12.1 (or 2.12.90.0.7) or later >> 90 NEW_AS := $(shell echo dssall | $(AS) -o /dev/null >/dev/null 2>&1 ; echo $$?) >> 91 GOODVER := 2.12.1 >> 92 else >> 93 NEW_AS := 0 >> 94 endif 179 95 180 define archhelp !! 96 ifneq ($(NEW_AS),0) 181 @echo ' zImage - C !! 97 checkbin: 182 @echo ' romImage - C !! 98 @echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build' 183 @echo ' vmlinux.srec - C !! 99 @echo 'correctly with old versions of binutils.' 184 @echo ' vmlinux.bin - C !! 100 @echo '*** Please upgrade your binutils to ${GOODVER} or newer' 185 @echo '* uImage - A !! 101 @false 186 @echo ' uImage.srec - C !! 102 else 187 @echo ' uImage.bin - K !! 103 checkbin: 188 @echo '* uImage.gz - K !! 104 @true 189 @echo ' uImage.bz2 - K !! 105 endif 190 @echo ' uImage.lzma - K !! 106 191 @echo ' uImage.xz - K !! 107 CLEAN_FILES += include/asm-$(ARCH)/offsets.h \ 192 @echo ' uImage.lzo - K !! 108 arch/$(ARCH)/kernel/asm-offsets.s 193 endef <<
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.