2 # Makefile for the linux kernel.
5 extra-y
:= head.o init_task.o vmlinux.lds
7 obj-y
:= process.o signal.o entry.o traps.o irq.o \
8 ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \
9 pci-dma.o i386_ksyms.o i387.o bootflag.o e820.o\
10 quirks.o i8237.o topology.o alternative.o i8253.o tsc.o
12 obj-
$(CONFIG_STACKTRACE
) += stacktrace.o
15 obj-
$(CONFIG_X86_BIOS_REBOOT
) += reboot.o
16 obj-
$(CONFIG_MCA
) += mca.o
17 obj-
$(CONFIG_X86_MSR
) += msr.o
18 obj-
$(CONFIG_X86_CPUID
) += cpuid.o
19 obj-
$(CONFIG_MICROCODE
) += microcode.o
20 obj-
$(CONFIG_APM
) += apm.o
21 obj-
$(CONFIG_X86_SMP
) += smp.o smpboot.o
22 obj-
$(CONFIG_X86_TRAMPOLINE
) += trampoline.o
23 obj-
$(CONFIG_X86_MPPARSE
) += mpparse.o
24 obj-
$(CONFIG_X86_LOCAL_APIC
) += apic.o nmi.o
25 obj-
$(CONFIG_X86_IO_APIC
) += io_apic.o
26 obj-
$(CONFIG_X86_REBOOTFIXUPS
) += reboot_fixups.o
27 obj-
$(CONFIG_KEXEC
) += machine_kexec.o relocate_kernel.o crash.o
28 obj-
$(CONFIG_CRASH_DUMP
) += crash_dump.o
29 obj-
$(CONFIG_X86_NUMAQ
) += numaq.o
30 obj-
$(CONFIG_X86_SUMMIT_NUMA
) += summit.o
31 obj-
$(CONFIG_KPROBES
) += kprobes.o
32 obj-
$(CONFIG_MODULES
) += module.o
33 obj-y
+= sysenter.o vsyscall.o
34 obj-
$(CONFIG_ACPI_SRAT
) += srat.o
35 obj-
$(CONFIG_HPET_TIMER
) += time_hpet.o
36 obj-
$(CONFIG_EFI
) += efi.o efi_stub.o
37 obj-
$(CONFIG_DOUBLEFAULT
) += doublefault.o
38 obj-
$(CONFIG_VM86
) += vm86.o
39 obj-
$(CONFIG_EARLY_PRINTK
) += early_printk.o
40 obj-
$(CONFIG_HPET_TIMER
) += hpet.o
41 obj-
$(CONFIG_K8_NB
) += k8.o
43 obj-
$(CONFIG_VMI
) += vmi.o
45 # Make sure this is linked after any other paravirt_ops structs: see head.S
46 obj-
$(CONFIG_PARAVIRT
) += paravirt.o
48 EXTRA_AFLAGS
:= -traditional
50 obj-
$(CONFIG_SCx200
) += scx200.o
52 # vsyscall.o contains the vsyscall DSO images as __initdata.
53 # We must build both images before we can assemble it.
54 # Note: kbuild does not track this dependency due to usage of .incbin
55 $(obj
)/vsyscall.o
: $(obj
)/vsyscall-int80.so
$(obj
)/vsyscall-sysenter.so
56 targets
+= $(foreach F
,int80 sysenter
,vsyscall-
$F.o vsyscall-
$F.so
)
57 targets
+= vsyscall-note.o vsyscall.lds
59 # The DSO images are built using a special linker script.
60 quiet_cmd_syscall
= SYSCALL
$@
61 cmd_syscall
= $(CC
) -m elf_i386
-nostdlib
$(SYSCFLAGS_
$(@F
)) \
62 -Wl
,-T
,$(filter-out FORCE
,$^
) -o
$@
64 export CPPFLAGS_vsyscall.lds
+= -P
-C
-U
$(ARCH
)
66 vsyscall-flags
= -shared
-s
-Wl
,-soname
=linux-gate.so
.1 \
67 $(call ld-option
, -Wl
$(comma
)--hash-style
=sysv
)
68 SYSCFLAGS_vsyscall-sysenter.so
= $(vsyscall-flags
)
69 SYSCFLAGS_vsyscall-int80.so
= $(vsyscall-flags
)
71 $(obj
)/vsyscall-int80.so
$(obj
)/vsyscall-sysenter.so
: \
72 $(obj
)/vsyscall-
%.so
: $(src
)/vsyscall.lds \
73 $(obj
)/vsyscall-
%.o
$(obj
)/vsyscall-note.o FORCE
74 $(call if_changed
,syscall
)
76 # We also create a special relocatable object that should mirror the symbol
77 # table and layout of the linked DSO. With ld -R we can then refer to
78 # these symbols in the kernel code rather than hand-coded addresses.
79 extra-y
+= vsyscall-syms.o
80 $(obj
)/built-in.o
: $(obj
)/vsyscall-syms.o
81 $(obj
)/built-in.o
: ld_flags
+= -R
$(obj
)/vsyscall-syms.o
83 SYSCFLAGS_vsyscall-syms.o
= -r
84 $(obj
)/vsyscall-syms.o
: $(src
)/vsyscall.lds \
85 $(obj
)/vsyscall-sysenter.o
$(obj
)/vsyscall-note.o FORCE
86 $(call if_changed
,syscall
)
88 k8-y
+= ..
/..
/x86_64
/kernel
/k8.o
89 stacktrace-y
+= ..
/..
/x86_64
/kernel
/stacktrace.o