import of upstream 2.4.34.4 from kernel.org
[linux-2.4.git] / arch / ia64 / Makefile
1 #
2 # ia64/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) 1998-2001 by David Mosberger-Tang <davidm@hpl.hp.com>
9 #
10
11 NM := $(CROSS_COMPILE)nm -B
12 AWK := awk
13
14 export AWK
15
16 LINKFLAGS = -static -T arch/$(ARCH)/vmlinux.lds
17 AFLAGS_KERNEL := -mconstant-gp
18 EXTRA   =
19
20 CFLAGS := $(CFLAGS) -pipe $(EXTRA) -ffixed-r13 -mfixed-range=f12-f15,f32-f127 \
21           -falign-functions=32
22 # -ffunction-sections
23 CFLAGS_KERNEL := -mconstant-gp
24
25 GCC_VERSION=$(shell $(CC) -v 2>&1 | fgrep 'gcc version' | cut -f3 -d' ' | cut -f1 -d'.')
26
27 CHECK_GAS_FOR_HINT=arch/ia64/scripts/check_gas_for_hint.o
28 MAKE_GAS_HINT_TEST=arch/ia64/scripts/make_gas_hint_test
29
30 ifneq (, $(shell ls $(CHECK_GAS_FOR_HINT)))
31 $(shell rm $(CHECK_GAS_FOR_HINT))
32 endif
33
34 CHECK_GAS_CMD:=($(CC) $(MAKE_GAS_HINT_TEST).c -o $(MAKE_GAS_HINT_TEST) && $(MAKE_GAS_HINT_TEST) | $(CC) -c -o $(CHECK_GAS_FOR_HINT) -x assembler -; rm -f $(MAKE_GAS_HINT_TEST))>&/dev/null
35 $(shell $(CHECK_GAS_CMD))
36 ifneq (, $(shell ls $(CHECK_GAS_FOR_HINT)))
37 #Newer version of binutil is detected and "hint" instruction is in the kernel
38 $(warning Warning: Found binutils that supports hint instruction)
39 FLAGS := $(AFLAGS) -DGAS_HAS_HINT_INSN
40 CFLAGS := $(CFLAGS) -DGAS_HAS_HINT_INSN
41 else
42 $(warning Warning: Please use binutil version 2.14.90.0.4.1 or higher to get the support of hint instruction in kernel.) 
43 endif
44
45 ifneq ($(GCC_VERSION),2)
46         CFLAGS += -frename-registers --param max-inline-insns=5000
47 endif
48
49 ifeq ($(CONFIG_ITANIUM_BSTEP_SPECIFIC),y)
50         CFLAGS += -mb-step
51 endif
52
53 ifdef CONFIG_IA64_GENERIC
54         CORE_FILES      :=      arch/$(ARCH)/hp/hp.o                    \
55                                 arch/$(ARCH)/dig/dig.a                  \
56                                 $(CORE_FILES)
57         SUBDIRS         :=      arch/$(ARCH)/hp         \
58                                 arch/$(ARCH)/dig        \
59                                 $(SUBDIRS)
60
61 else # !GENERIC
62
63 ifdef CONFIG_IA64_HP_SIM
64         SUBDIRS         :=      arch/$(ARCH)/hp         \
65                                 arch/$(ARCH)/drivers    \
66                                 $(SUBDIRS)
67         CORE_FILES      :=      arch/$(ARCH)/hp/hp.o    \
68                                 $(CORE_FILES)
69         DRIVERS         +=      arch/$(ARCH)/drivers/drivers.o
70 endif
71
72 ifdef CONFIG_IA64_HP_ZX1
73         SUBDIRS         :=      arch/$(ARCH)/hp                         \
74                                 arch/$(ARCH)/dig                        \
75                                 $(SUBDIRS)
76         CORE_FILES      :=      arch/$(ARCH)/hp/hp.o                    \
77                                 arch/$(ARCH)/dig/dig.a                  \
78                                 $(CORE_FILES)
79 endif
80
81 ifdef CONFIG_IA64_SGI_SN
82         CFLAGS          += -DBRINGUP
83         SUBDIRS         :=      arch/$(ARCH)/sn/kernel  \
84                                 arch/$(ARCH)/sn/io      \
85                                 arch/$(ARCH)/sn/fakeprom        \
86                                 $(SUBDIRS)
87         CORE_FILES      :=      arch/$(ARCH)/sn/kernel/sn.o     \
88                                 arch/$(ARCH)/sn/io/sgiio.o      \
89                                 $(CORE_FILES)
90 endif
91
92 ifdef CONFIG_IA64_SOFTSDV
93         SUBDIRS         :=      arch/$(ARCH)/dig        \
94                                 $(SUBDIRS)
95         CORE_FILES      :=      arch/$(ARCH)/dig/dig.a  \
96                                 $(CORE_FILES)
97 endif
98
99 ifdef CONFIG_IA64_DIG
100         SUBDIRS         :=      arch/$(ARCH)/dig        \
101                                 $(SUBDIRS)
102         CORE_FILES      :=      arch/$(ARCH)/dig/dig.a  \
103                                 $(CORE_FILES)
104 endif
105
106 endif # !GENERIC
107
108 ifdef CONFIG_IA32_SUPPORT
109         SUBDIRS         :=      arch/$(ARCH)/ia32 $(SUBDIRS)
110         CORE_FILES      :=      arch/$(ARCH)/ia32/ia32.o $(CORE_FILES)
111 endif
112
113 HEAD := arch/$(ARCH)/kernel/head.o arch/ia64/kernel/init_task.o
114
115 SUBDIRS := arch/$(ARCH)/tools arch/$(ARCH)/kernel arch/$(ARCH)/mm arch/$(ARCH)/lib $(SUBDIRS)
116 CORE_FILES := arch/$(ARCH)/kernel/kernel.o arch/$(ARCH)/mm/mm.o $(CORE_FILES)
117
118 LIBS := $(TOPDIR)/arch/$(ARCH)/lib/lib.a $(LIBS) \
119         $(TOPDIR)/arch/$(ARCH)/lib/lib.a
120
121 MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
122
123 vmlinux: arch/$(ARCH)/vmlinux.lds
124
125 arch/$(ARCH)/vmlinux.lds: arch/$(ARCH)/vmlinux.lds.S FORCE
126         $(CPP) -D__ASSEMBLY__ -C -P -I$(HPATH) -I$(HPATH)/asm-$(ARCH) \
127                 -traditional arch/$(ARCH)/vmlinux.lds.S > $@
128
129 FORCE: ;
130
131 compressed: vmlinux
132         $(OBJCOPY) --strip-all vmlinux vmlinux-tmp
133         gzip vmlinux-tmp
134         mv vmlinux-tmp.gz vmlinux.gz
135
136 rawboot:
137         @$(MAKEBOOT) rawboot
138
139 #
140 # My boot writes directly to a specific disk partition, I doubt most
141 # people will want to do that without changes..
142 #
143 msb my-special-boot:
144         @$(MAKEBOOT) msb
145
146 bootimage:
147         @$(MAKEBOOT) bootimage
148
149 srmboot:
150         @$(MAKEBOOT) srmboot
151
152 archclean:
153         @$(MAKEBOOT) clean
154
155 check: vmlinux
156         arch/ia64/scripts/unwcheck.sh vmlinux
157
158 archmrproper:
159         rm -f arch/$(ARCH)/vmlinux.lds vmlinux-tmp vmlinux.gz
160         @$(MAKE) -C arch/$(ARCH)/tools mrproper
161
162 archdep:
163         @$(MAKEBOOT) dep
164
165 bootpfile:
166         @$(MAKEBOOT) bootpfile