blob: f10de0f2c5e622258517b978afac886378a04333 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#
2# Makefile for the linux kernel.
3#
4
5extra-y := head.o init_task.o vmlinux.lds
6
7obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o vm86.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 dmi_scan.o bootflag.o \
Pierre Ossman795312e2005-09-03 15:56:54 -070010 doublefault.o quirks.o i8237.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070011
12obj-y += cpu/
13obj-y += timers/
Len Brown888ba6c2005-08-24 12:07:20 -040014obj-$(CONFIG_ACPI) += acpi/
Linus Torvalds1da177e2005-04-16 15:20:36 -070015obj-$(CONFIG_X86_BIOS_REBOOT) += reboot.o
16obj-$(CONFIG_MCA) += mca.o
17obj-$(CONFIG_X86_MSR) += msr.o
18obj-$(CONFIG_X86_CPUID) += cpuid.o
19obj-$(CONFIG_MICROCODE) += microcode.o
20obj-$(CONFIG_APM) += apm.o
21obj-$(CONFIG_X86_SMP) += smp.o smpboot.o
22obj-$(CONFIG_X86_TRAMPOLINE) += trampoline.o
23obj-$(CONFIG_X86_MPPARSE) += mpparse.o
24obj-$(CONFIG_X86_LOCAL_APIC) += apic.o nmi.o
25obj-$(CONFIG_X86_IO_APIC) += io_apic.o
Jaya Kumara2f7c352005-05-01 08:58:49 -070026obj-$(CONFIG_X86_REBOOTFIXUPS) += reboot_fixups.o
Eric W. Biederman5033cba2005-06-25 14:57:56 -070027obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o crash.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070028obj-$(CONFIG_X86_NUMAQ) += numaq.o
29obj-$(CONFIG_X86_SUMMIT_NUMA) += summit.o
30obj-$(CONFIG_KPROBES) += kprobes.o
31obj-$(CONFIG_MODULES) += module.o
32obj-y += sysenter.o vsyscall.o
33obj-$(CONFIG_ACPI_SRAT) += srat.o
34obj-$(CONFIG_HPET_TIMER) += time_hpet.o
35obj-$(CONFIG_EFI) += efi.o efi_stub.o
36obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
37
38EXTRA_AFLAGS := -traditional
39
40obj-$(CONFIG_SCx200) += scx200.o
41
42# vsyscall.o contains the vsyscall DSO images as __initdata.
43# We must build both images before we can assemble it.
44# Note: kbuild does not track this dependency due to usage of .incbin
45$(obj)/vsyscall.o: $(obj)/vsyscall-int80.so $(obj)/vsyscall-sysenter.so
46targets += $(foreach F,int80 sysenter,vsyscall-$F.o vsyscall-$F.so)
Keith Owens5754c9b2005-06-08 15:49:07 -070047targets += vsyscall-note.o vsyscall.lds
Linus Torvalds1da177e2005-04-16 15:20:36 -070048
49# The DSO images are built using a special linker script.
50quiet_cmd_syscall = SYSCALL $@
51 cmd_syscall = $(CC) -m elf_i386 -nostdlib $(SYSCFLAGS_$(@F)) \
52 -Wl,-T,$(filter-out FORCE,$^) -o $@
53
54export CPPFLAGS_vsyscall.lds += -P -C -U$(ARCH)
55
56vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1
57SYSCFLAGS_vsyscall-sysenter.so = $(vsyscall-flags)
58SYSCFLAGS_vsyscall-int80.so = $(vsyscall-flags)
59
60$(obj)/vsyscall-int80.so $(obj)/vsyscall-sysenter.so: \
Roland McGrathc97db4a2005-04-16 15:24:48 -070061$(obj)/vsyscall-%.so: $(src)/vsyscall.lds \
62 $(obj)/vsyscall-%.o $(obj)/vsyscall-note.o FORCE
Linus Torvalds1da177e2005-04-16 15:20:36 -070063 $(call if_changed,syscall)
64
65# We also create a special relocatable object that should mirror the symbol
66# table and layout of the linked DSO. With ld -R we can then refer to
67# these symbols in the kernel code rather than hand-coded addresses.
68extra-y += vsyscall-syms.o
69$(obj)/built-in.o: $(obj)/vsyscall-syms.o
70$(obj)/built-in.o: ld_flags += -R $(obj)/vsyscall-syms.o
71
72SYSCFLAGS_vsyscall-syms.o = -r
Roland McGrathc97db4a2005-04-16 15:24:48 -070073$(obj)/vsyscall-syms.o: $(src)/vsyscall.lds \
74 $(obj)/vsyscall-sysenter.o $(obj)/vsyscall-note.o FORCE
Linus Torvalds1da177e2005-04-16 15:20:36 -070075 $(call if_changed,syscall)