kbuild: Fix up initramfs, adapt arch/alpha
[linux-flexiantxendom0-3.2.10.git] / arch / alpha / Makefile
1 #
2 # alpha/Makefile
3 #
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
6 # for more details.
7 #
8 # Copyright (C) 1994 by Linus Torvalds
9 #
10
11 NM := $(NM) -B
12
13 LDFLAGS_vmlinux = -static -N #-relax
14 CFLAGS := $(CFLAGS) -pipe -mno-fp-regs -ffixed-8
15 LDFLAGS_BLOB := --format binary --oformat elf64-alpha
16
17 # Determine if we can use the BWX instructions with GAS.
18 old_gas := $(shell if $(AS) --version 2>&1 | grep 'version 2.7' > /dev/null; then echo y; else echo n; fi)
19
20 # Determine if GCC understands the -mcpu= option.
21 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
23 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
25 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
27 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
29 have_msmall_data := $(shell if $(CC) -msmall-data -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi)
30 ifeq ($(have_msmall_data),y)
31   CFLAGS := $(CFLAGS) -msmall-data
32 endif
33
34 # Turn on the proper cpu optimizations.
35 ifeq ($(have_mcpu),y)
36   # If GENERIC, make sure to turn off any instruction set extensions that
37   # the host compiler might have on by default.  Given that EV4 and EV5
38   # have the same instruction set, prefer EV5 because an EV5 schedule is
39   # more likely to keep an EV4 processor busy than vice-versa.
40   mcpu_done := n
41   ifeq ($(CONFIG_ALPHA_GENERIC),y)
42     CFLAGS := $(CFLAGS) -mcpu=ev5
43     mcpu_done := y
44   endif
45   ifeq ($(mcpu_done)$(CONFIG_ALPHA_SX164)$(have_mcpu_pca56),nyy)
46     CFLAGS := $(CFLAGS) -mcpu=pca56
47     mcpu_done := y
48   endif
49   ifeq ($(mcpu_done)$(CONFIG_ALPHA_POLARIS)$(have_mcpu_pca56),nyy)
50     CFLAGS := $(CFLAGS) -mcpu=pca56
51     mcpu_done := y
52   endif
53   ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV4),ny)
54     CFLAGS := $(CFLAGS) -mcpu=ev4
55     mcpu_done := y
56   endif
57   ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV56),ny)
58     CFLAGS := $(CFLAGS) -mcpu=ev56
59     mcpu_done := y
60   endif
61   ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV5),ny)
62     CFLAGS := $(CFLAGS) -mcpu=ev5
63     mcpu_done := y
64   endif
65   ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV67)$(have_mcpu_ev67),nyy)
66     CFLAGS := $(CFLAGS) -mcpu=ev67
67     mcpu_done := y
68   endif
69   ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV6),ny)
70     ifeq ($(have_mcpu_ev6),y)
71       CFLAGS := $(CFLAGS) -mcpu=ev6
72     else
73       ifeq ($(have_mcpu_pca56),y)
74         CFLAGS := $(CFLAGS) -mcpu=pca56
75       else
76         CFLAGS := $(CFLAGS) -mcpu=ev56
77       endif
78     endif
79     mcpu_done := y
80   endif
81 endif
82
83 # For TSUNAMI, we must have the assembler not emulate our instructions.
84 # The same is true for IRONGATE, POLARIS, PYXIS.
85 # BWX is most important, but we don't really want any emulation ever.
86
87 ifeq ($(old_gas),y)
88   # How do we do #error in make?
89   CFLAGS := --error-please-upgrade-your-assembler
90 endif
91 CFLAGS := $(CFLAGS) -Wa,-mev6
92
93 HEAD := arch/alpha/kernel/head.o
94
95 core-y                  += arch/alpha/kernel/ arch/alpha/mm/
96 core-$(CONFIG_MATHEMU)  += arch/alpha/math-emu/
97 libs-y                  += arch/alpha/lib/
98
99 export libs-y
100
101 MAKEBOOT = $(MAKE) -C arch/alpha/boot
102
103 rawboot:        vmlinux
104         @$(MAKEBOOT) rawboot
105
106 boot:   vmlinux
107         @$(MAKEBOOT)
108
109 #
110 # My boot writes directly to a specific disk partition, I doubt most
111 # people will want to do that without changes..
112 #
113 msb my-special-boot:    vmlinux
114         @$(MAKEBOOT) msb
115
116 bootimage:      vmlinux
117         @$(MAKEBOOT) bootimage
118
119 srmboot:        vmlinux
120         @$(MAKEBOOT) srmboot
121
122 archclean:
123         @$(MAKEBOOT) clean
124
125 archmrproper:
126         rm -f include/asm-alpha/asm_offsets.h
127
128 bootpfile:      vmlinux
129         @$(MAKEBOOT) bootpfile
130
131
132 prepare: include/asm-$(ARCH)/asm_offsets.h
133
134 arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
135                                    include/config/MARKER
136
137 include/asm-$(ARCH)/asm_offsets.h.tmp: arch/$(ARCH)/kernel/asm-offsets.s
138         @$(generate-asm-offsets.h) < $< > $@
139
140 include/asm-$(ARCH)/asm_offsets.h: include/asm-$(ARCH)/asm_offsets.h.tmp
141         @echo -n '  Generating $@'
142         @$(update-if-changed)
143
144 CLEAN_FILES += include/asm-$(ARCH)/offset.h.tmp \
145                include/asm-$(ARCH)/offset.h