Makefile 3.2 KB
Newer Older
L
Linus Torvalds 已提交
1 2 3 4 5 6
#
# Makefile for the linux kernel.
#

extra-y := head.o init_task.o vmlinux.lds

7
obj-y	:= process.o signal.o entry.o traps_32.o irq.o \
8
		ptrace.o time.o ioport.o ldt.o setup.o i8259_32.o sys_i386.o \
9
		pci-dma_32.o i386_ksyms.o i387.o bootflag.o e820.o\
10
		quirks.o i8237.o topology.o alternative.o i8253_32.o tsc.o
L
Linus Torvalds 已提交
11

12
obj-$(CONFIG_STACKTRACE)	+= stacktrace.o
L
Linus Torvalds 已提交
13
obj-y				+= cpu/
14
obj-y				+= acpi/
L
Linus Torvalds 已提交
15 16 17 18 19 20
obj-$(CONFIG_X86_BIOS_REBOOT)	+= reboot.o
obj-$(CONFIG_MCA)		+= mca.o
obj-$(CONFIG_X86_MSR)		+= msr.o
obj-$(CONFIG_X86_CPUID)		+= cpuid.o
obj-$(CONFIG_MICROCODE)		+= microcode.o
obj-$(CONFIG_APM)		+= apm.o
21
obj-$(CONFIG_X86_SMP)		+= smp.o smpboot.o tsc_sync.o
22
obj-$(CONFIG_SMP)		+= smpcommon.o
L
Linus Torvalds 已提交
23 24 25
obj-$(CONFIG_X86_TRAMPOLINE)	+= trampoline.o
obj-$(CONFIG_X86_MPPARSE)	+= mpparse.o
obj-$(CONFIG_X86_LOCAL_APIC)	+= apic.o nmi.o
26
obj-$(CONFIG_X86_IO_APIC)	+= io_apic_32.o
27
obj-$(CONFIG_X86_REBOOTFIXUPS)	+= reboot_fixups.o
28
obj-$(CONFIG_KEXEC)		+= machine_kexec.o relocate_kernel_32.o crash.o
29
obj-$(CONFIG_CRASH_DUMP)	+= crash_dump.o
L
Linus Torvalds 已提交
30 31 32 33 34
obj-$(CONFIG_X86_NUMAQ)		+= numaq.o
obj-$(CONFIG_X86_SUMMIT_NUMA)	+= summit.o
obj-$(CONFIG_KPROBES)		+= kprobes.o
obj-$(CONFIG_MODULES)		+= module.o
obj-y				+= sysenter.o vsyscall.o
35
obj-$(CONFIG_ACPI_SRAT) 	+= srat_32.o
L
Linus Torvalds 已提交
36
obj-$(CONFIG_EFI) 		+= efi.o efi_stub.o
37
obj-$(CONFIG_DOUBLEFAULT) 	+= doublefault.o
38
obj-$(CONFIG_VM86)		+= vm86.o
L
Linus Torvalds 已提交
39
obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
40
obj-$(CONFIG_HPET_TIMER) 	+= hpet.o
41
obj-$(CONFIG_K8_NB)		+= k8.o
42
obj-$(CONFIG_MGEODE_LX)		+= geode.o
43

44
obj-$(CONFIG_VMI)		+= vmi_32.o vmiclock_32.o
45
obj-$(CONFIG_PARAVIRT)		+= paravirt.o
46
obj-y				+= pcspeaker.o
L
Linus Torvalds 已提交
47 48 49 50 51 52 53 54

obj-$(CONFIG_SCx200)		+= scx200.o

# vsyscall.o contains the vsyscall DSO images as __initdata.
# We must build both images before we can assemble it.
# Note: kbuild does not track this dependency due to usage of .incbin
$(obj)/vsyscall.o: $(obj)/vsyscall-int80.so $(obj)/vsyscall-sysenter.so
targets += $(foreach F,int80 sysenter,vsyscall-$F.o vsyscall-$F.so)
55
targets += vsyscall-note.o vsyscall_32.lds
L
Linus Torvalds 已提交
56 57 58 59 60 61

# The DSO images are built using a special linker script.
quiet_cmd_syscall = SYSCALL $@
      cmd_syscall = $(CC) -m elf_i386 -nostdlib $(SYSCFLAGS_$(@F)) \
		          -Wl,-T,$(filter-out FORCE,$^) -o $@

62
export CPPFLAGS_vsyscall_32.lds += -P -C -U$(ARCH)
L
Linus Torvalds 已提交
63

R
Roland McGrath 已提交
64 65
vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 \
		 $(call ld-option, -Wl$(comma)--hash-style=sysv)
L
Linus Torvalds 已提交
66 67 68 69
SYSCFLAGS_vsyscall-sysenter.so	= $(vsyscall-flags)
SYSCFLAGS_vsyscall-int80.so	= $(vsyscall-flags)

$(obj)/vsyscall-int80.so $(obj)/vsyscall-sysenter.so: \
70
$(obj)/vsyscall-%.so: $(src)/vsyscall_32.lds \
71
		      $(obj)/vsyscall-%.o $(obj)/vsyscall-note.o FORCE
L
Linus Torvalds 已提交
72 73 74 75 76 77 78 79 80 81
	$(call if_changed,syscall)

# We also create a special relocatable object that should mirror the symbol
# table and layout of the linked DSO.  With ld -R we can then refer to
# these symbols in the kernel code rather than hand-coded addresses.
extra-y += vsyscall-syms.o
$(obj)/built-in.o: $(obj)/vsyscall-syms.o
$(obj)/built-in.o: ld_flags += -R $(obj)/vsyscall-syms.o

SYSCFLAGS_vsyscall-syms.o = -r
82
$(obj)/vsyscall-syms.o: $(src)/vsyscall_32.lds \
83
			$(obj)/vsyscall-sysenter.o $(obj)/vsyscall-note.o FORCE
L
Linus Torvalds 已提交
84
	$(call if_changed,syscall)
85 86

k8-y                      += ../../x86_64/kernel/k8.o
87
stacktrace-y		  += ../../x86_64/kernel/stacktrace.o
88