xref: /linux/kernel/Makefile (revision 3a39d672e7f48b8d6b91a09afa4b55352773b4b5)
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 \
888db0aa2SXiaoming Ni	    sysctl.o capability.o ptrace.o user.o \
90ce2c202SLuis R. Rodriguez	    signal.o sys.o umh.o workqueue.o pid.o task_work.o \
10a870544cSJuergen Gross	    extable.o params.o \
115cee9645SThomas Gleixner	    kthread.o sys_ni.o nsproxy.o \
1215d94b82SRobin Holt	    notifier.o ksysfs.o cred.o reboot.o \
13b06e9318SManinder Singh	    async.o range.o smpboot.o ucount.o regset.o ksyms_common.o
142813893fSIulia Manda
15d71fa5c9SAlexei Starovoitovobj-$(CONFIG_USERMODE_DRIVER) += usermode_driver.o
162813893fSIulia Mandaobj-$(CONFIG_MULTIUSER) += groups.o
17e297cd54SMike Christieobj-$(CONFIG_VHOST_TASK) += vhost_task.o
18029632fbSPeter Zijlstra
19606576ceSSteven Rostedtifdef CONFIG_FUNCTION_TRACER
20e11b956eSLi Bin# Do not trace internal ftrace files
21c0a80c0cSHeiko CarstensCFLAGS_REMOVE_irq_work.o = $(CC_FLAGS_FTRACE)
221d09daa5SSteven Rostedtendif
231d09daa5SSteven Rostedt
245c9a8750SDmitry Vyukov# Prevents flicker of uninteresting __do_softirq()/__local_bh_disable_ip()
255c9a8750SDmitry Vyukov# in coverage traces.
265c9a8750SDmitry VyukovKCOV_INSTRUMENT_softirq.o := n
270ebba714SMarco Elver# Avoid KCSAN instrumentation in softirq ("No shared variables, all the data
280ebba714SMarco Elver# are CPU local" => assume no data races), to reduce overhead in interrupts.
290ebba714SMarco ElverKCSAN_SANITIZE_softirq.o = n
305c9a8750SDmitry Vyukov# These are called from save_stack_trace() on slub debug path,
315c9a8750SDmitry Vyukov# and produce insane amounts of uninteresting coverage.
325c9a8750SDmitry VyukovKCOV_INSTRUMENT_extable.o := n
3343e76af8SDmitry VyukovKCOV_INSTRUMENT_stacktrace.o := n
345c9a8750SDmitry Vyukov# Don't self-instrument.
355c9a8750SDmitry VyukovKCOV_INSTRUMENT_kcov.o := n
36c1cb05e7SDmitry Vyukov# If sanitizers detect any issues in kcov, it may lead to recursion
37c1cb05e7SDmitry Vyukov# via printk, etc.
385c9a8750SDmitry VyukovKASAN_SANITIZE_kcov.o := n
390ebba714SMarco ElverKCSAN_SANITIZE_kcov.o := n
40c1cb05e7SDmitry VyukovUBSAN_SANITIZE_kcov.o := n
4179dbd006SAlexander PotapenkoKMSAN_SANITIZE_kcov.o := n
4231a1b987SMarco ElverCFLAGS_kcov.o := $(call cc-option, -fno-conserve-stack) -fno-stack-protector
435c9a8750SDmitry Vyukov
44391e43daSPeter Zijlstraobj-y += sched/
4501768b42SPeter Zijlstraobj-y += locking/
46dae5cbc2SRafael J. Wysockiobj-y += power/
47b9ee979eSJoe Perchesobj-y += printk/
480244ad00SMartin Schwidefskyobj-y += irq/
494102adabSPaul E. McKenneyobj-y += rcu/
50b700e7f0SSeth Jenningsobj-y += livepatch/
51cf65a0f6SChristoph Hellwigobj-y += dma/
52142781e1SThomas Gleixnerobj-y += entry/
53cfc1d277SAaron Tomlinobj-$(CONFIG_MODULES) += module/
54391e43daSPeter Zijlstra
55bfe3911aSChris Wilsonobj-$(CONFIG_KCMP) += kcmp.o
568174f150SMatt Helsleyobj-$(CONFIG_FREEZER) += freezer.o
57b03f6489SAdrian Bunkobj-$(CONFIG_PROFILING) += profile.o
588637c099SIngo Molnarobj-$(CONFIG_STACKTRACE) += stacktrace.o
59ad596171Sjohn stultzobj-y += time/
6077e52ae3SPeter Zijlstraobj-$(CONFIG_FUTEX) += futex/
611da177e4SLinus Torvaldsobj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
62351f8f8eSAmerigo Wangobj-$(CONFIG_SMP) += smp.o
639316fcacSAndrew Mortonifneq ($(CONFIG_SMP),y)
6453ce3d95SAndrew Mortonobj-y += up.o
6553ce3d95SAndrew Mortonendif
661da177e4SLinus Torvaldsobj-$(CONFIG_UID16) += uid16.o
67c8424e77SThiago Jung Bauermannobj-$(CONFIG_MODULE_SIG_FORMAT) += module_signature.o
681da177e4SLinus Torvaldsobj-$(CONFIG_KALLSYMS) += kallsyms.o
6930f3bb09SZhen Leiobj-$(CONFIG_KALLSYMS_SELFTEST) += kallsyms_selftest.o
701da177e4SLinus Torvaldsobj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
712c44b67eSBaoquan Heobj-$(CONFIG_VMCORE_INFO) += vmcore_info.o elfcorehdr.o
7285fcde40SBaoquan Heobj-$(CONFIG_CRASH_RESERVE) += crash_reserve.o
73*02aff848SBaoquan Heobj-$(CONFIG_KEXEC_CORE) += kexec_core.o
74*02aff848SBaoquan Heobj-$(CONFIG_CRASH_DUMP) += crash_core.o
75dc009d92SEric W. Biedermanobj-$(CONFIG_KEXEC) += kexec.o
76a43cac0dSDave Youngobj-$(CONFIG_KEXEC_FILE) += kexec_file.o
77175fca3bSSven Schnelleobj-$(CONFIG_KEXEC_ELF) += kexec_elf.o
786dab2778SArjan van de Venobj-$(CONFIG_BACKTRACE_SELF_TEST) += backtracetest.o
791da177e4SLinus Torvaldsobj-$(CONFIG_COMPAT) += compat.o
80201af4c0STejun Heoobj-$(CONFIG_CGROUPS) += cgroup/
81aee16ce7SPavel Emelyanovobj-$(CONFIG_UTS_NS) += utsname.o
82aee16ce7SPavel Emelyanovobj-$(CONFIG_USER_NS) += user_namespace.o
8374bd59bbSPavel Emelyanovobj-$(CONFIG_PID_NS) += pid_namespace.o
841da177e4SLinus Torvaldsobj-$(CONFIG_IKCONFIG) += configs.o
85f7b101d3SJoel Fernandes (Google)obj-$(CONFIG_IKHEADERS) += kheaders.o
86bbf1bb3eSTejun Heoobj-$(CONFIG_SMP) += stop_machine.o
87939a67fcSEric Parisobj-$(CONFIG_AUDIT) += audit.o auditfilter.o
88c8fc5d49SRichard Guy Briggsobj-$(CONFIG_AUDITSYSCALL) += auditsc.o audit_watch.o audit_fsnotify.o audit_tree.o
89939a67fcSEric Parisobj-$(CONFIG_GCOV_KERNEL) += gcov/
905c9a8750SDmitry Vyukovobj-$(CONFIG_KCOV) += kcov.o
911da177e4SLinus Torvaldsobj-$(CONFIG_KPROBES) += kprobes.o
924b1a29a7SMasami Hiramatsuobj-$(CONFIG_FAIL_FUNCTION) += fail_function.o
93c4338209SJason Wesselobj-$(CONFIG_KGDB) += debug/
94e162b39aSMandeep Singh Bainesobj-$(CONFIG_DETECT_HUNG_TASK) += hung_task.o
9558687acbSDon Zickusobj-$(CONFIG_LOCKUP_DETECTOR) += watchdog.o
961f423c90SDouglas Andersonobj-$(CONFIG_HARDLOCKUP_DETECTOR_BUDDY) += watchdog_buddy.o
976ea0d042SDouglas Andersonobj-$(CONFIG_HARDLOCKUP_DETECTOR_PERF) += watchdog_perf.o
981da177e4SLinus Torvaldsobj-$(CONFIG_SECCOMP) += seccomp.o
99b86ff981SJens Axboeobj-$(CONFIG_RELAY) += relay.o
10039732acdSEric W. Biedermanobj-$(CONFIG_SYSCTL) += utsname_sysctl.o
101ca74e92bSShailabh Nagarobj-$(CONFIG_TASK_DELAY_ACCT) += delayacct.o
102f3cef7a9SJay Lanobj-$(CONFIG_TASKSTATS) += taskstats.o tsacct.o
10397e1c18eSMathieu Desnoyersobj-$(CONFIG_TRACEPOINTS) += tracepoint.o
1049745512cSArjan van de Venobj-$(CONFIG_LATENCYTOP) += latencytop.o
105606576ceSSteven Rostedtobj-$(CONFIG_FUNCTION_TRACER) += trace/
106bc0c38d1SSteven Rostedtobj-$(CONFIG_TRACING) += trace/
107ea632e9fSJosh Triplettobj-$(CONFIG_TRACE_CLOCK) += trace/
1081155de47SPaul Mundtobj-$(CONFIG_RING_BUFFER) += trace/
109870915e0SMathieu Desnoyersobj-$(CONFIG_TRACEPOINTS) += trace/
11073f9b911SMasami Hiramatsuobj-$(CONFIG_RETHOOK) += trace/
111e360adbeSPeter Zijlstraobj-$(CONFIG_IRQ_WORK) += irq_work.o
112ab10023eSColin Crossobj-$(CONFIG_CPU_PM) += cpu_pm.o
113f89b7755SAlexei Starovoitovobj-$(CONFIG_BPF) += bpf/
114dfd402a4SMarco Elverobj-$(CONFIG_KCSAN) += kcsan/
115d08b9f0cSSami Tolvanenobj-$(CONFIG_SHADOW_CALL_STACK) += scs.o
1168fd4dddaSChristophe Leroyobj-$(CONFIG_HAVE_STATIC_CALL) += static_call.o
1178fd4dddaSChristophe Leroyobj-$(CONFIG_HAVE_STATIC_CALL_INLINE) += static_call_inline.o
118cf68fffbSSami Tolvanenobj-$(CONFIG_CFI_CLANG) += cfi.o
119fae85b7cSBorislav Petkov
120fae85b7cSBorislav Petkovobj-$(CONFIG_PERF_EVENTS) += events/
121fae85b7cSBorislav Petkov
1227a041097SAvi Kivityobj-$(CONFIG_USER_RETURN_NOTIFIER) += user-return-notifier.o
12316295becSSteffen Klassertobj-$(CONFIG_PADATA) += padata.o
124b77f0f3cSJason Baronobj-$(CONFIG_JUMP_LABEL) += jump_label.o
12591d1aa43SFrederic Weisbeckerobj-$(CONFIG_CONTEXT_TRACKING) += context_tracking.o
12651b1130eSPaul E. McKenneyobj-$(CONFIG_TORTURE_TEST) += torture.o
1271da177e4SLinus Torvalds
1285981690dSDan Williamsobj-$(CONFIG_HAS_IOMEM) += iomem.o
129d7822b1eSMathieu Desnoyersobj-$(CONFIG_RSEQ) += rseq.o
130c73be61cSDavid Howellsobj-$(CONFIG_WATCH_QUEUE) += watch_queue.o
13192281deeSDan Williams
1325df38ca6SAndy Shevchenkoobj-$(CONFIG_RESOURCE_KUNIT_TEST) += resource_kunit.o
1332cb80dbbSIurii Zaikinobj-$(CONFIG_SYSCTL_KUNIT_TEST) += sysctl-test.o
1342cb80dbbSIurii Zaikin
135005e696dSAlexander PopovCFLAGS_stackleak.o += $(DISABLE_STACKLEAK_PLUGIN)
136afaef01cSAlexander Popovobj-$(CONFIG_GCC_PLUGIN_STACKLEAK) += stackleak.o
137afaef01cSAlexander PopovKASAN_SANITIZE_stackleak.o := n
1380ebba714SMarco ElverKCSAN_SANITIZE_stackleak.o := n
139afaef01cSAlexander PopovKCOV_INSTRUMENT_stackleak.o := n
140afaef01cSAlexander Popov
141e9d338a0SPaul E. McKenneyobj-$(CONFIG_SCF_TORTURE_TEST) += scftorture.o
142e9d338a0SPaul E. McKenney
14313610aa9SMasahiro Yamada$(obj)/configs.o: $(obj)/config_data.gz
1441da177e4SLinus Torvalds
14546b41d5dSMasahiro Yamadatargets += config_data config_data.gz
14646b41d5dSMasahiro Yamada$(obj)/config_data.gz: $(obj)/config_data FORCE
1471da177e4SLinus Torvalds	$(call if_changed,gzip)
14843d8ce9dSJoel Fernandes (Google)
14946b41d5dSMasahiro Yamadafilechk_cat = cat $<
15046b41d5dSMasahiro Yamada
15146b41d5dSMasahiro Yamada$(obj)/config_data: $(KCONFIG_CONFIG) FORCE
15246b41d5dSMasahiro Yamada	$(call filechk,cat)
15346b41d5dSMasahiro Yamada
15443d8ce9dSJoel Fernandes (Google)$(obj)/kheaders.o: $(obj)/kheaders_data.tar.xz
15543d8ce9dSJoel Fernandes (Google)
15643d8ce9dSJoel Fernandes (Google)quiet_cmd_genikh = CHK     $(obj)/kheaders_data.tar.xz
1571463f74fSMasahiro Yamada      cmd_genikh = $(CONFIG_SHELL) $(srctree)/kernel/gen_kheaders.sh $@
15843d8ce9dSJoel Fernandes (Google)$(obj)/kheaders_data.tar.xz: FORCE
15943d8ce9dSJoel Fernandes (Google)	$(call cmd,genikh)
16043d8ce9dSJoel Fernandes (Google)
16143d8ce9dSJoel Fernandes (Google)clean-files := kheaders_data.tar.xz kheaders.md5
162