Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | # |
| 3 | # Makefile for the linux kernel. |
| 4 | # |
| 5 | |
Joe Perches | b9ee979 | 2013-07-31 13:53:42 -0700 | [diff] [blame] | 6 | obj-y = fork.o exec_domain.o panic.o \ |
Thomas Gleixner | 5cee964 | 2014-06-22 12:06:40 +0200 | [diff] [blame] | 7 | cpu.o exit.o softirq.o resource.o \ |
Xiaoming Ni | 88db0aa | 2020-08-14 17:31:07 -0700 | [diff] [blame] | 8 | sysctl.o capability.o ptrace.o user.o \ |
Luis R. Rodriguez | 0ce2c20 | 2017-09-08 16:17:12 -0700 | [diff] [blame] | 9 | signal.o sys.o umh.o workqueue.o pid.o task_work.o \ |
Thomas Gleixner | 5cee964 | 2014-06-22 12:06:40 +0200 | [diff] [blame] | 10 | extable.o params.o \ |
| 11 | kthread.o sys_ni.o nsproxy.o \ |
Robin Holt | 15d94b8 | 2013-07-08 16:01:32 -0700 | [diff] [blame] | 12 | notifier.o ksysfs.o cred.o reboot.o \ |
Al Viro | b4e9c95 | 2020-06-01 19:42:40 -0400 | [diff] [blame] | 13 | async.o range.o smpboot.o ucount.o regset.o |
Iulia Manda | 2813893 | 2015-04-15 16:16:41 -0700 | [diff] [blame] | 14 | |
Alexei Starovoitov | d71fa5c | 2020-08-18 21:27:58 -0700 | [diff] [blame] | 15 | obj-$(CONFIG_USERMODE_DRIVER) += usermode_driver.o |
Luis R. Rodriguez | 0ce2c20 | 2017-09-08 16:17:12 -0700 | [diff] [blame] | 16 | obj-$(CONFIG_MODULES) += kmod.o |
Iulia Manda | 2813893 | 2015-04-15 16:16:41 -0700 | [diff] [blame] | 17 | obj-$(CONFIG_MULTIUSER) += groups.o |
Peter Zijlstra | 029632f | 2011-10-25 10:00:11 +0200 | [diff] [blame] | 18 | |
Steven Rostedt | 606576c | 2008-10-06 19:06:12 -0400 | [diff] [blame] | 19 | ifdef CONFIG_FUNCTION_TRACER |
Li Bin | e11b956 | 2016-01-30 11:54:03 +0800 | [diff] [blame] | 20 | # Do not trace internal ftrace files |
Heiko Carstens | c0a80c0 | 2015-01-09 13:06:33 +0100 | [diff] [blame] | 21 | CFLAGS_REMOVE_irq_work.o = $(CC_FLAGS_FTRACE) |
Steven Rostedt | 1d09daa | 2008-05-12 21:20:55 +0200 | [diff] [blame] | 22 | endif |
| 23 | |
Dmitry Vyukov | 5c9a875 | 2016-03-22 14:27:30 -0700 | [diff] [blame] | 24 | # Prevents flicker of uninteresting __do_softirq()/__local_bh_disable_ip() |
| 25 | # in coverage traces. |
| 26 | KCOV_INSTRUMENT_softirq.o := n |
Marco Elver | 0ebba71 | 2019-11-14 19:02:58 +0100 | [diff] [blame] | 27 | # Avoid KCSAN instrumentation in softirq ("No shared variables, all the data |
| 28 | # are CPU local" => assume no data races), to reduce overhead in interrupts. |
| 29 | KCSAN_SANITIZE_softirq.o = n |
Dmitry Vyukov | 5c9a875 | 2016-03-22 14:27:30 -0700 | [diff] [blame] | 30 | # These are called from save_stack_trace() on slub debug path, |
| 31 | # and produce insane amounts of uninteresting coverage. |
| 32 | KCOV_INSTRUMENT_module.o := n |
| 33 | KCOV_INSTRUMENT_extable.o := n |
Dmitry Vyukov | 43e76af | 2020-01-30 22:17:35 -0800 | [diff] [blame] | 34 | KCOV_INSTRUMENT_stacktrace.o := n |
Dmitry Vyukov | 5c9a875 | 2016-03-22 14:27:30 -0700 | [diff] [blame] | 35 | # Don't self-instrument. |
| 36 | KCOV_INSTRUMENT_kcov.o := n |
Dmitry Vyukov | c1cb05e | 2020-12-15 20:46:46 -0800 | [diff] [blame] | 37 | # If sanitizers detect any issues in kcov, it may lead to recursion |
| 38 | # via printk, etc. |
Dmitry Vyukov | 5c9a875 | 2016-03-22 14:27:30 -0700 | [diff] [blame] | 39 | KASAN_SANITIZE_kcov.o := n |
Marco Elver | 0ebba71 | 2019-11-14 19:02:58 +0100 | [diff] [blame] | 40 | KCSAN_SANITIZE_kcov.o := n |
Dmitry Vyukov | c1cb05e | 2020-12-15 20:46:46 -0800 | [diff] [blame] | 41 | UBSAN_SANITIZE_kcov.o := n |
Marco Elver | 31a1b987 | 2020-08-11 18:36:56 -0700 | [diff] [blame] | 42 | CFLAGS_kcov.o := $(call cc-option, -fno-conserve-stack) -fno-stack-protector |
Dmitry Vyukov | 5c9a875 | 2016-03-22 14:27:30 -0700 | [diff] [blame] | 43 | |
Sami Tolvanen | cf68fff | 2021-04-08 11:28:26 -0700 | [diff] [blame] | 44 | # Don't instrument error handlers |
| 45 | CFLAGS_REMOVE_cfi.o := $(CC_FLAGS_CFI) |
| 46 | |
Peter Zijlstra | 391e43d | 2011-11-15 17:14:39 +0100 | [diff] [blame] | 47 | obj-y += sched/ |
Peter Zijlstra | 01768b4 | 2013-10-31 18:11:53 +0100 | [diff] [blame] | 48 | obj-y += locking/ |
Rafael J. Wysocki | dae5cbc | 2012-01-14 00:33:03 +0100 | [diff] [blame] | 49 | obj-y += power/ |
Joe Perches | b9ee979 | 2013-07-31 13:53:42 -0700 | [diff] [blame] | 50 | obj-y += printk/ |
Martin Schwidefsky | 0244ad0 | 2013-08-30 09:39:53 +0200 | [diff] [blame] | 51 | obj-y += irq/ |
Paul E. McKenney | 4102ada | 2013-10-08 20:23:47 -0700 | [diff] [blame] | 52 | obj-y += rcu/ |
Seth Jennings | b700e7f | 2014-12-16 11:58:19 -0600 | [diff] [blame] | 53 | obj-y += livepatch/ |
Christoph Hellwig | cf65a0f | 2018-06-12 19:01:45 +0200 | [diff] [blame] | 54 | obj-y += dma/ |
Thomas Gleixner | 142781e | 2020-07-22 23:59:56 +0200 | [diff] [blame] | 55 | obj-y += entry/ |
Peter Zijlstra | 391e43d | 2011-11-15 17:14:39 +0100 | [diff] [blame] | 56 | |
Chris Wilson | bfe3911 | 2021-02-05 22:00:12 +0000 | [diff] [blame] | 57 | obj-$(CONFIG_KCMP) += kcmp.o |
Matt Helsley | 8174f15 | 2008-10-18 20:27:19 -0700 | [diff] [blame] | 58 | obj-$(CONFIG_FREEZER) += freezer.o |
Adrian Bunk | b03f648 | 2008-07-25 01:45:35 -0700 | [diff] [blame] | 59 | obj-$(CONFIG_PROFILING) += profile.o |
Ingo Molnar | 8637c09 | 2006-07-03 00:24:38 -0700 | [diff] [blame] | 60 | obj-$(CONFIG_STACKTRACE) += stacktrace.o |
john stultz | ad59617 | 2006-06-26 00:25:06 -0700 | [diff] [blame] | 61 | obj-y += time/ |
Peter Zijlstra | 77e52ae | 2021-09-23 14:10:50 -0300 | [diff] [blame] | 62 | obj-$(CONFIG_FUTEX) += futex/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 63 | obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o |
Amerigo Wang | 351f8f8 | 2011-01-12 16:59:39 -0800 | [diff] [blame] | 64 | obj-$(CONFIG_SMP) += smp.o |
Andrew Morton | 9316fca | 2009-01-14 09:35:44 -0800 | [diff] [blame] | 65 | ifneq ($(CONFIG_SMP),y) |
Andrew Morton | 53ce3d9 | 2009-01-09 12:27:08 -0800 | [diff] [blame] | 66 | obj-y += up.o |
| 67 | endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 68 | obj-$(CONFIG_UID16) += uid16.o |
| 69 | obj-$(CONFIG_MODULES) += module.o |
Dmitry Torokhov | b1ae6dc | 2022-01-05 13:55:12 -0800 | [diff] [blame] | 70 | obj-$(CONFIG_MODULE_DECOMPRESS) += module_decompress.o |
David Howells | b56e5a1 | 2013-08-30 16:07:30 +0100 | [diff] [blame] | 71 | obj-$(CONFIG_MODULE_SIG) += module_signing.o |
Thiago Jung Bauermann | c8424e7 | 2019-07-04 15:57:34 -0300 | [diff] [blame] | 72 | obj-$(CONFIG_MODULE_SIG_FORMAT) += module_signature.o |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 73 | obj-$(CONFIG_KALLSYMS) += kallsyms.o |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 74 | obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o |
Hari Bathini | 692f66f | 2017-05-08 15:56:18 -0700 | [diff] [blame] | 75 | obj-$(CONFIG_CRASH_CORE) += crash_core.o |
Dave Young | 2965faa | 2015-09-09 15:38:55 -0700 | [diff] [blame] | 76 | obj-$(CONFIG_KEXEC_CORE) += kexec_core.o |
Eric W. Biederman | dc009d9 | 2005-06-25 14:57:52 -0700 | [diff] [blame] | 77 | obj-$(CONFIG_KEXEC) += kexec.o |
Dave Young | a43cac0 | 2015-09-09 15:38:51 -0700 | [diff] [blame] | 78 | obj-$(CONFIG_KEXEC_FILE) += kexec_file.o |
Sven Schnelle | 175fca3 | 2019-08-23 21:49:13 +0200 | [diff] [blame] | 79 | obj-$(CONFIG_KEXEC_ELF) += kexec_elf.o |
Arjan van de Ven | 6dab277 | 2008-01-30 13:33:08 +0100 | [diff] [blame] | 80 | obj-$(CONFIG_BACKTRACE_SELF_TEST) += backtracetest.o |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 81 | obj-$(CONFIG_COMPAT) += compat.o |
Tejun Heo | 201af4c | 2016-12-27 14:49:05 -0500 | [diff] [blame] | 82 | obj-$(CONFIG_CGROUPS) += cgroup/ |
Pavel Emelyanov | aee16ce | 2008-02-08 04:18:23 -0800 | [diff] [blame] | 83 | obj-$(CONFIG_UTS_NS) += utsname.o |
| 84 | obj-$(CONFIG_USER_NS) += user_namespace.o |
Pavel Emelyanov | 74bd59b | 2008-02-08 04:18:24 -0800 | [diff] [blame] | 85 | obj-$(CONFIG_PID_NS) += pid_namespace.o |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 86 | obj-$(CONFIG_IKCONFIG) += configs.o |
Joel Fernandes (Google) | f7b101d | 2019-05-15 17:35:51 -0400 | [diff] [blame] | 87 | obj-$(CONFIG_IKHEADERS) += kheaders.o |
Tejun Heo | bbf1bb3 | 2010-05-08 16:20:53 +0200 | [diff] [blame] | 88 | obj-$(CONFIG_SMP) += stop_machine.o |
Eric Paris | 939a67f | 2009-12-17 20:12:06 -0500 | [diff] [blame] | 89 | obj-$(CONFIG_AUDIT) += audit.o auditfilter.o |
Richard Guy Briggs | c8fc5d4 | 2018-11-16 12:17:35 -0500 | [diff] [blame] | 90 | obj-$(CONFIG_AUDITSYSCALL) += auditsc.o audit_watch.o audit_fsnotify.o audit_tree.o |
Eric Paris | 939a67f | 2009-12-17 20:12:06 -0500 | [diff] [blame] | 91 | obj-$(CONFIG_GCOV_KERNEL) += gcov/ |
Dmitry Vyukov | 5c9a875 | 2016-03-22 14:27:30 -0700 | [diff] [blame] | 92 | obj-$(CONFIG_KCOV) += kcov.o |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 93 | obj-$(CONFIG_KPROBES) += kprobes.o |
Masami Hiramatsu | 4b1a29a | 2018-01-13 02:56:03 +0900 | [diff] [blame] | 94 | obj-$(CONFIG_FAIL_FUNCTION) += fail_function.o |
Jason Wessel | c433820 | 2009-05-19 07:49:32 -0500 | [diff] [blame] | 95 | obj-$(CONFIG_KGDB) += debug/ |
Mandeep Singh Baines | e162b39 | 2009-01-15 11:08:40 -0800 | [diff] [blame] | 96 | obj-$(CONFIG_DETECT_HUNG_TASK) += hung_task.o |
Don Zickus | 58687ac | 2010-05-07 17:11:44 -0400 | [diff] [blame] | 97 | obj-$(CONFIG_LOCKUP_DETECTOR) += watchdog.o |
Nicholas Piggin | 05a4a95 | 2017-07-12 14:35:46 -0700 | [diff] [blame] | 98 | obj-$(CONFIG_HARDLOCKUP_DETECTOR_PERF) += watchdog_hld.o |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 99 | obj-$(CONFIG_SECCOMP) += seccomp.o |
Jens Axboe | b86ff981 | 2006-03-23 19:56:55 +0100 | [diff] [blame] | 100 | obj-$(CONFIG_RELAY) += relay.o |
Eric W. Biederman | 39732ac | 2007-02-14 00:33:58 -0800 | [diff] [blame] | 101 | obj-$(CONFIG_SYSCTL) += utsname_sysctl.o |
Shailabh Nagar | ca74e92 | 2006-07-14 00:24:36 -0700 | [diff] [blame] | 102 | obj-$(CONFIG_TASK_DELAY_ACCT) += delayacct.o |
Jay Lan | f3cef7a | 2006-09-30 23:28:55 -0700 | [diff] [blame] | 103 | obj-$(CONFIG_TASKSTATS) += taskstats.o tsacct.o |
Mathieu Desnoyers | 97e1c18 | 2008-07-18 12:16:16 -0400 | [diff] [blame] | 104 | obj-$(CONFIG_TRACEPOINTS) += tracepoint.o |
Arjan van de Ven | 9745512 | 2008-01-25 21:08:34 +0100 | [diff] [blame] | 105 | obj-$(CONFIG_LATENCYTOP) += latencytop.o |
Steven Rostedt | 606576c | 2008-10-06 19:06:12 -0400 | [diff] [blame] | 106 | obj-$(CONFIG_FUNCTION_TRACER) += trace/ |
Steven Rostedt | bc0c38d | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 107 | obj-$(CONFIG_TRACING) += trace/ |
Josh Triplett | ea632e9 | 2012-09-02 19:45:14 -0700 | [diff] [blame] | 108 | obj-$(CONFIG_TRACE_CLOCK) += trace/ |
Paul Mundt | 1155de4 | 2009-06-25 14:30:12 +0900 | [diff] [blame] | 109 | obj-$(CONFIG_RING_BUFFER) += trace/ |
Mathieu Desnoyers | 870915e | 2010-10-28 11:31:17 -0400 | [diff] [blame] | 110 | obj-$(CONFIG_TRACEPOINTS) += trace/ |
Peter Zijlstra | e360adb | 2010-10-14 14:01:34 +0800 | [diff] [blame] | 111 | obj-$(CONFIG_IRQ_WORK) += irq_work.o |
Colin Cross | ab10023 | 2011-02-10 02:04:45 -0800 | [diff] [blame] | 112 | obj-$(CONFIG_CPU_PM) += cpu_pm.o |
Alexei Starovoitov | f89b775 | 2014-10-23 18:41:08 -0700 | [diff] [blame] | 113 | obj-$(CONFIG_BPF) += bpf/ |
Marco Elver | dfd402a | 2019-11-14 19:02:54 +0100 | [diff] [blame] | 114 | obj-$(CONFIG_KCSAN) += kcsan/ |
Sami Tolvanen | d08b9f0 | 2020-04-27 09:00:07 -0700 | [diff] [blame] | 115 | obj-$(CONFIG_SHADOW_CALL_STACK) += scs.o |
Josh Poimboeuf | 9183c3f | 2020-08-18 15:57:42 +0200 | [diff] [blame] | 116 | obj-$(CONFIG_HAVE_STATIC_CALL_INLINE) += static_call.o |
Sami Tolvanen | cf68fff | 2021-04-08 11:28:26 -0700 | [diff] [blame] | 117 | obj-$(CONFIG_CFI_CLANG) += cfi.o |
Borislav Petkov | fae85b7 | 2010-10-26 20:24:03 +0200 | [diff] [blame] | 118 | |
| 119 | obj-$(CONFIG_PERF_EVENTS) += events/ |
| 120 | |
Avi Kivity | 7a04109 | 2009-10-25 14:24:45 +0200 | [diff] [blame] | 121 | obj-$(CONFIG_USER_RETURN_NOTIFIER) += user-return-notifier.o |
Steffen Klassert | 16295be | 2010-01-06 19:47:10 +1100 | [diff] [blame] | 122 | obj-$(CONFIG_PADATA) += padata.o |
Olaf Hering | 93a7205 | 2011-03-23 16:43:29 -0700 | [diff] [blame] | 123 | obj-$(CONFIG_CRASH_DUMP) += crash_dump.o |
Jason Baron | b77f0f3 | 2011-08-05 16:40:40 -0400 | [diff] [blame] | 124 | obj-$(CONFIG_JUMP_LABEL) += jump_label.o |
Frederic Weisbecker | 91d1aa43 | 2012-11-27 19:33:25 +0100 | [diff] [blame] | 125 | obj-$(CONFIG_CONTEXT_TRACKING) += context_tracking.o |
Paul E. McKenney | 51b1130 | 2014-01-27 11:49:39 -0800 | [diff] [blame] | 126 | obj-$(CONFIG_TORTURE_TEST) += torture.o |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 127 | |
Dan Williams | 5981690 | 2018-03-29 19:07:13 -0700 | [diff] [blame] | 128 | obj-$(CONFIG_HAS_IOMEM) += iomem.o |
Mathieu Desnoyers | d7822b1 | 2018-06-02 08:43:54 -0400 | [diff] [blame] | 129 | obj-$(CONFIG_RSEQ) += rseq.o |
David Howells | c73be61 | 2020-01-14 17:07:11 +0000 | [diff] [blame] | 130 | obj-$(CONFIG_WATCH_QUEUE) += watch_queue.o |
Dan Williams | 92281dee | 2015-08-10 23:07:06 -0400 | [diff] [blame] | 131 | |
Andy Shevchenko | 5df38ca | 2020-11-03 22:45:08 +0200 | [diff] [blame] | 132 | obj-$(CONFIG_RESOURCE_KUNIT_TEST) += resource_kunit.o |
Iurii Zaikin | 2cb80db | 2019-09-23 02:02:47 -0700 | [diff] [blame] | 133 | obj-$(CONFIG_SYSCTL_KUNIT_TEST) += sysctl-test.o |
| 134 | |
Alexander Popov | 005e696 | 2020-06-24 15:33:26 +0300 | [diff] [blame] | 135 | CFLAGS_stackleak.o += $(DISABLE_STACKLEAK_PLUGIN) |
Alexander Popov | afaef01 | 2018-08-17 01:16:58 +0300 | [diff] [blame] | 136 | obj-$(CONFIG_GCC_PLUGIN_STACKLEAK) += stackleak.o |
| 137 | KASAN_SANITIZE_stackleak.o := n |
Marco Elver | 0ebba71 | 2019-11-14 19:02:58 +0100 | [diff] [blame] | 138 | KCSAN_SANITIZE_stackleak.o := n |
Alexander Popov | afaef01 | 2018-08-17 01:16:58 +0300 | [diff] [blame] | 139 | KCOV_INSTRUMENT_stackleak.o := n |
| 140 | |
Paul E. McKenney | e9d338a | 2020-06-24 15:59:59 -0700 | [diff] [blame] | 141 | obj-$(CONFIG_SCF_TORTURE_TEST) += scftorture.o |
| 142 | |
Masahiro Yamada | 13610aa | 2019-03-07 16:29:53 -0800 | [diff] [blame] | 143 | $(obj)/configs.o: $(obj)/config_data.gz |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 144 | |
Masahiro Yamada | 46b41d5 | 2021-04-25 15:24:07 +0900 | [diff] [blame] | 145 | targets += config_data config_data.gz |
| 146 | $(obj)/config_data.gz: $(obj)/config_data FORCE |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 147 | $(call if_changed,gzip) |
Joel Fernandes (Google) | 43d8ce9 | 2019-04-26 15:04:29 -0400 | [diff] [blame] | 148 | |
Masahiro Yamada | 46b41d5 | 2021-04-25 15:24:07 +0900 | [diff] [blame] | 149 | filechk_cat = cat $< |
| 150 | |
| 151 | $(obj)/config_data: $(KCONFIG_CONFIG) FORCE |
| 152 | $(call filechk,cat) |
| 153 | |
Joel Fernandes (Google) | 43d8ce9 | 2019-04-26 15:04:29 -0400 | [diff] [blame] | 154 | $(obj)/kheaders.o: $(obj)/kheaders_data.tar.xz |
| 155 | |
| 156 | quiet_cmd_genikh = CHK $(obj)/kheaders_data.tar.xz |
Masahiro Yamada | 1463f74 | 2019-10-08 21:05:55 +0900 | [diff] [blame] | 157 | cmd_genikh = $(CONFIG_SHELL) $(srctree)/kernel/gen_kheaders.sh $@ |
Joel Fernandes (Google) | 43d8ce9 | 2019-04-26 15:04:29 -0400 | [diff] [blame] | 158 | $(obj)/kheaders_data.tar.xz: FORCE |
| 159 | $(call cmd,genikh) |
| 160 | |
| 161 | clean-files := kheaders_data.tar.xz kheaders.md5 |