1 # 1 # 2 # alpha/Makefile 2 # alpha/Makefile 3 # 3 # 4 # This file is subject to the terms and condit 4 # This file is subject to the terms and conditions of the GNU General Public 5 # License. See the file "COPYING" in the main 5 # License. See the file "COPYING" in the main directory of this archive 6 # for more details. 6 # for more details. 7 # 7 # 8 # Copyright (C) 1994 by Linus Torvalds 8 # Copyright (C) 1994 by Linus Torvalds 9 # 9 # 10 10 11 NM := $(NM) -B 11 NM := $(NM) -B 12 12 13 LDFLAGS_vmlinux := -static -N #-relax !! 13 LINKFLAGS = -static -T arch/alpha/vmlinux.lds -N #-relax 14 CHECKFLAGS += -D__alpha__ !! 14 CFLAGS := $(CFLAGS) -pipe -mno-fp-regs -ffixed-8 15 cflags-y := -pipe -mno-fp-regs -ffixed- << 16 cflags-y += $(call cc-option, -fno-jump << 17 << 18 cpuflags-$(CONFIG_ALPHA_EV56) := -mc << 19 cpuflags-$(CONFIG_ALPHA_POLARIS) := -mc << 20 cpuflags-$(CONFIG_ALPHA_SX164) := -mc << 21 cpuflags-$(CONFIG_ALPHA_EV6) := -mc << 22 cpuflags-$(CONFIG_ALPHA_EV67) := -mc << 23 # If GENERIC, make sure to turn off any instru << 24 # the host compiler might have on by default. << 25 cpuflags-$(CONFIG_ALPHA_GENERIC) := -mc << 26 15 27 cflags-y += $(c !! 16 # Determine if we can use the BWX instructions with GAS. >> 17 old_gas := $(shell if $(AS) --version 2>&1 | grep 'version 2.7' > /dev/null; then echo y; else echo n; fi) 28 18 >> 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 29 76 30 # For TSUNAMI, we must have the assembler not 77 # For TSUNAMI, we must have the assembler not emulate our instructions. 31 # The same is true for IRONGATE, POLARIS, PYXI 78 # The same is true for IRONGATE, POLARIS, PYXIS. 32 # BWX is most important, but we don't really w 79 # BWX is most important, but we don't really want any emulation ever. 33 KBUILD_CFLAGS += $(cflags-y) -Wa,-mev6 << 34 80 35 libs-y += arch/alpha/ !! 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 >> 96 >> 97 LIBS := $(TOPDIR)/arch/alpha/lib/lib.a $(LIBS) $(TOPDIR)/arch/alpha/lib/lib.a >> 98 >> 99 MAKEBOOT = $(MAKE) -C arch/alpha/boot >> 100 >> 101 rawboot: >> 102 @$(MAKEBOOT) rawboot >> 103 >> 104 # >> 105 # My boot writes directly to a specific disk partition, I doubt most >> 106 # people will want to do that without changes.. >> 107 # >> 108 msb my-special-boot: >> 109 @$(MAKEBOOT) msb >> 110 >> 111 bootimage: >> 112 @$(MAKEBOOT) bootimage >> 113 >> 114 srmboot: >> 115 @$(MAKEBOOT) srmboot 36 116 37 # export what is needed by arch/alpha/boot/Mak !! 117 archclean: 38 LIBS_Y := $(patsubst %/, %/lib.a, $(libs-y)) !! 118 @$(MAKE) -C arch/alpha/kernel clean 39 export LIBS_Y !! 119 @$(MAKEBOOT) clean >> 120 rm -f arch/alpha/vmlinux.lds 40 121 41 boot := arch/alpha/boot !! 122 archmrproper: 42 123 43 #Default target when executing make with no ar !! 124 archdep: 44 all boot: $(boot)/vmlinux.gz !! 125 @$(MAKEBOOT) dep 45 126 46 $(boot)/vmlinux.gz: vmlinux !! 127 vmlinux: arch/alpha/vmlinux.lds 47 $(Q)$(MAKE) $(build)=$(boot) $@ << 48 128 49 bootimage bootpfile bootpzfile: vmlinux !! 129 arch/alpha/vmlinux.lds: arch/alpha/vmlinux.lds.in 50 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$ !! 130 $(CPP) $(CPPFLAGS) -xc -P arch/alpha/vmlinux.lds.in -o arch/alpha/vmlinux.lds 51 131 52 archheaders: !! 132 bootpfile: 53 $(Q)$(MAKE) $(build)=arch/alpha/kernel !! 133 @$(MAKEBOOT) bootpfile 54 134 55 define archhelp !! 135 bootpzfile: 56 echo '* boot - Compressed kernel im !! 136 @$(MAKEBOOT) bootpzfile 57 echo ' bootimage - SRM bootable image ( << 58 echo ' bootpfile - BOOTP bootable image << 59 echo ' bootpzfile - compressed kernel BO << 60 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.