1 # 1 # 2 # arch/sh/Makefile !! 2 # This file is included by the global makefile so that you can add your own 3 # !! 3 # architecture-specific flags and dependencies. Remember to do have actions 4 # Copyright (C) 1999 Kaz Kojima !! 4 # for "archclean" and "archdep" for cleaning up and making dependencies for 5 # Copyright (C) 2002 - 2008 Paul Mundt !! 5 # this architecture 6 # Copyright (C) 2002 M. R. Brown << 7 # 6 # 8 # This file is subject to the terms and condit 7 # This file is subject to the terms and conditions of the GNU General Public 9 # License. See the file "COPYING" in the main 8 # License. See the file "COPYING" in the main directory of this archive 10 # for more details. 9 # for more details. 11 # 10 # 12 ifdef cross_compiling !! 11 # Copyright (C) 1994 by Linus Torvalds 13 ifeq ($(CROSS_COMPILE),) !! 12 # Changes for PPC by Gary Thomas 14 CROSS_COMPILE := $(call cc-cross-prefix, s !! 13 # Rewritten by Cort Dougan and Paul Mackerras 15 endif !! 14 # 16 endif !! 15 17 !! 16 # Be sure to change PAGE_OFFSET in include/asm-ppc/page.h to match 18 KBUILD_DEFCONFIG := shx3_defconfig !! 17 KERNELLOAD =$(CONFIG_KERNEL_START) 19 !! 18 20 isa-y := any !! 19 LINKFLAGS = -T arch/ppc/vmlinux.lds -Ttext $(KERNELLOAD) -Bstatic 21 isa-$(CONFIG_SH_DSP) := sh !! 20 CPPFLAGS := $(CPPFLAGS) -I$(TOPDIR)/arch/$(ARCH) 22 isa-$(CONFIG_CPU_SH2) := sh2 !! 21 AFLAGS := $(AFLAGS) -I$(TOPDIR)/arch/$(ARCH) 23 isa-$(CONFIG_CPU_SH2A) := sh2 !! 22 CFLAGS := $(CFLAGS) -I$(TOPDIR)/arch/$(ARCH) -fsigned-char \ 24 isa-$(CONFIG_CPU_SH3) := sh3 !! 23 -msoft-float -pipe -ffixed-r2 -Wno-uninitialized \ 25 isa-$(CONFIG_CPU_SH4) := sh4 !! 24 -mmultiple -mstring 26 isa-$(CONFIG_CPU_SH4A) := sh4 !! 25 HOSTCFLAGS += -I$(TOPDIR)/arch/$(ARCH) 27 isa-$(CONFIG_CPU_SH4AL_DSP) := sh4 !! 26 CPP = $(CC) -E $(CFLAGS) 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 # << 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 27 69 isaflags-$(CONFIG_SH_DSP) := \ !! 28 ifdef CONFIG_4xx 70 $(call as-option,-Wa$(comma)-isa=$(isa !! 29 CFLAGS := $(CFLAGS) -Wa,-m405 71 endif 30 endif 72 31 73 cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb !! 32 ifdef CONFIG_8xx 74 cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml !! 33 CFLAGS := $(CFLAGS) -mcpu=860 >> 34 endif 75 35 76 cflags-y += $(call cc-option,-mno-fdpic !! 36 ifdef CONFIG_PPC64BRIDGE 77 cflags-y += $(isaflags-y) -ffreestandin !! 37 CFLAGS := $(CFLAGS) -Wa,-mppc64bridge 78 !! 38 endif 79 OBJCOPYFLAGS := -O binary -R .note -R .note << 80 -R .stab -R .stabstr -S << 81 << 82 # Give the various platforms the opportunity t << 83 defaultimage-y << 84 defaultimage-$(CONFIG_SH_SH7785LCR) << 85 defaultimage-$(CONFIG_SH_RSK) << 86 defaultimage-$(CONFIG_SH_URQUELL) << 87 defaultimage-$(CONFIG_SH_MIGOR) << 88 defaultimage-$(CONFIG_SH_AP325RXA) << 89 defaultimage-$(CONFIG_SH_SH7757LCR) << 90 defaultimage-$(CONFIG_SH_7724_SOLUTION_ENGINE) << 91 defaultimage-$(CONFIG_SH_7206_SOLUTION_ENGINE) << 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 39 98 # !! 40 ifdef CONFIG_MORE_COMPILE_OPTIONS 99 # Choosing incompatible machines durings confi !! 41 # Use sed to remove the quotes. 100 # error messages during linking. !! 42 CFLAGS += $(shell echo $(CONFIG_COMPILE_OPTIONS) | sed -e 's/"//g') 101 # !! 43 endif 102 UTS_MACHINE := sh << 103 LDFLAGS_vmlinux += -e _stext << 104 44 105 ifdef CONFIG_CPU_LITTLE_ENDIAN !! 45 HEAD-y := arch/ppc/kernel/head.o 106 ld-bfd := elf32-sh-linux !! 46 HEAD-$(CONFIG_40x) := arch/ppc/kernel/head_4xx.o 107 LDFLAGS_vmlinux += --defsym jiffies=ji !! 47 HEAD-$(CONFIG_44x) := arch/ppc/kernel/head_44x.o 108 KBUILD_LDFLAGS += -EL !! 48 HEAD-$(CONFIG_8xx) := arch/ppc/kernel/head_8xx.o 109 else !! 49 HEAD-$(CONFIG_6xx) += arch/ppc/kernel/idle_6xx.o 110 ld-bfd := elf32-shbig-linux !! 50 111 LDFLAGS_vmlinux += --defsym jiffies=ji !! 51 HEAD := $(HEAD-y) 112 KBUILD_LDFLAGS += -EB !! 52 113 endif !! 53 ARCH_SUBDIRS = arch/ppc/kernel arch/ppc/platforms arch/ppc/mm arch/ppc/lib 114 !! 54 SUBDIRS := $(SUBDIRS) $(ARCH_SUBDIRS) 115 export ld-bfd !! 55 CORE_FILES := arch/ppc/kernel/kernel.o arch/ppc/platforms/platform.o \ 116 !! 56 arch/ppc/mm/mm.o arch/ppc/lib/lib.o $(CORE_FILES) 117 # Mach groups !! 57 118 machdir-$(CONFIG_SOLUTION_ENGINE) !! 58 ifdef CONFIG_MATH_EMULATION 119 machdir-$(CONFIG_SH_DREAMCAST) !! 59 SUBDIRS += arch/ppc/math-emu 120 machdir-$(CONFIG_SH_SH03) !! 60 CORE_FILES += arch/ppc/math-emu/math-emu.o 121 machdir-$(CONFIG_SH_MIGOR) !! 61 endif 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 62 129 # !! 63 ifdef CONFIG_XMON 130 # CPU header paths !! 64 SUBDIRS += arch/ppc/xmon 131 # !! 65 CORE_FILES += arch/ppc/xmon/x.o 132 # These are ordered by optimization level. A C !! 66 endif 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 67 146 drivers-y += arch/sh/dri !! 68 MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot 147 69 148 KBUILD_CPPFLAGS += $(addprefix -I $(sr !! 70 ifdef CONFIG_8xx 149 KBUILD_CFLAGS += -pipe $(cflags-y) !! 71 SUBDIRS += arch/ppc/8xx_io 150 KBUILD_AFLAGS += $(cflags-y) !! 72 DRIVERS += arch/ppc/8xx_io/8xx_io.o >> 73 endif 151 74 152 ifeq ($(CONFIG_MCOUNT),y) !! 75 ifdef CONFIG_CPM2 153 KBUILD_CFLAGS += -pg !! 76 SUBDIRS += arch/ppc/cpm2_io >> 77 DRIVERS += arch/ppc/cpm2_io/cpm2_io.o 154 endif 78 endif 155 79 156 ifeq ($(CONFIG_DWARF_UNWINDER),y) !! 80 ifdef CONFIG_APUS 157 KBUILD_CFLAGS += -fasynchronous-unwind-table !! 81 SUBDIRS += arch/ppc/amiga >> 82 CORE_FILES += arch/ppc/amiga/amiga.o 158 endif 83 endif 159 84 160 libs-y := arch/sh/lib/ $(libs !! 85 checks: >> 86 @$(MAKE) -C arch/$(ARCH)/kernel checks 161 87 162 BOOT_TARGETS = uImage uImage.bz2 uImage.gz uIm !! 88 BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd uImage 163 uImage.srec uImage.bin zImage v << 164 romImage << 165 PHONY += $(BOOT_TARGETS) << 166 89 167 all: $(notdir $(KBUILD_IMAGE)) !! 90 # All the instructions talk about "make bzImage". >> 91 bzImage: zImage 168 92 169 $(BOOT_TARGETS): vmlinux 93 $(BOOT_TARGETS): vmlinux 170 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$ !! 94 @$(MAKEBOOT) $@ >> 95 >> 96 %_config: arch/ppc/configs/%_defconfig >> 97 rm -f .config arch/ppc/defconfig >> 98 cp -f arch/ppc/configs/$(@:config=defconfig) arch/ppc/defconfig 171 99 172 compressed: zImage !! 100 archclean: >> 101 rm -f arch/ppc/kernel/{mk_defs,ppc_defs.h,find_name,checks} >> 102 @$(MAKEBOOT) clean 173 103 174 archprepare: !! 104 archmrproper: 175 $(Q)$(MAKE) $(build)=arch/sh/tools inc << 176 105 177 archheaders: !! 106 archdep: scripts/mkdep 178 $(Q)$(MAKE) $(build)=arch/sh/kernel/sy !! 107 $(MAKEBOOT) fastdep 179 << 180 define archhelp << 181 @echo ' zImage - C << 182 @echo ' romImage - C << 183 @echo ' vmlinux.srec - C << 184 @echo ' vmlinux.bin - C << 185 @echo '* uImage - A << 186 @echo ' uImage.srec - C << 187 @echo ' uImage.bin - K << 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 <<
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.