1 # BK Id: %F% %I% %G% %U% %#% << 2 # 1 # 3 # This file is included by the global makefile !! 2 # alpha/Makefile 4 # architecture-specific flags and dependencies << 5 # 3 # 6 # This file is subject to the terms and condit 4 # This file is subject to the terms and conditions of the GNU General Public 7 # License. See the file "COPYING" in the main 5 # License. See the file "COPYING" in the main directory of this archive 8 # for more details. 6 # for more details. 9 # 7 # 10 # Copyright (C) 1994 by Linus Torvalds 8 # Copyright (C) 1994 by Linus Torvalds 11 # Modifications for the OpenRISC architecture: << 12 # Copyright (C) 2003 Matjaz Breskvar <phoenix@b << 13 # Copyright (C) 2010-2011 Jonas Bonn <jonas@sou << 14 # 9 # 15 # Based on: << 16 # arch/i386/Makefile << 17 10 18 KBUILD_DEFCONFIG := or1ksim_defconfig !! 11 NM := $(NM) -B 19 12 20 OBJCOPYFLAGS := -O binary -R .note -R .comm !! 13 LINKFLAGS = -static -T arch/alpha/vmlinux.lds -N #-relax 21 LIBGCC := $(shell $(CC) $(KBUILD_CFLA !! 14 CFLAGS := $(CFLAGS) -pipe -mno-fp-regs -ffixed-8 22 15 23 KBUILD_CFLAGS += -pipe -ffixed-r10 -D__linux !! 16 # Determine if we can use the BWX instructions with GAS. 24 KBUILD_CFLAGS += -msfimm -mshftimm !! 17 old_gas := $(shell if $(AS) --version 2>&1 | grep 'version 2.7' > /dev/null; then echo y; else echo n; fi) 25 18 26 all: vmlinux.bin !! 19 # Determine if GCC understands the -mcpu= option. >> 20 have_mcpu := $(shell if $(CC) -mcpu=ev5 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi) >> 21 >> 22 have_mcpu_pca56 := $(shell if $(CC) -mcpu=pca56 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi) >> 23 >> 24 have_mcpu_ev6 := $(shell if $(CC) -mcpu=ev6 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi) >> 25 >> 26 have_mcpu_ev67 := $(shell if $(CC) -mcpu=ev67 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi) >> 27 >> 28 # Turn on the proper cpu optimizations. >> 29 ifeq ($(have_mcpu),y) >> 30 # If GENERIC, make sure to turn off any instruction set extensions that >> 31 # the host compiler might have on by default. Given that EV4 and EV5 >> 32 # have the same instruction set, prefer EV5 because an EV5 schedule is >> 33 # more likely to keep an EV4 processor busy than vice-versa. >> 34 mcpu_done := n >> 35 ifeq ($(CONFIG_ALPHA_GENERIC),y) >> 36 CFLAGS := $(CFLAGS) -mcpu=ev5 >> 37 mcpu_done := y >> 38 endif >> 39 ifeq ($(mcpu_done)$(CONFIG_ALPHA_SX164)$(have_mcpu_pca56),nyy) >> 40 CFLAGS := $(CFLAGS) -mcpu=pca56 >> 41 mcpu_done := y >> 42 endif >> 43 ifeq ($(mcpu_done)$(CONFIG_ALPHA_POLARIS)$(have_mcpu_pca56),nyy) >> 44 CFLAGS := $(CFLAGS) -mcpu=pca56 >> 45 mcpu_done := y >> 46 endif >> 47 ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV4),ny) >> 48 CFLAGS := $(CFLAGS) -mcpu=ev4 >> 49 mcpu_done := y >> 50 endif >> 51 ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV56),ny) >> 52 CFLAGS := $(CFLAGS) -mcpu=ev56 >> 53 mcpu_done := y >> 54 endif >> 55 ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV5),ny) >> 56 CFLAGS := $(CFLAGS) -mcpu=ev5 >> 57 mcpu_done := y >> 58 endif >> 59 ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV67)$(have_mcpu_ev67),nyy) >> 60 CFLAGS := $(CFLAGS) -mcpu=ev67 >> 61 mcpu_done := y >> 62 endif >> 63 ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV6),ny) >> 64 ifeq ($(have_mcpu_ev6),y) >> 65 CFLAGS := $(CFLAGS) -mcpu=ev6 >> 66 else >> 67 ifeq ($(have_mcpu_pca56),y) >> 68 CFLAGS := $(CFLAGS) -mcpu=pca56 >> 69 else >> 70 CFLAGS := $(CFLAGS) -mcpu=ev56 >> 71 endif >> 72 endif >> 73 mcpu_done := y >> 74 endif >> 75 endif >> 76 >> 77 # For TSUNAMI, we must have the assembler not emulate our instructions. >> 78 # The same is true for IRONGATE, POLARIS, PYXIS. >> 79 # BWX is most important, but we don't really want any emulation ever. >> 80 >> 81 ifeq ($(old_gas),y) >> 82 # How do we do #error in make? >> 83 CFLAGS := --error-please-upgrade-your-assembler >> 84 endif >> 85 CFLAGS := $(CFLAGS) -Wa,-mev6 >> 86 >> 87 HEAD := arch/alpha/kernel/head.o >> 88 >> 89 SUBDIRS := $(SUBDIRS) arch/alpha/kernel arch/alpha/mm arch/alpha/lib \ >> 90 arch/alpha/math-emu >> 91 CORE_FILES := arch/alpha/kernel/kernel.o arch/alpha/mm/mm.o $(CORE_FILES) >> 92 >> 93 ifeq ($(CONFIG_MATHEMU),y) >> 94 CORE_FILES := $(CORE_FILES) arch/alpha/math-emu/math-emu.o >> 95 endif 27 96 28 boot := arch/$(ARCH)/boot !! 97 LIBS := $(TOPDIR)/arch/alpha/lib/lib.a $(LIBS) $(TOPDIR)/arch/alpha/lib/lib.a 29 98 30 ifeq ($(CONFIG_OPENRISC_HAVE_INST_MUL),y) !! 99 MAKEBOOT = $(MAKE) -C arch/alpha/boot 31 KBUILD_CFLAGS += $(call cc-option,-mha << 32 else << 33 KBUILD_CFLAGS += $(call cc-option,-mso << 34 endif << 35 100 36 ifeq ($(CONFIG_OPENRISC_HAVE_INST_DIV),y) !! 101 rawboot: 37 KBUILD_CFLAGS += $(call cc-option,-mha !! 102 @$(MAKEBOOT) rawboot 38 else << 39 KBUILD_CFLAGS += $(call cc-option,-mso << 40 endif << 41 103 42 ifeq ($(CONFIG_OPENRISC_HAVE_INST_CMOV),y) !! 104 # 43 KBUILD_CFLAGS += $(call cc-option,-mcm !! 105 # My boot writes directly to a specific disk partition, I doubt most 44 endif !! 106 # people will want to do that without changes.. >> 107 # >> 108 msb my-special-boot: >> 109 @$(MAKEBOOT) msb 45 110 46 ifeq ($(CONFIG_OPENRISC_HAVE_INST_ROR),y) !! 111 bootimage: 47 KBUILD_CFLAGS += $(call cc-option,-mro !! 112 @$(MAKEBOOT) bootimage 48 endif << 49 113 50 ifeq ($(CONFIG_OPENRISC_HAVE_INST_RORI),y) !! 114 srmboot: 51 KBUILD_CFLAGS += $(call cc-option,-mro !! 115 @$(MAKEBOOT) srmboot 52 endif << 53 116 54 ifeq ($(CONFIG_OPENRISC_HAVE_INST_SEXT),y) !! 117 archclean: 55 KBUILD_CFLAGS += $(call cc-option,-mse !! 118 @$(MAKE) -C arch/alpha/kernel clean 56 endif !! 119 @$(MAKEBOOT) clean >> 120 rm -f arch/alpha/vmlinux.lds >> 121 >> 122 archmrproper: >> 123 >> 124 archdep: >> 125 @$(MAKEBOOT) dep >> 126 >> 127 vmlinux: arch/alpha/vmlinux.lds 57 128 58 libs-y += $(LIBGCC) !! 129 arch/alpha/vmlinux.lds: arch/alpha/vmlinux.lds.in >> 130 $(CPP) $(CPPFLAGS) -xc -P arch/alpha/vmlinux.lds.in -o arch/alpha/vmlinux.lds 59 131 60 PHONY += vmlinux.bin !! 132 bootpfile: >> 133 @$(MAKEBOOT) bootpfile 61 134 62 vmlinux.bin: vmlinux !! 135 bootpzfile: 63 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$ !! 136 @$(MAKEBOOT) bootpzfile
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.