4 # This file is subject to the terms and conditions of the GNU General Public
5 # License. See the file "COPYING" in the main directory of this archive
8 # Copyright (C) 1994 by Linus Torvalds
13 LINKFLAGS = -static -T arch/alpha/vmlinux.lds -N #-relax
14 CFLAGS := $(CFLAGS) -pipe -mno-fp-regs -ffixed-8
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)
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)
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)
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)
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)
28 # Turn on the proper cpu optimizations.
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.
35 ifeq ($(CONFIG_ALPHA_GENERIC),y)
36 CFLAGS := $(CFLAGS) -mcpu=ev5
39 ifeq ($(mcpu_done)$(CONFIG_ALPHA_SX164)$(have_mcpu_pca56),nyy)
40 CFLAGS := $(CFLAGS) -mcpu=pca56
43 ifeq ($(mcpu_done)$(CONFIG_ALPHA_POLARIS)$(have_mcpu_pca56),nyy)
44 CFLAGS := $(CFLAGS) -mcpu=pca56
47 ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV4),ny)
48 CFLAGS := $(CFLAGS) -mcpu=ev4
51 ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV56),ny)
52 CFLAGS := $(CFLAGS) -mcpu=ev56
55 ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV5),ny)
56 CFLAGS := $(CFLAGS) -mcpu=ev5
59 ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV67)$(have_mcpu_ev67),nyy)
60 CFLAGS := $(CFLAGS) -mcpu=ev67
63 ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV6),ny)
64 ifeq ($(have_mcpu_ev6),y)
65 CFLAGS := $(CFLAGS) -mcpu=ev6
67 ifeq ($(have_mcpu_pca56),y)
68 CFLAGS := $(CFLAGS) -mcpu=pca56
70 CFLAGS := $(CFLAGS) -mcpu=ev56
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.
82 # How do we do #error in make?
83 CFLAGS := --error-please-upgrade-your-assembler
85 CFLAGS := $(CFLAGS) -Wa,-mev6
87 HEAD := arch/alpha/kernel/head.o
89 SUBDIRS := $(SUBDIRS) arch/alpha/kernel arch/alpha/mm arch/alpha/lib \
91 CORE_FILES := arch/alpha/kernel/kernel.o arch/alpha/mm/mm.o $(CORE_FILES)
93 ifeq ($(CONFIG_MATHEMU),y)
94 CORE_FILES := $(CORE_FILES) arch/alpha/math-emu/math-emu.o
97 LIBS := $(TOPDIR)/arch/alpha/lib/lib.a $(LIBS) $(TOPDIR)/arch/alpha/lib/lib.a
99 MAKEBOOT = $(MAKE) -C arch/alpha/boot
105 # My boot writes directly to a specific disk partition, I doubt most
106 # people will want to do that without changes..
112 @$(MAKEBOOT) bootimage
118 @$(MAKE) -C arch/alpha/kernel clean
120 rm -f arch/alpha/vmlinux.lds
127 vmlinux: arch/alpha/vmlinux.lds
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
133 @$(MAKEBOOT) bootpfile
136 @$(MAKEBOOT) bootpzfile