4 # This file is included by the global makefile so that you can add your own
5 # architecture-specific flags and dependencies. Remember to do have actions
6 # for "archclean" and "archdep" for cleaning up and making dependencies for
9 # This file is subject to the terms and conditions of the GNU General Public
10 # License. See the file "COPYING" in the main directory of this archive
13 # Copyright (C) 1994 by Linus Torvalds
15 # 19990713 Artur Skawina <skawina@geocities.com>
16 # Added '-march' and '-mpreferred-stack-boundary' support
17 # 20000913 Pavel Machek <pavel@suse.cz>
18 # Converted for x86_64 architecture
19 # 20010105 Andi Kleen, add IA32 compiler.
20 # ....and later removed it again....
22 # $Id: Makefile,v 1.36 2004/02/27 18:30:19 ak Exp $
25 # early bootup linking needs 32bit. You can either use real 32bit tools
26 # here or 64bit tools switch to 32bit mode.
28 IA32_CC := $(CROSS_COMPILE)gcc -m32 -O2 -fomit-frame-pointer -nostdinc -I $(HPATH)
29 IA32_LD := $(CROSS_COMPILE)ld -m elf_i386
30 IA32_AS := $(CROSS_COMPILE)gcc -m32 -Wa,--32 -D__ASSEMBLY__ -traditional -c -nostdinc -I $(HPATH)
31 IA32_OBJCOPY := $(CROSS_COMPILE)objcopy
32 IA32_CPP := $(CROSS_COMPILE)gcc -m32 -E
33 export IA32_CC IA32_LD IA32_AS IA32_OBJCOPY IA32_CPP
36 LD=$(CROSS_COMPILE)ld -m elf_x86_64
37 OBJCOPY=$(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S
39 LINKFLAGS =-T $(TOPDIR)/arch/x86_64/vmlinux.lds $(LDFLAGS)
41 CFLAGS += -mno-red-zone
42 CFLAGS += -mcmodel=kernel
44 CFLAGS += -fno-reorder-blocks
45 # needed for later gcc 3.1
46 CFLAGS += -finline-limit=2000
47 # needed for earlier gcc 3.1
48 CFLAGS += -fno-strength-reduce
49 CFLAGS += -Wno-sign-compare
51 ifneq ($(CONFIG_X86_REMOTE_DEBUG),y)
52 CFLAGS += -fno-asynchronous-unwind-tables
54 # this is needed right now for the 32bit ioctl code
55 CFLAGS += $(call check_gcc,-fno-unit-at-a-time,)
58 CFLAGS += $(call check_gcc,-march=k8,)
61 CFLAGS += $(call check_gcc,-march=nocona,)
64 HEAD := arch/x86_64/kernel/head.o arch/x86_64/kernel/head64.o arch/x86_64/kernel/init_task.o
66 SUBDIRS := arch/x86_64/tools $(SUBDIRS) arch/x86_64/kernel arch/x86_64/mm arch/x86_64/lib
67 CORE_FILES := arch/x86_64/kernel/kernel.o $(CORE_FILES)
68 CORE_FILES += arch/x86_64/mm/mm.o
69 LIBS := $(TOPDIR)/arch/x86_64/lib/lib.a $(LIBS)
71 ifdef CONFIG_IA32_EMULATION
72 SUBDIRS += arch/x86_64/ia32
73 CORE_FILES += arch/x86_64/ia32/ia32.o
77 SUBDIRS += arch/x86_64/hostfs
78 core-$(CONFIG_HOSTFS) += arch/x86_64/hostfs/hostfs.o
81 CORE_FILES += $(core-y)
83 arch/x86_64/tools: dummy
84 $(MAKE) linuxsubdirs SUBDIRS=arch/x86_64/tools
86 arch/x86_64/kernel: dummy
87 $(MAKE) linuxsubdirs SUBDIRS=arch/x86_64/kernel
90 $(MAKE) linuxsubdirs SUBDIRS=arch/x86_64/mm
92 MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
94 vmlinux: arch/x86_64/vmlinux.lds
98 .PHONY: zImage bzImage compressed zlilo bzlilo zdisk bzdisk install \
99 clean archclean archmrproper archdep checkoffset
102 make -C arch/$(ARCH)/tools $(TOPDIR)/include/asm-x86_64/offset.h
104 bzImage: checkoffset vmlinux
107 bzImage-padded: checkoffset vmlinux
108 @$(MAKEBOOT) bzImage-padded
111 @$(MAKEBOOT) BOOTIMAGE=bzImage zlilo
113 bzlilo: checkoffset vmlinux
114 @$(MAKEBOOT) BOOTIMAGE=bzImage zlilo
116 bzdisk: checkoffset vmlinux
117 @$(MAKEBOOT) BOOTIMAGE=bzImage zdisk
119 install: checkoffset vmlinux
120 @$(MAKEBOOT) BOOTIMAGE=bzImage install
124 @$(MAKE) -C $(TOPDIR)/arch/x86_64/tools clean
127 rm -f $(TOPDIR)/arch/x86_64/tools/offset.h
128 rm -f $(TOPDIR)/arch/x86_64/tools/offset.tmp
129 rm -f $(TOPDIR)/include/asm-x86_64/offset.h
132 @$(MAKE) -C $(TOPDIR)/arch/x86_64/tools all