xref: /linux/kernel/Makefile (revision ae1e9130bfb9ad55eb97ec3fb17a122b7a118f98)
11da177e4SLinus Torvalds#
21da177e4SLinus Torvalds# Makefile for the linux kernel.
31da177e4SLinus Torvalds#
41da177e4SLinus Torvalds
5b03f6489SAdrian Bunkobj-y     = sched.o fork.o exec_domain.o panic.o printk.o \
668f4f1ecSMax Krasnyansky	    cpu.o exit.o itimer.o time.o softirq.o resource.o \
7aee16ce7SPavel Emelyanov	    sysctl.o capability.o ptrace.o timer.o user.o \
81da177e4SLinus Torvalds	    signal.o sys.o kmod.o workqueue.o pid.o \
9e260be67SPaul E. McKenney	    rcupdate.o extable.o params.o posix-timers.o \
10c0a31329SThomas Gleixner	    kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \
1164ac24e7SMatthew Wilcox	    hrtimer.o rwsem.o nsproxy.o srcu.o semaphore.o \
123e51f33fSPeter Zijlstra	    notifier.o ksysfs.o pm_qos_params.o sched_clock.o
131da177e4SLinus Torvalds
14d88c1691SIngo MolnarCFLAGS_REMOVE_sched.o = -mno-spe
15d88c1691SIngo Molnar
16606576ceSSteven Rostedtifdef CONFIG_FUNCTION_TRACER
176ec56232SSteven Rostedt# Do not trace debug files and internal ftrace files
186ec56232SSteven RostedtCFLAGS_REMOVE_lockdep.o = -pg
196ec56232SSteven RostedtCFLAGS_REMOVE_lockdep_proc.o = -pg
206ec56232SSteven RostedtCFLAGS_REMOVE_mutex-debug.o = -pg
216ec56232SSteven RostedtCFLAGS_REMOVE_rtmutex-debug.o = -pg
226ec56232SSteven RostedtCFLAGS_REMOVE_cgroup-debug.o = -pg
236ec56232SSteven RostedtCFLAGS_REMOVE_sched_clock.o = -pg
241d09daa5SSteven Rostedtendif
251d09daa5SSteven Rostedt
268174f150SMatt Helsleyobj-$(CONFIG_FREEZER) += freezer.o
27b03f6489SAdrian Bunkobj-$(CONFIG_PROFILING) += profile.o
2888f458e4SHolger Schurigobj-$(CONFIG_SYSCTL_SYSCALL_CHECK) += sysctl_check.o
298637c099SIngo Molnarobj-$(CONFIG_STACKTRACE) += stacktrace.o
30ad596171Sjohn stultzobj-y += time/
31408894eeSIngo Molnarobj-$(CONFIG_DEBUG_MUTEXES) += mutex-debug.o
32fbb9ce95SIngo Molnarobj-$(CONFIG_LOCKDEP) += lockdep.o
33a8f24a39SIngo Molnarifeq ($(CONFIG_PROC_FS),y)
34a8f24a39SIngo Molnarobj-$(CONFIG_LOCKDEP) += lockdep_proc.o
35a8f24a39SIngo Molnarendif
361da177e4SLinus Torvaldsobj-$(CONFIG_FUTEX) += futex.o
3734f192c6SIngo Molnarifeq ($(CONFIG_COMPAT),y)
3834f192c6SIngo Molnarobj-$(CONFIG_FUTEX) += futex_compat.o
3934f192c6SIngo Molnarendif
4023f78d4aSIngo Molnarobj-$(CONFIG_RT_MUTEXES) += rtmutex.o
41e7eebaf6SIngo Molnarobj-$(CONFIG_DEBUG_RT_MUTEXES) += rtmutex-debug.o
4261a87122SThomas Gleixnerobj-$(CONFIG_RT_MUTEX_TESTER) += rtmutex-tester.o
431da177e4SLinus Torvaldsobj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
443d442233SJens Axboeobj-$(CONFIG_USE_GENERIC_SMP_HELPERS) += smp.o
4568f4f1ecSMax Krasnyanskyobj-$(CONFIG_SMP) += spinlock.o
46fb1c8f93SIngo Molnarobj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o
478a25d5deSIngo Molnarobj-$(CONFIG_PROVE_LOCKING) += spinlock.o
481da177e4SLinus Torvaldsobj-$(CONFIG_UID16) += uid16.o
491da177e4SLinus Torvaldsobj-$(CONFIG_MODULES) += module.o
501da177e4SLinus Torvaldsobj-$(CONFIG_KALLSYMS) += kallsyms.o
511da177e4SLinus Torvaldsobj-$(CONFIG_PM) += power/
521da177e4SLinus Torvaldsobj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
53dc009d92SEric W. Biedermanobj-$(CONFIG_KEXEC) += kexec.o
546dab2778SArjan van de Venobj-$(CONFIG_BACKTRACE_SELF_TEST) += backtracetest.o
551da177e4SLinus Torvaldsobj-$(CONFIG_COMPAT) += compat.o
56ddbcc7e8SPaul Menageobj-$(CONFIG_CGROUPS) += cgroup.o
57006cb992SPaul Menageobj-$(CONFIG_CGROUP_DEBUG) += cgroup_debug.o
58dc52ddc0SMatt Helsleyobj-$(CONFIG_CGROUP_FREEZER) += cgroup_freezer.o
591da177e4SLinus Torvaldsobj-$(CONFIG_CPUSETS) += cpuset.o
60858d72eaSSerge E. Hallynobj-$(CONFIG_CGROUP_NS) += ns_cgroup.o
61aee16ce7SPavel Emelyanovobj-$(CONFIG_UTS_NS) += utsname.o
62aee16ce7SPavel Emelyanovobj-$(CONFIG_USER_NS) += user_namespace.o
6374bd59bbSPavel Emelyanovobj-$(CONFIG_PID_NS) += pid_namespace.o
641da177e4SLinus Torvaldsobj-$(CONFIG_IKCONFIG) += configs.o
65e552b661SPavel Emelianovobj-$(CONFIG_RESOURCE_COUNTERS) += res_counter.o
661da177e4SLinus Torvaldsobj-$(CONFIG_STOP_MACHINE) += stop_machine.o
678c1c9356SAnanth N Mavinakayanahalliobj-$(CONFIG_KPROBES_SANITY_TEST) += test_kprobes.o
68fe7752baSDavid Woodhouseobj-$(CONFIG_AUDIT) += audit.o auditfilter.o
691da177e4SLinus Torvaldsobj-$(CONFIG_AUDITSYSCALL) += auditsc.o
7074c3cbe3SAl Viroobj-$(CONFIG_AUDIT_TREE) += audit_tree.o
711da177e4SLinus Torvaldsobj-$(CONFIG_KPROBES) += kprobes.o
72dc7d5527SJason Wesselobj-$(CONFIG_KGDB) += kgdb.o
738446f1d3SIngo Molnarobj-$(CONFIG_DETECT_SOFTLOCKUP) += softlockup.o
741da177e4SLinus Torvaldsobj-$(CONFIG_GENERIC_HARDIRQS) += irq/
751da177e4SLinus Torvaldsobj-$(CONFIG_SECCOMP) += seccomp.o
76a241ec65SPaul E. McKenneyobj-$(CONFIG_RCU_TORTURE_TEST) += rcutorture.o
77e260be67SPaul E. McKenneyobj-$(CONFIG_CLASSIC_RCU) += rcuclassic.o
78e260be67SPaul E. McKenneyobj-$(CONFIG_PREEMPT_RCU) += rcupreempt.o
79e260be67SPaul E. McKenneyifeq ($(CONFIG_PREEMPT_RCU),y)
80e260be67SPaul E. McKenneyobj-$(CONFIG_RCU_TRACE) += rcupreempt_trace.o
81e260be67SPaul E. McKenneyendif
82b86ff981SJens Axboeobj-$(CONFIG_RELAY) += relay.o
8339732acdSEric W. Biedermanobj-$(CONFIG_SYSCTL) += utsname_sysctl.o
84ca74e92bSShailabh Nagarobj-$(CONFIG_TASK_DELAY_ACCT) += delayacct.o
85f3cef7a9SJay Lanobj-$(CONFIG_TASKSTATS) += taskstats.o tsacct.o
868256e47cSMathieu Desnoyersobj-$(CONFIG_MARKERS) += marker.o
8797e1c18eSMathieu Desnoyersobj-$(CONFIG_TRACEPOINTS) += tracepoint.o
889745512cSArjan van de Venobj-$(CONFIG_LATENCYTOP) += latencytop.o
89ee7e5516SDmitry Baryshkovobj-$(CONFIG_HAVE_GENERIC_DMA_COHERENT) += dma-coherent.o
90606576ceSSteven Rostedtobj-$(CONFIG_FUNCTION_TRACER) += trace/
91bc0c38d1SSteven Rostedtobj-$(CONFIG_TRACING) += trace/
926e0534f2SGregory Haskinsobj-$(CONFIG_SMP) += sched_cpupri.o
931da177e4SLinus Torvalds
94*ae1e9130SIngo Molnarifneq ($(CONFIG_SCHED_OMIT_FRAME_POINTER),y)
951da177e4SLinus Torvalds# According to Alan Modra <alan@linuxcare.com.au>, the -fno-omit-frame-pointer is
961da177e4SLinus Torvalds# needed for x86 only.  Why this used to be enabled for all architectures is beyond
971da177e4SLinus Torvalds# me.  I suspect most platforms don't need this, but until we know that for sure
981da177e4SLinus Torvalds# I turn this off for IA-64 only.  Andreas Schwab says it's also needed on m68k
991da177e4SLinus Torvalds# to get a correct value for the wait-channel (WCHAN in ps). --davidm
1001da177e4SLinus TorvaldsCFLAGS_sched.o := $(PROFILING) -fno-omit-frame-pointer
1011da177e4SLinus Torvaldsendif
1021da177e4SLinus Torvalds
1031da177e4SLinus Torvalds$(obj)/configs.o: $(obj)/config_data.h
1041da177e4SLinus Torvalds
1051da177e4SLinus Torvalds# config_data.h contains the same information as ikconfig.h but gzipped.
1061da177e4SLinus Torvalds# Info from config_data can be extracted from /proc/config*
1071da177e4SLinus Torvaldstargets += config_data.gz
1081da177e4SLinus Torvalds$(obj)/config_data.gz: .config FORCE
1091da177e4SLinus Torvalds	$(call if_changed,gzip)
1101da177e4SLinus Torvalds
1111da177e4SLinus Torvaldsquiet_cmd_ikconfiggz = IKCFG   $@
1121da177e4SLinus Torvalds      cmd_ikconfiggz = (echo "static const char kernel_config_data[] = MAGIC_START"; cat $< | scripts/bin2c; echo "MAGIC_END;") > $@
1131da177e4SLinus Torvaldstargets += config_data.h
1141da177e4SLinus Torvalds$(obj)/config_data.h: $(obj)/config_data.gz FORCE
1151da177e4SLinus Torvalds	$(call if_changed,ikconfiggz)
116bdc80787SH. Peter Anvin
117bdc80787SH. Peter Anvin$(obj)/time.o: $(obj)/timeconst.h
118bdc80787SH. Peter Anvin
119bdc80787SH. Peter Anvinquiet_cmd_timeconst  = TIMEC   $@
120bdc80787SH. Peter Anvin      cmd_timeconst  = $(PERL) $< $(CONFIG_HZ) > $@
121bdc80787SH. Peter Anvintargets += timeconst.h
122bdc80787SH. Peter Anvin$(obj)/timeconst.h: $(src)/timeconst.pl FORCE
123bdc80787SH. Peter Anvin	$(call if_changed,timeconst)
124