xref: /linux/kernel/Makefile (revision afa588b2651a03da4bc601a17a244b1cd97264f2)
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 \
7*afa588b2SEric W. Biederman	    sysctl.o sysctl_binary.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 \
1222a9d645SArjan van de Ven	    notifier.o ksysfs.o pm_qos_params.o sched_clock.o cred.o \
1322a9d645SArjan van de Ven	    async.o
1430639b6aSAlexey Dobriyanobj-y += groups.o
151da177e4SLinus Torvalds
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
449316fcacSAndrew Mortonobj-$(CONFIG_USE_GENERIC_SMP_HELPERS) += smp.o
459316fcacSAndrew Mortonifneq ($(CONFIG_SMP),y)
4653ce3d95SAndrew Mortonobj-y += up.o
4753ce3d95SAndrew Mortonendif
4868f4f1ecSMax Krasnyanskyobj-$(CONFIG_SMP) += spinlock.o
49fb1c8f93SIngo Molnarobj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o
508a25d5deSIngo Molnarobj-$(CONFIG_PROVE_LOCKING) += spinlock.o
511da177e4SLinus Torvaldsobj-$(CONFIG_UID16) += uid16.o
521da177e4SLinus Torvaldsobj-$(CONFIG_MODULES) += module.o
531da177e4SLinus Torvaldsobj-$(CONFIG_KALLSYMS) += kallsyms.o
541da177e4SLinus Torvaldsobj-$(CONFIG_PM) += power/
5542f5e039SRafael J. Wysockiobj-$(CONFIG_FREEZER) += power/
561da177e4SLinus Torvaldsobj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
57dc009d92SEric W. Biedermanobj-$(CONFIG_KEXEC) += kexec.o
586dab2778SArjan van de Venobj-$(CONFIG_BACKTRACE_SELF_TEST) += backtracetest.o
591da177e4SLinus Torvaldsobj-$(CONFIG_COMPAT) += compat.o
60ddbcc7e8SPaul Menageobj-$(CONFIG_CGROUPS) += cgroup.o
61dc52ddc0SMatt Helsleyobj-$(CONFIG_CGROUP_FREEZER) += cgroup_freezer.o
621da177e4SLinus Torvaldsobj-$(CONFIG_CPUSETS) += cpuset.o
63858d72eaSSerge E. Hallynobj-$(CONFIG_CGROUP_NS) += ns_cgroup.o
64aee16ce7SPavel Emelyanovobj-$(CONFIG_UTS_NS) += utsname.o
65aee16ce7SPavel Emelyanovobj-$(CONFIG_USER_NS) += user_namespace.o
6674bd59bbSPavel Emelyanovobj-$(CONFIG_PID_NS) += pid_namespace.o
671da177e4SLinus Torvaldsobj-$(CONFIG_IKCONFIG) += configs.o
68e552b661SPavel Emelianovobj-$(CONFIG_RESOURCE_COUNTERS) += res_counter.o
691da177e4SLinus Torvaldsobj-$(CONFIG_STOP_MACHINE) += stop_machine.o
708c1c9356SAnanth N Mavinakayanahalliobj-$(CONFIG_KPROBES_SANITY_TEST) += test_kprobes.o
713a6a6c16SEric Parisobj-$(CONFIG_AUDIT) += audit.o auditfilter.o audit_watch.o
721da177e4SLinus Torvaldsobj-$(CONFIG_AUDITSYSCALL) += auditsc.o
732521f2c2SPeter Oberparleiterobj-$(CONFIG_GCOV_KERNEL) += gcov/
7474c3cbe3SAl Viroobj-$(CONFIG_AUDIT_TREE) += audit_tree.o
751da177e4SLinus Torvaldsobj-$(CONFIG_KPROBES) += kprobes.o
76dc7d5527SJason Wesselobj-$(CONFIG_KGDB) += kgdb.o
778446f1d3SIngo Molnarobj-$(CONFIG_DETECT_SOFTLOCKUP) += softlockup.o
78e162b39aSMandeep Singh Bainesobj-$(CONFIG_DETECT_HUNG_TASK) += hung_task.o
791da177e4SLinus Torvaldsobj-$(CONFIG_GENERIC_HARDIRQS) += irq/
801da177e4SLinus Torvaldsobj-$(CONFIG_SECCOMP) += seccomp.o
81a241ec65SPaul E. McKenneyobj-$(CONFIG_RCU_TORTURE_TEST) += rcutorture.o
8264db4cffSPaul E. McKenneyobj-$(CONFIG_TREE_RCU) += rcutree.o
83f41d911fSPaul E. McKenneyobj-$(CONFIG_TREE_PREEMPT_RCU) += rcutree.o
8464db4cffSPaul E. McKenneyobj-$(CONFIG_TREE_RCU_TRACE) += rcutree_trace.o
85b86ff981SJens Axboeobj-$(CONFIG_RELAY) += relay.o
8639732acdSEric W. Biedermanobj-$(CONFIG_SYSCTL) += utsname_sysctl.o
87ca74e92bSShailabh Nagarobj-$(CONFIG_TASK_DELAY_ACCT) += delayacct.o
88f3cef7a9SJay Lanobj-$(CONFIG_TASKSTATS) += taskstats.o tsacct.o
8997e1c18eSMathieu Desnoyersobj-$(CONFIG_TRACEPOINTS) += tracepoint.o
909745512cSArjan van de Venobj-$(CONFIG_LATENCYTOP) += latencytop.o
91606576ceSSteven Rostedtobj-$(CONFIG_FUNCTION_TRACER) += trace/
92bc0c38d1SSteven Rostedtobj-$(CONFIG_TRACING) += trace/
9356449f43SIngo Molnarobj-$(CONFIG_X86_DS) += trace/
941155de47SPaul Mundtobj-$(CONFIG_RING_BUFFER) += trace/
956e0534f2SGregory Haskinsobj-$(CONFIG_SMP) += sched_cpupri.o
9607fe7cb7SDavid Howellsobj-$(CONFIG_SLOW_WORK) += slow-work.o
97cdd6c482SIngo Molnarobj-$(CONFIG_PERF_EVENTS) += perf_event.o
981da177e4SLinus Torvalds
99ae1e9130SIngo Molnarifneq ($(CONFIG_SCHED_OMIT_FRAME_POINTER),y)
1001da177e4SLinus Torvalds# According to Alan Modra <alan@linuxcare.com.au>, the -fno-omit-frame-pointer is
1011da177e4SLinus Torvalds# needed for x86 only.  Why this used to be enabled for all architectures is beyond
1021da177e4SLinus Torvalds# me.  I suspect most platforms don't need this, but until we know that for sure
1031da177e4SLinus Torvalds# I turn this off for IA-64 only.  Andreas Schwab says it's also needed on m68k
1041da177e4SLinus Torvalds# to get a correct value for the wait-channel (WCHAN in ps). --davidm
1051da177e4SLinus TorvaldsCFLAGS_sched.o := $(PROFILING) -fno-omit-frame-pointer
1061da177e4SLinus Torvaldsendif
1071da177e4SLinus Torvalds
1081da177e4SLinus Torvalds$(obj)/configs.o: $(obj)/config_data.h
1091da177e4SLinus Torvalds
1101da177e4SLinus Torvalds# config_data.h contains the same information as ikconfig.h but gzipped.
1111da177e4SLinus Torvalds# Info from config_data can be extracted from /proc/config*
1121da177e4SLinus Torvaldstargets += config_data.gz
1131da177e4SLinus Torvalds$(obj)/config_data.gz: .config FORCE
1141da177e4SLinus Torvalds	$(call if_changed,gzip)
1151da177e4SLinus Torvalds
1161da177e4SLinus Torvaldsquiet_cmd_ikconfiggz = IKCFG   $@
117de481560SSteven Rostedt      cmd_ikconfiggz = (echo "static const char kernel_config_data[] __used = MAGIC_START"; cat $< | scripts/bin2c; echo "MAGIC_END;") > $@
1181da177e4SLinus Torvaldstargets += config_data.h
1191da177e4SLinus Torvalds$(obj)/config_data.h: $(obj)/config_data.gz FORCE
1201da177e4SLinus Torvalds	$(call if_changed,ikconfiggz)
121bdc80787SH. Peter Anvin
122bdc80787SH. Peter Anvin$(obj)/time.o: $(obj)/timeconst.h
123bdc80787SH. Peter Anvin
124bdc80787SH. Peter Anvinquiet_cmd_timeconst  = TIMEC   $@
125bdc80787SH. Peter Anvin      cmd_timeconst  = $(PERL) $< $(CONFIG_HZ) > $@
126bdc80787SH. Peter Anvintargets += timeconst.h
127bdc80787SH. Peter Anvin$(obj)/timeconst.h: $(src)/timeconst.pl FORCE
128bdc80787SH. Peter Anvin	$(call if_changed,timeconst)
129