Makefile 2.91 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#
# x86_64/Makefile
#
# This file is included by the global makefile so that you can add your own
# architecture-specific flags and dependencies. Remember to do have actions
# for "archclean" and "archdep" for cleaning up and making dependencies for
# this architecture
#
# This file is subject to the terms and conditions of the GNU General Public
# License.  See the file "COPYING" in the main directory of this archive
# for more details.
#
# Copyright (C) 1994 by Linus Torvalds
#
# 19990713  Artur Skawina <skawina@geocities.com>
#           Added '-march' and '-mpreferred-stack-boundary' support
# 20000913  Pavel Machek <pavel@suse.cz>
#	    Converted for x86_64 architecture
# 20010105  Andi Kleen, add IA32 compiler.
20
#           ....and later removed it again....
21
#
22
# $Id: Makefile,v 1.31 2002/03/22 15:56:07 ak Exp $
23 24

#
25
# early bootup linking needs 32bit. You can either use real 32bit tools
26
# here or 64bit tools in 32bit mode.
27
#
28 29 30
IA32_CC := $(CC) $(CPPFLAGS) -m32 -O2 -fomit-frame-pointer
IA32_LD := $(LD) -m elf_i386
IA32_AS := $(CC) $(AFLAGS) -m32 -Wa,--32 -traditional -c
31 32
IA32_OBJCOPY := $(CROSS_COMPILE)objcopy
IA32_CPP := $(CROSS_COMPILE)gcc -m32 -E
33 34 35 36
export IA32_CC IA32_LD IA32_AS IA32_OBJCOPY IA32_CPP


LD=$(CROSS_COMPILE)ld -m elf_x86_64
37
OBJCOPYFLAGS	:= -O binary -R .note -R .comment -S
38
LDFLAGS_vmlinux := -e stext
39

40
CFLAGS += -mno-red-zone
41 42
CFLAGS += -mcmodel=kernel
CFLAGS += -pipe
43
# this makes reading assembly source easier
44
CFLAGS += -fno-reorder-blocks	
45
CFLAGS += -finline-limit=2000
46 47 48 49
#CFLAGS += -g

HEAD := arch/x86_64/kernel/head.o arch/x86_64/kernel/head64.o arch/x86_64/kernel/init_task.o

50
SUBDIRS += arch/x86_64/kernel arch/x86_64/mm arch/x86_64/lib
51 52 53 54 55 56 57 58 59
CORE_FILES := arch/x86_64/kernel/kernel.o $(CORE_FILES)
CORE_FILES +=  arch/x86_64/mm/mm.o
LIBS := $(TOPDIR)/arch/x86_64/lib/lib.a $(LIBS)

ifdef CONFIG_IA32_EMULATION
SUBDIRS += arch/x86_64/ia32
CORE_FILES += arch/x86_64/ia32/ia32.o
endif

60 61 62
ifdef CONFIG_PCI
SUBDIRS += arch/x86_64/pci
DRIVERS += arch/x86_64/pci/pci.o
63 64 65 66 67 68 69
endif

CORE_FILES += $(core-y)

MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot

.PHONY: zImage bzImage compressed zlilo bzlilo zdisk bzdisk install \
Kai Germaschewski's avatar
Kai Germaschewski committed
70
		clean archclean archmrproper
71

72
bzImage: vmlinux
73 74
	@$(MAKEBOOT) bzImage

75
bzImage-padded: vmlinux
76 77 78 79
	@$(MAKEBOOT) bzImage-padded

tmp:
	@$(MAKEBOOT) BOOTIMAGE=bzImage zlilo
80

81
bzlilo: vmlinux
82 83
	@$(MAKEBOOT) BOOTIMAGE=bzImage zlilo

84
bzdisk: vmlinux
85 86
	@$(MAKEBOOT) BOOTIMAGE=bzImage zdisk

87
install: vmlinux
88 89 90 91 92 93 94
	@$(MAKEBOOT) BOOTIMAGE=bzImage install

archclean:
	@$(MAKEBOOT) clean

archmrproper:

95 96 97 98 99 100 101 102 103 104 105 106 107 108 109

prepare: include/asm-$(ARCH)/offset.h

arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
				   include/config/MARKER

include/asm-$(ARCH)/offset.h.tmp: arch/$(ARCH)/kernel/asm-offsets.s
	@$(generate-asm-offsets.h) < $< > $@

include/asm-$(ARCH)/offset.h: include/asm-$(ARCH)/offset.h.tmp
	@echo -n '  Generating $@'
	@$(update-if-changed)

CLEAN_FILES += include/asm-$(ARCH)/offset.h.tmp \
	       include/asm-$(ARCH)/offset.h