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) 1998-2001 by David Mosberger-Tang <davidm@hpl.hp.com>
11 NM := $(CROSS_COMPILE)nm -B
16 LINKFLAGS = -static -T arch/$(ARCH)/vmlinux.lds
17 AFLAGS_KERNEL := -mconstant-gp
20 CFLAGS := $(CFLAGS) -pipe $(EXTRA) -ffixed-r13 -mfixed-range=f12-f15,f32-f127 \
23 CFLAGS_KERNEL := -mconstant-gp
25 GCC_VERSION=$(shell $(CC) -v 2>&1 | fgrep 'gcc version' | cut -f3 -d' ' | cut -f1 -d'.')
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
30 ifneq (, $(shell ls $(CHECK_GAS_FOR_HINT)))
31 $(shell rm $(CHECK_GAS_FOR_HINT))
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
42 $(warning Warning: Please use binutil version 2.14.90.0.4.1 or higher to get the support of hint instruction in kernel.)
45 ifneq ($(GCC_VERSION),2)
46 CFLAGS += -frename-registers --param max-inline-insns=5000
49 ifeq ($(CONFIG_ITANIUM_BSTEP_SPECIFIC),y)
53 ifdef CONFIG_IA64_GENERIC
54 CORE_FILES := arch/$(ARCH)/hp/hp.o \
55 arch/$(ARCH)/dig/dig.a \
57 SUBDIRS := arch/$(ARCH)/hp \
63 ifdef CONFIG_IA64_HP_SIM
64 SUBDIRS := arch/$(ARCH)/hp \
65 arch/$(ARCH)/drivers \
67 CORE_FILES := arch/$(ARCH)/hp/hp.o \
69 DRIVERS += arch/$(ARCH)/drivers/drivers.o
72 ifdef CONFIG_IA64_HP_ZX1
73 SUBDIRS := arch/$(ARCH)/hp \
76 CORE_FILES := arch/$(ARCH)/hp/hp.o \
77 arch/$(ARCH)/dig/dig.a \
81 ifdef CONFIG_IA64_SGI_SN
83 SUBDIRS := arch/$(ARCH)/sn/kernel \
85 arch/$(ARCH)/sn/fakeprom \
87 CORE_FILES := arch/$(ARCH)/sn/kernel/sn.o \
88 arch/$(ARCH)/sn/io/sgiio.o \
92 ifdef CONFIG_IA64_SOFTSDV
93 SUBDIRS := arch/$(ARCH)/dig \
95 CORE_FILES := arch/$(ARCH)/dig/dig.a \
100 SUBDIRS := arch/$(ARCH)/dig \
102 CORE_FILES := arch/$(ARCH)/dig/dig.a \
108 ifdef CONFIG_IA32_SUPPORT
109 SUBDIRS := arch/$(ARCH)/ia32 $(SUBDIRS)
110 CORE_FILES := arch/$(ARCH)/ia32/ia32.o $(CORE_FILES)
113 HEAD := arch/$(ARCH)/kernel/head.o arch/ia64/kernel/init_task.o
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)
118 LIBS := $(TOPDIR)/arch/$(ARCH)/lib/lib.a $(LIBS) \
119 $(TOPDIR)/arch/$(ARCH)/lib/lib.a
121 MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
123 vmlinux: arch/$(ARCH)/vmlinux.lds
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 > $@
132 $(OBJCOPY) --strip-all vmlinux vmlinux-tmp
134 mv vmlinux-tmp.gz vmlinux.gz
140 # My boot writes directly to a specific disk partition, I doubt most
141 # people will want to do that without changes..
147 @$(MAKEBOOT) bootimage
156 arch/ia64/scripts/unwcheck.sh vmlinux
159 rm -f arch/$(ARCH)/vmlinux.lds vmlinux-tmp vmlinux.gz
160 @$(MAKE) -C arch/$(ARCH)/tools mrproper
166 @$(MAKEBOOT) bootpfile