xref: /linux/kernel/Makefile (revision cf65a0f6f6ff7631ba0ac0513a14ca5b65320d80)
1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
21da177e4SLinus Torvalds#
31da177e4SLinus Torvalds# Makefile for the linux kernel.
41da177e4SLinus Torvalds#
51da177e4SLinus Torvalds
6b9ee979eSJoe Perchesobj-y     = fork.o exec_domain.o panic.o \
75cee9645SThomas Gleixner	    cpu.o exit.o softirq.o resource.o \
85cee9645SThomas Gleixner	    sysctl.o sysctl_binary.o capability.o ptrace.o user.o \
90ce2c202SLuis R. Rodriguez	    signal.o sys.o umh.o workqueue.o pid.o task_work.o \
105cee9645SThomas Gleixner	    extable.o params.o \
115cee9645SThomas Gleixner	    kthread.o sys_ni.o nsproxy.o \
1215d94b82SRobin Holt	    notifier.o ksysfs.o cred.o reboot.o \
13dbec2846SEric W. Biederman	    async.o range.o smpboot.o ucount.o
142813893fSIulia Manda
150ce2c202SLuis R. Rodriguezobj-$(CONFIG_MODULES) += kmod.o
162813893fSIulia Mandaobj-$(CONFIG_MULTIUSER) += groups.o
17029632fbSPeter Zijlstra
18606576ceSSteven Rostedtifdef CONFIG_FUNCTION_TRACER
19e11b956eSLi Bin# Do not trace internal ftrace files
20c0a80c0cSHeiko CarstensCFLAGS_REMOVE_irq_work.o = $(CC_FLAGS_FTRACE)
211d09daa5SSteven Rostedtendif
221d09daa5SSteven Rostedt
235c9a8750SDmitry Vyukov# Prevents flicker of uninteresting __do_softirq()/__local_bh_disable_ip()
245c9a8750SDmitry Vyukov# in coverage traces.
255c9a8750SDmitry VyukovKCOV_INSTRUMENT_softirq.o := n
265c9a8750SDmitry Vyukov# These are called from save_stack_trace() on slub debug path,
275c9a8750SDmitry Vyukov# and produce insane amounts of uninteresting coverage.
285c9a8750SDmitry VyukovKCOV_INSTRUMENT_module.o := n
295c9a8750SDmitry VyukovKCOV_INSTRUMENT_extable.o := n
305c9a8750SDmitry Vyukov# Don't self-instrument.
315c9a8750SDmitry VyukovKCOV_INSTRUMENT_kcov.o := n
325c9a8750SDmitry VyukovKASAN_SANITIZE_kcov.o := n
335c9a8750SDmitry Vyukov
3458edae3aSAndi Kleen# cond_syscall is currently not LTO compatible
3558edae3aSAndi KleenCFLAGS_sys_ni.o = $(DISABLE_LTO)
3658edae3aSAndi Kleen
37391e43daSPeter Zijlstraobj-y += sched/
3801768b42SPeter Zijlstraobj-y += locking/
39dae5cbc2SRafael J. Wysockiobj-y += power/
40b9ee979eSJoe Perchesobj-y += printk/
410244ad00SMartin Schwidefskyobj-y += irq/
424102adabSPaul E. McKenneyobj-y += rcu/
43b700e7f0SSeth Jenningsobj-y += livepatch/
44*cf65a0f6SChristoph Hellwigobj-y += dma/
45391e43daSPeter Zijlstra
461e142b29SCyrill Gorcunovobj-$(CONFIG_CHECKPOINT_RESTORE) += kcmp.o
478174f150SMatt Helsleyobj-$(CONFIG_FREEZER) += freezer.o
48b03f6489SAdrian Bunkobj-$(CONFIG_PROFILING) += profile.o
498637c099SIngo Molnarobj-$(CONFIG_STACKTRACE) += stacktrace.o
50ad596171Sjohn stultzobj-y += time/
511da177e4SLinus Torvaldsobj-$(CONFIG_FUTEX) += futex.o
5234f192c6SIngo Molnarifeq ($(CONFIG_COMPAT),y)
5334f192c6SIngo Molnarobj-$(CONFIG_FUTEX) += futex_compat.o
5434f192c6SIngo Molnarendif
551da177e4SLinus Torvaldsobj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
56351f8f8eSAmerigo Wangobj-$(CONFIG_SMP) += smp.o
579316fcacSAndrew Mortonifneq ($(CONFIG_SMP),y)
5853ce3d95SAndrew Mortonobj-y += up.o
5953ce3d95SAndrew Mortonendif
601da177e4SLinus Torvaldsobj-$(CONFIG_UID16) += uid16.o
611da177e4SLinus Torvaldsobj-$(CONFIG_MODULES) += module.o
62b56e5a17SDavid Howellsobj-$(CONFIG_MODULE_SIG) += module_signing.o
631da177e4SLinus Torvaldsobj-$(CONFIG_KALLSYMS) += kallsyms.o
641da177e4SLinus Torvaldsobj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
65692f66f2SHari Bathiniobj-$(CONFIG_CRASH_CORE) += crash_core.o
662965faa5SDave Youngobj-$(CONFIG_KEXEC_CORE) += kexec_core.o
67dc009d92SEric W. Biedermanobj-$(CONFIG_KEXEC) += kexec.o
68a43cac0dSDave Youngobj-$(CONFIG_KEXEC_FILE) += kexec_file.o
696dab2778SArjan van de Venobj-$(CONFIG_BACKTRACE_SELF_TEST) += backtracetest.o
701da177e4SLinus Torvaldsobj-$(CONFIG_COMPAT) += compat.o
71201af4c0STejun Heoobj-$(CONFIG_CGROUPS) += cgroup/
72aee16ce7SPavel Emelyanovobj-$(CONFIG_UTS_NS) += utsname.o
73aee16ce7SPavel Emelyanovobj-$(CONFIG_USER_NS) += user_namespace.o
7474bd59bbSPavel Emelyanovobj-$(CONFIG_PID_NS) += pid_namespace.o
751da177e4SLinus Torvaldsobj-$(CONFIG_IKCONFIG) += configs.o
76bbf1bb3eSTejun Heoobj-$(CONFIG_SMP) += stop_machine.o
778c1c9356SAnanth N Mavinakayanahalliobj-$(CONFIG_KPROBES_SANITY_TEST) += test_kprobes.o
78939a67fcSEric Parisobj-$(CONFIG_AUDIT) += audit.o auditfilter.o
791da177e4SLinus Torvaldsobj-$(CONFIG_AUDITSYSCALL) += auditsc.o
807f492942SRichard Guy Briggsobj-$(CONFIG_AUDIT_WATCH) += audit_watch.o audit_fsnotify.o
8174c3cbe3SAl Viroobj-$(CONFIG_AUDIT_TREE) += audit_tree.o
82939a67fcSEric Parisobj-$(CONFIG_GCOV_KERNEL) += gcov/
835c9a8750SDmitry Vyukovobj-$(CONFIG_KCOV) += kcov.o
841da177e4SLinus Torvaldsobj-$(CONFIG_KPROBES) += kprobes.o
854b1a29a7SMasami Hiramatsuobj-$(CONFIG_FAIL_FUNCTION) += fail_function.o
86c4338209SJason Wesselobj-$(CONFIG_KGDB) += debug/
87e162b39aSMandeep Singh Bainesobj-$(CONFIG_DETECT_HUNG_TASK) += hung_task.o
8858687acbSDon Zickusobj-$(CONFIG_LOCKUP_DETECTOR) += watchdog.o
8905a4a952SNicholas Pigginobj-$(CONFIG_HARDLOCKUP_DETECTOR_PERF) += watchdog_hld.o
901da177e4SLinus Torvaldsobj-$(CONFIG_SECCOMP) += seccomp.o
91b86ff981SJens Axboeobj-$(CONFIG_RELAY) += relay.o
9239732acdSEric W. Biedermanobj-$(CONFIG_SYSCTL) += utsname_sysctl.o
93ca74e92bSShailabh Nagarobj-$(CONFIG_TASK_DELAY_ACCT) += delayacct.o
94f3cef7a9SJay Lanobj-$(CONFIG_TASKSTATS) += taskstats.o tsacct.o
9597e1c18eSMathieu Desnoyersobj-$(CONFIG_TRACEPOINTS) += tracepoint.o
969745512cSArjan van de Venobj-$(CONFIG_LATENCYTOP) += latencytop.o
97f43edca7SRalf Baechleobj-$(CONFIG_ELFCORE) += elfcore.o
98606576ceSSteven Rostedtobj-$(CONFIG_FUNCTION_TRACER) += trace/
99bc0c38d1SSteven Rostedtobj-$(CONFIG_TRACING) += trace/
100ea632e9fSJosh Triplettobj-$(CONFIG_TRACE_CLOCK) += trace/
1011155de47SPaul Mundtobj-$(CONFIG_RING_BUFFER) += trace/
102870915e0SMathieu Desnoyersobj-$(CONFIG_TRACEPOINTS) += trace/
103e360adbeSPeter Zijlstraobj-$(CONFIG_IRQ_WORK) += irq_work.o
104ab10023eSColin Crossobj-$(CONFIG_CPU_PM) += cpu_pm.o
105f89b7755SAlexei Starovoitovobj-$(CONFIG_BPF) += bpf/
106fae85b7cSBorislav Petkov
107fae85b7cSBorislav Petkovobj-$(CONFIG_PERF_EVENTS) += events/
108fae85b7cSBorislav Petkov
1097a041097SAvi Kivityobj-$(CONFIG_USER_RETURN_NOTIFIER) += user-return-notifier.o
11016295becSSteffen Klassertobj-$(CONFIG_PADATA) += padata.o
11193a72052SOlaf Heringobj-$(CONFIG_CRASH_DUMP) += crash_dump.o
112b77f0f3cSJason Baronobj-$(CONFIG_JUMP_LABEL) += jump_label.o
11391d1aa43SFrederic Weisbeckerobj-$(CONFIG_CONTEXT_TRACKING) += context_tracking.o
11451b1130eSPaul E. McKenneyobj-$(CONFIG_TORTURE_TEST) += torture.o
1151da177e4SLinus Torvalds
1165981690dSDan Williamsobj-$(CONFIG_HAS_IOMEM) += iomem.o
1175981690dSDan Williamsobj-$(CONFIG_ZONE_DEVICE) += memremap.o
118d7822b1eSMathieu Desnoyersobj-$(CONFIG_RSEQ) += rseq.o
11992281deeSDan Williams
1201da177e4SLinus Torvalds$(obj)/configs.o: $(obj)/config_data.h
1211da177e4SLinus Torvalds
1221da177e4SLinus Torvaldstargets += config_data.gz
12341263fc6SBen Gardiner$(obj)/config_data.gz: $(KCONFIG_CONFIG) FORCE
1241da177e4SLinus Torvalds	$(call if_changed,gzip)
1251da177e4SLinus Torvalds
1268370edeaSVivek Goyal      filechk_ikconfiggz = (echo "static const char kernel_config_data[] __used = MAGIC_START"; cat $< | scripts/basic/bin2c; echo "MAGIC_END;")
1271da177e4SLinus Torvaldstargets += config_data.h
1281da177e4SLinus Torvalds$(obj)/config_data.h: $(obj)/config_data.gz FORCE
129e78e8f2dSPeter Foley	$(call filechk,ikconfiggz)
130